beautypg.com

Cfreqin.vi – Measurement Computing UL for NI LabVIEW User Manual

Page 61

background image

Universal Library Virtual Instruments (VIs)

Counter VIs

CFreqIn.VI

Measures the frequency of a signal. This VI can only be used with 9513 counters, and uses internal counters
#5 and #4.

Summary:

Inputs:

BoardNum

[U32] - The board number assigned when installed with InstaCal. Can

be 0 to 100.

SigSource

[U32] - Specifies which signal will be measured

GateInterval

[I16] - Gating interval in milliseconds

Outputs:

Count

[U32] - The raw count is returned here

Freq

[U32] - The measured frequency in Hz returned here.

ErrCode

[I32] - Error code. See ErrMsg.VI

Arguments:

BoardNum

The board number associated with a board when it was installed with InstaCal. The

specified board must have a 9513 counter.

SigSource

Specifies the source of the signal from which the frequency will be calculated.

The signal to be measured is routed internally from the source specified by

SigSource

to the clock input of counter 5. On boards with more than one 9513

chip, there is more than one counter 5. Which counter 5 is used is also determined
by

SigSource

.

SigSource

can be set to one of the following values:

CTRINPUT1 through CTRINPUT5

GATE1 through GATE4

One 9513
chip:

FREQ1 through FREQ5

Chip 1 used

CTRINPUT1 through CTRINPUT10

GATE 1 through GATE 9 (excluding gate 5)

Two 9513
chips:

FREQ1 through FREQ10

Chip 1 or Chip 2
used

CTRINPUT1 through CTRINPUT20

GATE1 through GATE19 (excluding gates 5, 10 & 15)

Four 9513
chips:

FREQ1 through FREQ20

Chips 1- 4 can
be used

The

SigSource

value determines which chip is used. CTRINPUT6 through

CTRINPUT10, FREQ6 through FREQ10 and GATE6 through GATE9 indicate
chip 2 will be used. The signal to measure must be present at the chip 2 input
specified by

SigSource

. Also, the gating connection from counter 4 output to

counter 5 gate must be made between counters 4 and 5 of this chip (see "Notes" on
page 63)
. See board-specific information to determine valid values for your board.

GateInterval

Specifies the time (in milliseconds) that the counter will be counting. The optimum

GateInterval

depends on the frequency of the measured signal. The counter can

count up to 65535.

If the gating interval is too low, then the count will be too low and the resolution of

the frequency measurement will be poor. For example, if the count changes from 1
to 2 the measured frequency doubles.

If the gating interval in too long then the counter will overflow and a

FREQOVERRUN

error will occur.

Count

The counts reached during the gating interval.

Freq

The measured frequency in Hz.

ErrCode

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

ErrMsg VI to convert

ErrCode

into a readable string.

61