This example demonstrates how to start and stop timers in Scripting as well as how to change the value of the timer variable from a script.
The standard library calls are used to read and write variables and to fire events , what is unique about the timers is the group location the objects are listed under.
Timer Object Locations:
- Timer Action ID's are listed under TimerIDs.xxxx
- The Timer Variable is listed under the standard system VariableIDs.xxxx
Script Examples:
void $Inc One Shot Timer$ ()//incrementing the timer variable
{
int32 temptimer;
smRead(VariableIDs.UE___OneShotTimerTimerVariable, temptimer);
temptimer = temptimer + 10; //increment by 10 mSec
smWrite(VariableIDs.UE___OneShotTimerTimerVariable, temptimer);
}
void $Start OneShot Timer$ ()// Starting the one-shot timer
{
SendAction(ApplicationIDs.CCM, ActionIDs.CCM_Start_Timer, TimerIDs.UE___OneShotTimerTimerVariable);
}
The example was created in version 2.9.23044 for a PV780.
Comments
0 comments
Please sign in to leave a comment.