Read High-Speed Clock And Compute Time Difference Overview; Rhc Instruction Operation - Allen-Bradley SLC 500 Series Reference Manual

Hide thumbs Also See for SLC 500 Series:
Table of Contents
Read High-speed Clock and
Compute Time Difference
Overview
TDF and RHC instructions are used together. The RHC is used to record the
start and stop time of an event. The TDF is used to calculate the time
difference between the recorded start and stop times from the RHC
instruction.

RHC Instruction Operation

SLC 500 maintains a 20-bit integer free running clock. This 20-bit value
increments every 10 μs. The free running clock is non-retentive, a power cycle
resets the free running clock to 0. It is accessed using the RHC instruction.
When the RHC rung is true, the instruction moves the current value of the 10
μs free running clock into the destination address. If the destination is an
integer address, the RHC moves the first 16 least significant bits to the
destination address. If the destination is a float address, the instruction
converts the 20-bit free running clock integer value into a float and moves this
value to the destination address. Once the free running clock reaches 0x000F
FFFF (10.48575 seconds), it wraps around to 0 and continues incrementing.
The RHC instruction does have an inherent latency
TIP
due to execution time. The 20-bit float and 16-bit
integer do not have the same amount of latency. A
20-bit float destination has additional latency due to
the integer to float conversion. The accuracy of this
instruction is based on the latency of the RHC
instruction and potential hardware interrupts. See Table
7.6, "Accuracy (in counts: 1 count = 10 µs)," for more
information.
Table 7.6 Accuracy (in counts: 1 count = 10 µs)
Processor
SLC 5/05
Integer
Float
SLC 5/04
Integer
Float
SLC 5/03
Integer
Float
Application Specific Instructions
Best Case
Worst Case
1
26
1
29
1
26
1
29
1
53
2
62
Publication 1747-RM001G-EN-P - November 2008
7-15
Typical
1
2
1
2
2
3
Table of Contents
loading

Table of Contents