Changing States on Change in Word Address Value (Range)

The color and shape of the lamp changes based on which range the value of the variable falls into.

You can display up to 256 states.

Example Operation

Setting Workflow

  1. Add Variables
  2. Set up Parts

Add Variables

Project Explorer : [Variables] ➞ [All Variables]

Add the below variable(s).

Variables property:

[Name] [Data Type]

Var1

[Word]

Set up Parts

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

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

N-State Lamp object (Name: N_StateLamp1) properties:

Tab Sub Tab Property Value
[Function] [Basic] [Type] [Word]
[State Change Condition] [Range]
[Number of States] 4

[Variable]

[Variable] [Name]: Var1

[State Condition]

[Condition] 0 <= X < 50
[Condition] 50 <= X < 100
[Condition] 100 <= X < 150
[Shape] [Text] [States] [State 0] [Text] State 0
[State 1] [Text] State 1
[State 2] [Text] State 2
[State 3] [Text] State 3
[Basic] [States] [State 0] to [State 3] [Fill] [Type] [Solid]
[Value] [ID] ID:(Any)