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.
Β
Β