Example: Time-out

This example illustrates how to create a time-out. After issuing a move command, the user program has a time-out period (this example will use 5000 milliseconds) in which the axis must reach position. If the axis does not reach position within the time-out period, a discrete output turns on. If the axis does reach position within the time-out period, a different discrete output turns on.

This example makes use of the _SysMS tag. The _SysMS tag holds the number of milliseconds since the RMC powered up. It is a 32-bit DINT, and will wrap around to -2147483648 after it reaches its maximum value of 2147483647.

If you need a time-out that tracks values less then one millisecond (e.g. the loop time is less then one millisecond), then you may wish to use the _Controller.SysTime_usec tag instead, which has units of microseconds.

Example

  1. Define a Variable
    Define a variable, called
    StartTime. Define it as a DINT:


     

  2. Write a User Program
    The User Program will consist of the following:

 

 

See Also

Programming Examples Overview


Send comments on this topic.

Copyright © 2024 Delta Computer Systems, Inc. dba Delta Motion