17.3 Exercise
This section explains the basics of the feature. Please utilize the feature according to your site environment. |
Exercise: Setting the function of a vending machine with the schedule feature
a) Create three digital tags named βVENDINGβ, βLIGHTβ, and βWASHERβ.
Β
b) Click [Tools] β [Schedule] to bring up the βSchedule Listβ dialog box.
Β
c) Press the [Add Schedule] button and add each schedule as shown below.
Title: Vending machine power ON
Time Setting: Check βRepeat Settingsβ and specify the time as 6:30, daily.
Task Setting: Select the βCommandβ option and enter the operation as βVENDING = 1β.
Title: Activate washer
Time Setting: Check βRepeat Settingsβ and specify the time as 6:31, daily.
Task Setting: Select the βCommandβ option and enter the operation as βWASHER = 1β.
Title: Light ON
Time Setting: Check βRepeat Settingsβ and specify the time as 18:30, daily.
Task Setting: Select the βCommandβ option and enter the operation as βLIGHT = 1β.
Title: Vending machine power / light OFF
Time Setting: Check βRepeat Settingsβ and specify the time as 23:30, daily.
Task Setting: Select the βWrite Tag Valueβ option and add βVENDINGβ and βLIGHTβ to the list.
Enter each tag name and value into the text field, then press [Add] to register the tag, as shown below.
d) There should be four schedules in the βSchedule Listβ dialog box as shown below. Press [Save and Close] to saves the schedules.
e) Create a touch object for opening the βSchedule Settingβ dialog box.
Function | Touch | |
Action | Command Expression | |
Command | ScheduleConfig(); |
f) Launch the project in Xpanel. Each function of the vending machine activates at the designated time according to the schedule settings. Every day, the power is turned on at 6:30, and the washer operates at 6:31. The light turns on at 18:30, and both the power and light are turned off at 23:30. You can change the time data of the schedule by pressing the touch object.
Β