| This section explains the basics of the feature. Please utilize the feature according to your site environment. |
Exercise: Using Switch/Lamp object as an ON/OFF button
a) Create a digital tag ‘SWITCH’ in the database.
b) Click [Draw] – [Switch/Lamp] or the icon. Go to [Lamp] tab in the switch/lamp configuration window.
c) Check ‘Enable Lamp’ option and select the tag type as digital tag.
d) Assign the ‘Number of States’ as 2 and select the condition for ‘Change by Data Input’. Enter the ‘SWITCH’ in the tag name 1.
e) Press [Shape Select] to assign the different images for each state of the switch object. To open the window marked as ‘3’ in the diagram below, the ‘Enable Lamp’ box in the [Lamp] tab must be unchecked.
f) Go to [Switch] tab. Select ‘Bit Switch’ function and enter the tag name ‘SWITCH’ in the field. Add the toggle function as ‘Touch down’ action.
g) Launch the project in the Xpanel or simulator. When you press the switch/lamp object, the image is reversed while SWITCH tag is toggled.