16.3 Exercise

16.3 Exercise

Exercise: Setting the function of a vending machine with the Scheduler feature

  1. Create three BOOL tags named β€œWasher”, β€œLight”, and β€œVending”.

    Tag Editor

    Β 

  2. Create 3 different action lists by clicking Tools > Script Editor… > click + icon > Create New Commands > name the first action list β€œActivate Vending” > click Add New Command, then assign the value β€œtrue” to the β€œVending” tag > click OK.

  3. Repeat this step for the second and third action list called β€œActivate Washer” and β€œActivate Light”. Make sure to assign a corresponding tag in the Parameters section

    Command Editor

    Β 

  4. Create 3 different schedules by clicking Tools > Schedule Editor… > click + icon. Each Schedule Title will be β€œActivate Vending”, β€œActivate Washer”, and β€œActivate Light”.

  5. Configure the schedule setup based on the information provided below and make sure to assign a corresponding action in the Action section.

    1. Activate Vending: Start on 2023-03-01 at 07:30 military time and repeat every 1 day.

    2. Activate Washer: Start on 2023-03-22 at 07:45 military time and repeat once a week every Wednesday.

    3. Activate Light: Start on 2023-03-01 at 18:00 military time and repeat once every first day of the month.

      Schedule Configuration

      Β 

  6. Create three different text boxes and bind the β€œVending”, β€œWasher”, and β€œLight” tags to the Text property of their respective text boxes.

    Text Property

    Β 

    Β 

  7. To observe the operation of the scheduler, adjust the scheduled start date to occur the current date and start times to occur within the next 5 minutes, then run the simulator. At the scheduled start time of their respective schedule, the tag values should display β€œ1”.

    Canvas Simulator

Β