# C8254Config()

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

For more information, refer to the 82C54 data sheet (82C54.pdf) in the Documents subdirectory where the UL is installed (C:\Program files\Measurement Computing\DAQ by default).

Member of the MccBoard class.

## Function Prototype

VB .NET

Public Function C8254Config(ByVal counterNum As Integer, ByVal config As MccDaq.C8254Mode) As MccDaq.ErrorInfo

C# .NET

public MccDaq.ErrorInfo C8254Config(int counterNum, MccDaq.C8254Mode config)

## Parameters

counterNum

Selects one of the counter channels. An 8254 has three counters. The value may be 1 – n, where n is the number of 8254 counters on the board (refer to the board-specific information in the UL Users Guide).

config

Refer to the 8254 data sheet for a detailed description of each of the configurations. Set it to one of the constants in the config parameter values section below.

## Returns

- An ErrorInfo object that indicates the status of the operation.

### config parameter values

All of the config settings are MccDaq.C8254Mode enumerated constants. To set a variable to one of these constants, you must refer to the MccDaq object and the C8254Mode enumeration (for example, variable = MccDaq.C8254Mode.HighOnLastCount, variable = MccDaq.C8254Mode.LastShot, etc.).

HardwareStrobe | Output of counter (OUT N) pulses low for one clock cycle on terminal count. Count starts on rising edge at GATE N input. See Mode 5 in the 8254 data sheet (82C54.pdf) in the Documents subdirectory where the UL is installed (C:/Program files/Measurement Computing/DAQby default).
HighOnLastCount | Output of counter (OUT N) transitions from low to high on terminal count and remains high until reset. See Mode 0 in the 8254 data sheet (82C54.pdf).
OneShot | Output of counter (OUT N) transitions from high to low on rising edge of GATE N, then back to high on terminal count. See Mode 1 in the 8254 data sheet (82C54.pdf).
RateGenerator | Output of counter (OUT N) pulses low for one clock cycle on terminal count, reloads counter and recycles. See Mode 2 in the 8254 data sheet (82C54.pdf).
SoftwareStrobe | Output of counter (OUT N) pulses low for one clock cycle on terminal count. Count starts after counter is loaded. See Mode 4 in the 8254 data sheet (82C54.pdf).
SquareWave | Output of 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 in the 8254 data sheet (82C54.pdf).