beautypg.com

Measurement Computing UL for NI LabVIEW User Manual

Page 53

background image

Universal Library Virtual Instruments (VIs)

Counter VIs

MODULO_N

- In modulo-n mode, an upper limit is set by loading the

PRESET

register

with a maximum count. When counting up, if the maximum count is reached, the
counter will roll-over to 0 and continue counting up. Likewise, when counting
down, if the count reaches 0, it will roll over to the maximum count (in the

PRESET

register) and continue counting down.

DataEncoding

Selects the format of the data that is returned by the counter (Binary or BCD).

IndexMode

Selects which action will be taken when the Index signal is received.

IndexMode

must be set to

INDEX_DISABLED

whenever Quadrature is set to

NON_QUAD

or when

Gating

is set to

ENABLED

.

INDEX_DISABLED

- The Index signal is ignored.

LOAD_CTR

- The counter is loaded whenever the Index signal ON the LCNTR pin

occurs

LOAD_OUT_LATCH

- The current count is latched whenever the

Index

signal on the

LCNTR pin occurs. When this mode is selected, the

CIn()

function returns the

same count each time it is called until the Index signal occurs.

RESET_CTR

- The counter is reset to 0 whenever the

Index

signal on the RCNTR

pin occurs

InvertIndex

Selects the polarity of the Index signal. If set to

DISABLED

the Index signal is

assumed to be positive polarity. If set to

ENABLED

the Index signal is assumed to be

negative polarity.

FlagPins

Selects which signals will be routed to the FLG1 and FLG2 pins.

CARRY_BORROW

- FLG1 pin is CARRY output, FLG2 is

BORROW

output

COMPARE_BORROW

- FLG1 pin is COMPARE output, FLG2 is

BORROW

output

CARRYBORROW_UPDOWN

- FLG1 pin is

CARRY/BORROW

output, FLG2 is

UP/DOWN

signal

INDEX_ERROR

- FLG1 is

INDEX

output, FLG2 is error output

Gating

If

Gating

is set to

ENABLED

(True), the RCNTR pin will be used as a gating signal

for the counter. Whenever

Gating

=

ENABLED

,

IndexMode

must be set to

DISABLE_INDEX

.

ErrCode

Error code returned from the Universal Library. Zero if no error occurred. Use the

ErrMsg VI to convert

ErrCode

into a readable string.

53