beautypg.com

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

Page 51

background image

Universal Library Virtual Instruments (VIs)

Counter VIs

C8254Cfg.VI

Configures an 8254 counter for desired operation. This VI can only be used with 8254 counters.

Summary:

Inputs:

BoardNum

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

be 0 to 100.

CounterNum

[U32] - The counter number to configure

Config

[U32] - Sets the mode of the counter.

Outputs:

BoardNum

(Out) [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

(input)

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

specified board must have an 8254 counter.

CounterNum

Selects a counter channel. An 8254 has three counters. The value can be 1-n, where

n is the number of 8254 counters on the board.

Refer to board-specific information contained in the Universal Library User's

Guide (available on our web site at

www.mccdaq.com/PDFmanuals/sm-ul-user-

guide.pdf

).

Config

Sets the mode of the counter which defines the terminal count behavior and/or the

waveform of the counter OUT pin. Refer to the 8254 data sheet for a detailed
description of each of the configurations.

Config

can be set to one of the following

constants:

HIGHONLASTCOUNT

: Output of the counter (OUT N) transitions from low to high on

terminal count and remains high until reset. See mode 0 on the 8254 data sheet.

ONESHOT

: Output of the counter (OUT N) transitions from high to low on rising

edge of GATE N, then back to high on terminal count. See mode 1 on the 8254
data sheet.

RATEGENERATOR

: Output of the counter (OUT N) pulses low for one clock cycle on

terminal count and reloads the counter and recycles. See mode 2 on the 8254 data
sheet.

SQUAREWAVE

: Output of the counter (OUT N) is high for count < 1/2 terminal count

then low until terminal count, whereupon it recycles. This mode generates a square
wave. See mode 3 on the 8254 data sheet.

SOFTWARESTROBE

Output of the counter (OUT N) pulses low for one clock cycle on

terminal count. Count starts after counter is loaded. See mode 4 on the 8254 data
sheet.

HARDWARESTROBE

: Output of the counter (OUT N) pulses low for one clock cycle

on terminal count. Count starts on rising edge at GATE N input. See mode 5 on the
8254 data sheet.

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

ErrCod

e into a readable string.

51