# Displaying a Count Down Timer

Display a timer that counts down from 3 minutes down to 0.

## Example Operation

## Setting Workflow

Add Variables

Set up Converter

Set up Parts

Set up Script

## Add Variables

### Project Explorer : [Variables] ➞ [All Variables]

Add the below variable(s).

#### Variables property:

[Name] | [Data Type] | [Initial Value]
Var1 | [WORD] | 180
Var2 | [BOOL] |

## Set Up Converter

### Project Explorer : [Converters] ➞ [User-Defined Converters]

Add the below converter(s).

[Name] | [Type]
Converter1 | [Range]

#### Converter1 property:

Tab | Property | Value
[Basic] | [Data Type (Source)] | [Numeric]
[Data Type (Result)] | [ColorCode]
[Range] | 4
[Range1] | [Data (Input)] | 6
[Operator] | >
[Value] |
[Range2] | [Data (Input)] | 3
[Operator] | >
[Value] |
[Range3] | [Data (Input)] | 0
[Operator] | >
[Value] |
[Else Condition] | [Value] |

## Set Up Parts

### Project Explorer : [Screen Design] ➞ [Screens] ➞ [Screen1]

Drag and drop the following objects from the [Tool Chest] to the screen.

#### Time Display (Name: TimeDisplay01) properties:

Tab | Sub Tab | Property | Value
[Function] | [Basic] | [Current Value] | [Variable] [Name]: Var1
[Unit] | [Sec]
[Format] | nn:ss
[Shape] | [Basic] | [Fill] | [Type] | [Solid]
[Value] | [Variable] [Name]: Var1 [Converter]: [User-Defined Converters] ➞ [Converter1]

#### Lamp (Name: Lamp01) properties:

Tab | Sub Tab | Property | Value
[Function] | [Basic] | [Current Value] | [Variable] [Name]: Var2
[Touch] | [Operation] | [Type] | [Bit]
[Operation] | [Toggle]
[Destination] | [Variable] [Name]: Var2
[Shape] | [Text] | [Off] | [Text] | Count Down OFF
[On] | [Text] | Count Down ON

## Set Up Scripts

### Project Explorer : [Screen Design] ➞ [Screens] ➞ [Screen1]

Set the following script on the object.

From the [Tool Chest] drag and drop the script to the Script editor.

Legend | Block
1 | [Triggers] ➞ [Periodic/Schedule] ➞ [Periodic]
2 | [Logic] ➞ [If Do]
3 | [Logic] ➞ [Comparison Condition]
4 | [Values] ➞ [Variable]
5 | [Values] ➞ [Constant]
6 | [Operations] ➞ [Value Change] ➞ [Value Change]