<< Click to Display Table of Contents >> Simple multiple color change |
|
Suppose we have a certain object (let there be a valve) that has several operating modes (open, closed, mode1, mode2). We want to display an object on the screen with a different color depending on the operating mode.
1. Let's create a State tag, which is responsible for the operating mode of the valve (select the data type - Byte (8bit), and the default value is 0):
2. Let's create an object - Valve ISA and set the "Fill Color" property depending on the tag value:
State |
Color |
---|---|
0 |
RED |
1 |
GREEN |
2 |
BLUE |
3 |
YELLOW |
To do this, in the “Fill Color” tab, check the “Enable Property and select the “Tag.PV in Range” type, and then set the colors for each mode:
3. Let's Run simulation to check the settings:
You can download this project here.