Changing States based on Changes to a Combination of Multiple Bits

A single lamp can display in different colors the combined ON/OFF states of up to 4 BOOL variables, resulting in 16 states. By setting up different colors, the combined 16 states can be displayed on a single lamp.

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

[BOOL]

Var2

[BOOL]

Var3

[BOOL]

Var4

[BOOL]

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] [Bit]
[State Change Condition] [State]
[Number of States] 16
[Variables] [Variable] [Variable] [Name]: Var1
[Variable] [Variable] [Name]: Var2
[Variable] [Variable] [Name]: Var3
[Variable] [Variable] [Name]: Var4
[Shape]

[Text]

[States]

[State 0] to [State 15] [Text] State * (Type the status number in "*")
[Basic] [States] [State 0] to [State 15] [Fill] [Type] [Solid]
[Value] [ID] ID:(Any)