Scheduler Running Script

I have set up a schedule which should trigger a tag which is used to run a script. On the screen I have placed a flag so that I can see when the tag has been triggered. This never happens.

(All)
Calendar 16:53:00 Time_To_Set_The_Clocks 1
Calendar 16:54:00 Time_To_Set_The_Clocks 0

What I did next was to create a button to toggle this tag Time_To_Set_The_Clocks. This works OK but I now find that the script which was meant to be triggered is not triggered.

Description:
SetTheClocks

Execution:
Time_To_Set_The_Clocks

Variables available only for this group can be declared here.
Dim CurrentTime, CurrentDate
CurrentTime = $Hour*10000+$Minute*100+$Second
CurrentDate = $Num($StrRight($Str($Year),2))*1000000+$Month*10000+$Day*100+$Weekday

'The code configured here is executed while the condition configured in the Execution field is TRUE.
ConvertTemp()

//This is the clock on the DL06 Gas Boiler
$Gas_Boiler_PLC_Time = CurrentTime
$Gas_Boiler_PLC_Date = CurrentDate
$Gas_Boiler.Set__The__Clock = 1


I Am not getting any warning message but I felt that there must be something wrong with my bit of code which prevented the script from running. I then copied the code and pasted it into the Main Procedures as a sub routine. When I call the sub with a button the code does work properly.

My problem basically, how do you get a schedule to run, and then how to you get it to run a script.
  • Event: Calendar
    Time: 16:53:00
    Expression: RunVBScript("NameOfGlobalProcedure")
  • Calendar 13:06:06 RunVBScript("SetPLCClock")

    I have changed the schedule as suggested, but I think my problem is that the schedule does not actually run. When I was trying it to turn a tag on and off, that never worked for me. This is not working either.

    To test the script out I created a button and put the command $RunVBScript("SetPLCClock") and this works, but as I say the schedule never triggers this.
  • I have just discovered my problem. The software I use to backup the project folder seems to be preventing the schedules from running. I have removed the Indusoft project out of the backup settings and now it is working.

    One last question, the schedule runs a global procedure "SetPLCClock". I have also created a script which is just a copy of the global sub, and given it a new name. How do I call that script or should I not be using scripts because they are for a different type of operation. The backup software is MEGAsync.
  • The Script worksheet is designed to run continuously whenever a condition is met. If you want it to execute only once you need to create a tag that is used to execute the script and the script needs to reset that tag. This is an extra step (& tag) that is not needed when calling a global procedure directly from the scheduler.