Cload.vi – Measurement Computing UL for NI LabVIEW User Manual
Page 65
Universal Library Virtual Instruments (VIs)
Counter VIs
CLoad.VI
Loads the specified counter's register with a count value. The counter and register are specified by the
RegName argument. When you want to load a counter with a value to count from, it is never loaded directly
into the counter's count register. It is loaded into the load or hold register. From there, the counter, after
enabled, loads the count from the appropriate register, generally on the first valid pulse.
Inputs:
BoardNum
[U32] - The board number assigned when installed with InstaCal. Can
be 0 to 100.
RegName
[U32] - Register to load with
LoadValue
.
LoadValue
[U16] - Value to load into
RegName
register.
Outputs:
BoardNum
[U32] The board number assigned when installed with InstaCal. Can be
0 to 100. Can be used to pass
BoardNum
parameter to another VI..
ErrCode
[U32] - Error code. See ErrMsg.VI
Arguments:
BoardNum
The board number associated with a board when it was installed.
RegName
The register to load the count to. Valid values are:
LOADREG1
..
20
: Load registers 1 through 20. This may span several chips.
HOLDREG1
..
20
: Hold registers 1 through 20. This may span several chips. (9513
only)
ALARM1CHIP1
: Alarm register 1 of the first counter chip. (9513 only)
ALARM2CHIP1
: Alarm register 2 of the first counter chip. (9513 only)
ALARM1CHIP2
: Alarm register 1 of the second counter chip. (9513 only)
ALARM2CHIP2
: Alarm register 2 of the second counter chip. (9513 only)
ALARM1CHIP3
: Alarm register 1 of the third counter chip. (9513 only)
ALARM2CHIP3
: Alarm register 2 of the third counter chip. (9513 only)
ALARM1CHIP4
: Alarm register 1 of the four counter chip. (9513 only)
ALARM2CHIP4
: Alarm register 2 of the four counter chip. (9513 only)
COUNT1
...
4
: Current Count (LS7266 only)
PRESET1
...
4
: Preset register (LS7266 only)
PRESCALER1
...
4
: Prescaler register (LS7266 only)
LoadValue
The value to be loaded. Must be between 0 and 2
Resolution
- 1 of the counter. For
example, a 16-bit counter is 2
16
- 1, or 65,535.
BoardNum
(output)
The board number used when installed with InstaCal. This parameter can be used
to serialize VIs such that this VI precedes the next VI whose
BoardNum
is attached
to this output.
ErrCode
Error code returned from the Universal Library. Zero if no error occurred. Use the
ErrMsg VI to convert
ErrCode
into a readable string.
Notes:
CLoad.VI vs. CLoad32.VI: Although the CLoad.VI and CLoad32.VI perform the same operation,
CLoad32.VI is the preferred function to use.
The only difference between the two is that CLoad.VI loads a 16-bit count value and CLoad32.VI loads a 32-
bit value. Both CLoad.VI and CLoad32.VI can be used, but CLoad32.VI is required whenever you need to
load count values greater than 16 bits (counts > 65535).
65