| This section explains the basics of the feature. Please utilize the feature according to your site environment. |
Exercise: Using a 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 the [Lamp] tab in the switch/lamp configuration window.
c) Check the ‘Enable Lamp’ option and select the tag type as a 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 the ‘Bit Switch’ function and enter the tag name ‘SWITCH’ in the field. Add the toggle function as a ‘Touch down’ action.
g) Launch the project in the Xpanel or simulator. When you press the switch/lamp object, the image is reversed while the SWITCH tag is toggled.