Link Type - Timer

Link Type:

TimerSt/Exp (T, hex 0x54, dec 84) - Start Timer/Timer Expired
TimerNExp (t, hex 0x74, dec 116) - Timer Not Expired

Link Value:

0 to start timer, otherwise timer preset in milliseconds

Range:

0 to start timer, or 1 to 65,535 milliseconds

 

Note: This feature is supported in RMC100 CPU firmware dated 20010420 or later.

 

These link types are used to start a timer and to wait for the timer to reach a preset. The DelayMS (D) link type offers similar functionality. However, while the DelayMS link type starts the timer when the event step is reached, the Timer (T and t) link types separate the starting and checking of the timer into two or more steps. This allows the following capabilities that are not available using the Delay (D) link type:

To support these various features, the Timer (T and t) link types come in three forms. Details for entering these forms into an Event Step table are given at the end of this topic.

There is one timer per axis. The Timer (T and t) link types use the timer of the axis running the current event sequence. Therefore, it is possible to have as many timers running as axes are available, but no more. However, the timer used by this link type is separate from the timer used by the DelayMS (D) link type. Therefore, it is possible to have one or more DelayMS (D) link types in a process that is also being timed by a Timer (T or t) link type.

Note: This timer is only accurate to within one control loop (1 or 2 ms). For example, if a Timer (T) link type is used with a preset of one millisecond, then the link may be taken either on the first control loop or the second control loop of an RMC with a one-millisecond control loop. This will not affect most applications since much larger timeouts will be used with lower resolution requirements.

Example 1:

In this example, the user wants to make two moves, wait for each to complete, and then wait until ten seconds has passed since the beginning of the cycle before repeating.

 

Step 10

Step 11

Step 12

Step 13

Mode

0x0000

0x0081

0x0081

0x0000

Accel

0

100

100

0

Decel

0

100

100

0

Speed

0

10000

10000

0

Command Value

0

4000

8000

0

Command

 

G

G

 

Commanded Axes

Default

Default

Default

Default

Link Type

TimerSt/Exp

BitsON

BitsON

TimerSt/Exp

Link Value

0

0x0001

0x0001

10000

Link Next

11

12

13

10

Step 10 starts the timer and links immediately to step 11.

Step 11 starts a move to the first position and waits for the axis to get in position using the BitsON (B) link type, at which time control moves to step 12.

Step 12 starts a move to the second position and waits for the axis to get in position using the BitsON (B) link type, at which time control moves to step 13.

Step 13 waits for the timer to reach ten seconds, at which time control jumps back to step 10.

Example 2:

In this example, the user wants to move to a position, but if the axis does not get in position within five seconds, he/she wants to turn on discrete output 0. The following sequence accomplishes this:

 

Step 10

Step 11

Step 12

Step 13

Step 14

&

Mode

0x0081

0x0081

0x0081

0x0081

0x0000

 

Accel

100

100

100

100

0

 

Decel

100

100

100

100

0

 

Speed

10000

10000

10000

10000

0

 

Command Value

4000

0

0

0

0x0001

 

Command

G

?

?

 

[

 

Commanded Axes

Default

Default

Default

Default

Default

 

Link Type

TimerSt/Exp

BitsON

TimerSt/Exp

DelayMS

DelayMS

 

Link Value

0

0x0001

5000

0

0

 

Link Next

11

15

14

11

15

 

Step 10 initiates the move to 4000, starts the timer, and links immediately to step 11.

Step 11 checks the In Position bit of the Status Word using the BitsON (b) link type. Therefore, if the axis is in position, then the link is taken to step 15. Otherwise, control passes to step 12.

Step 12 checks if 5000 ms (five seconds) have expired since the timer was started in step 10. If the timer is expired, then control passes to step 14. Otherwise, control passes to step 13.

Step 13 immediately links back to step 11 to restart the polling loop. Notice that this extra step does take one control loop to process and therefore increases the time taken to process the entire polling loop by one control loop (1 or 2 ms).

Step 14 handles the timeout condition by turning on discrete output 0.

Now, compare this method of implementing a timeout with the one used in the next example, which is a little more difficult to follow but removes the need for the extra do-nothing step in the polling loop (step 13 above).

Example 3:

This example offers an alternative approach to the same problem as Example 2: the user wants to make a move and wait for the move to complete or a timeout to occur. It is a little more difficult to follow, but removes one step from the polling loop, therefore reducing the amount of time taken to catch any condition. Keep in mind that for many applications, this slight gain in performance will not justify the reduction in clarity.

 

Step 10

Step 11

Step 12

Step 13

&

Mode

0x0081

0x0081

0x0081

0x0000

 

Accel

100

100

100

0

 

Decel

100

100

100

0

 

Speed

10000

10000

10000

0

 

Command Value

4000

0

0

0x0001

 

Command

G

?

?

[

 

Commanded Axes

Default

Default

Default

Default

 

Link Type

TimerSt/Exp

BitsON

TimerNExp

DelayMS

 

Link Value

0

0x0001

5000

0

 

Link Next

11

14

11

14

 

Step 10 initiates the move to 4000, starts the timer, and links immediately to step 11.

Step 11 checks the In Position bit of the Status Word using the BitsON (b) link type. Therefore, if the axis is in position, then the link is taken to step 14. Otherwise, control passes to step 12.

Step 12 checks if 5000 ms (five seconds) have expired since the timer was started in step 10. Notice that, this time, the Timer Not Expired (t) link type is used. Therefore, if the timeout has not occurred, then control jumps back to step 11. If the timeout has occurred, then control passes to step 13.

Step 13 handles the timeout condition by turning on discrete output 0.

Here is a summary of the advantages and disadvantages of doing a polled loop using this method versus the method shown in Example 2:

Example 4:

In this example, the user wants to complete a move, and then turn on and off discrete output 0 at five and ten seconds respectively since the start of the move.

 

Step 10

Step 11

Step 12

Step 13

Step 14

Mode

0x0000

0x0081

0x0000

0x0000

0x0000

Accel

0

100

0

0

0

Decel

0

100

0

0

0

Speed

0

10000

0

0

0

Command Value

0

4000

0

0x0001

0x0001

Command

 

G

 

[

]

Commanded Axes

Default

Default

Default

Default

Default

Link Type

TimerSt/Exp

BitsON

TimerSt/Exp

TimerSt/Exp

DelayMS

Link Value

0

0x0001

5000

10000

0

Link Next

11

12

13

14

0

Step 10 starts the timer and links immediately to step 11.

Step 11 starts the move and waits for the move to complete using the BitsON (B) link type before linking to step 12.

Step 12 waits until five seconds have expired since the timer was started in step 10 before linking to step 13.

Step 13 turns on discrete output 0 and waits until ten seconds have expired since the timer was started in step 10 before linking to step 14.

Step 14 turns discrete output 0 back off before linking back to step 0.

Using with the Link Type and Link Value Dialog Box

  1. Under Link Type Category, select System-wide (Basic, non-axis).

  2. Under Link Type, select Timer.

  3. Under Link Condition, select one of the following:

  1. If you selected either the second or third option above, then type the preset (timeout) value in the Timer Value text box.

  2. Click OK.

Using without the Link Type and Link Value Dialog Box

  1. Enter a Link Type:

  1. Enter a Link Value

 

See also:

DelayMS (D) link type

Poll (?) command

 


Copyright (c) 1997-2015 by Delta Computer Systems, Inc.