/
6.7.2 Exercise

6.7.2 Exercise

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.

Β 

Β 



Related content