Section 7. Measurement Instructions
7-24
binary format by preceding the number with "&B". For example if the mask is
entered as &B100 (leading zeros can be omitted in binary format just as in
decimal) and ports 3 and 1 are high as in the previous example, the result of the
instruction will be 4 (decimal, binary = 100); if port 3 is low, the result would be
0.
Examples
ReadIO
(Port3, 6, &B100)
' read port 3 on the CR9070/CR9071E card in slot
6
' if port 3 is high then Port3 = 4, if port 3 is low then Port3 = 0
Parameter
& Data Type
Enter
READIO INSTRUCTION PARAMTERS
Dest
Variable or
Array
The Variable in which to store the results of the instruction. When Reps are used the results are stored in
an array with the variable name. An array must be dimensioned to have elements for all the Reps.
PSlot
Constant
The number of the slot that holds the 9070 Counter Timer Module for the measurement.
Mask
Constant
The Mask allows the read or write to only act on certain ports. The Mask is ANDed with the value
obtained from the 9070 when reading and ANDed with the source before writing.
TimerIO (Dest, PSlot, Edges 16–9, Edges 8–1, Function 16–9,
Function 8–1, AllDoneFlag)
The TimerIO instruction is used to measure the time between edges (state
transitions) on the digital I/O channels of the CR9070/CR9071E Counter and
Digital I/O Module as well as on the Pulse channels on the CR9071E module .
The transitions can be either on the rising edge (low to high) or falling edge
(high to low) of the signal. The states are nominally 0 V low and 5 V high.
When TimerIO is the only measurement in a scan and the time since previous
channel is measured on 4 channels, the fastest interval is approximately 140
microseconds. . Instruction cannot rep from one module to the next.
There are six functions that can be performed:
The period (msec) of the signal on a channel (CR9070 or CR9071E)
The frequency (hertz) of the signal (CR9071E only)
The time (msec) since an edge on the previous channel (1 number lower) to an
edge on the specified channel. (CR9070 or CR9071E)
The time (msec) from an edge on channel 1 to an edge on the specified
channel. (CR9070 or CR9071E)
Number of edges since last execution. (CR9071E only)
Number of edges since last edge on channel 1 (CR9071E only). Only one
function may be programmed per channel. The number of values returned
is determined by the number of channels for which a result is requested.
There are two AllDoneFlag operating modes for this instruction:
One is to check each scan for transitions that have occurred since the
previous scan. A flag is set true when there are results for all
measurements requested. The resolution of the timing measurement
when using the I/O channels (only option when using the CR9070) is
the scan interval. When using the CR9071E's Pulse channels, the
resolution is 40 nanoseconds.
Содержание CR9000
Страница 6: ...CR9000 Table of Contents iv This is a blank page ...
Страница 22: ...CR9000 Overview OV 16 This is a blank page ...
Страница 26: ...Section 1 Installation 1 4 CR9000 FIGURE 1 1 3 CR9000 Battery Pack ...
Страница 72: ...Section 3 CR9000 Measurement Details 3 28 This is a blank page ...
Страница 88: ...Section 5 Program Declarations 5 6 This is a blank page ...
Страница 217: ...This is a blank page ...