Announcement

Collapse
No announcement yet.

How to code A timer in ViCi which can be stopped and resetted.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to code A timer in ViCi which can be stopped and resetted.

    Hi all,

    I am trying to code one hour countdown timer in ViCi and gen4-pa to be used to control relay but unfortunately I'm finding it hard to code a timer which can be stopped and resetted. Also if they are used, how does the timer functions are used in here.

    Best regards,
    Miksu

  • #2
    Hi Miksu,

    To set a timer, you can use the command:
    Code:
    sys_SetTimer(timernum, value);
    To get the timer value, you can use the command:
    Code:
    sys_GetTimer(timernum);
    You can also create a Timer Event which can be called when the timer reaches 0.
    Code:
    sys_SetTimerEvent(timernum, function)
    Another timer function which you can use is sys_T();

    For reference, please take a look at this example from another forum thread: https://forum.4dsystems.com.au/node/65540

    Additional information is written on the Diablo16 Internal Functions Reference Manual.

    I hope this helps.
    Best Regards,
    Kevin

    Comment

    Working...
    X