# C9513Config()

Sets all of the configurable options of a 9513 counter.

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

Member of the MccBoard class.

## Function Prototype

VB .NET

Public Function C9513Config(ByVal counterNum As Integer, ByVal gateControl As MccDaq.GateControl, ByVal counterEdge As MccDaq.CountEdge, ByVal counterSource As MccDaq.CounterSource, ByVal specialGate As MccDaq.OptionState, ByVal reload As MccDaq.Reload, ByVal recycleMode As MccDaq.RecycleMode, ByVal bcdMode As MccDaq.BCDMode, ByVal countDirection As MccDaq.CountDirection, ByVal outputControl As MccDaq.C9513OutputControl) As MccDaq.ErrorInfo

C# .NET

public MccDaq.ErrorInfo C9513Config(int counterNum, MccDaq.GateControl gateControl, MccDaq.CountEdge counterEdge, MccDaq.CounterSource counterSource, MccDaq.OptionState specialGate, MccDaq.Reload reload, MccDaq.RecycleMode recycleMode, MccDaq.BCDMode bcdMode, MccDaq.CountDirection countDirection, MccDaq.C9513OutputControl outputControl)

## Parameters

counterNum

Counter number (1 - n) where n is the number of counters on the board. (For example, a CIO-CTR5 has 5, a CIO-CTR10 has 10, and so on. See board-specific info).

gateControl

Sets the gating response for level, edge, etc. Set it to one of the constants in the "gateControl parameter values" section below.

counterEdge

Which edge to count. Referred to as "Source Edge" in the 9513 data book. Can be set to POSITIVEEDGE (count on rising edge) or NEGATIVEEDGE (count on falling edge).

counterSource

Each counter may be set to count from one of 16 internal or external sources. Set it to one of the constants in the "counterSource parameter values" section below.

specialGate

Special gate may be enabled (MccDaq.OptionState.Enabled) or disabled (MccDaq.OptionState.Disabled).

reload

Reload the counter from the load register (reload = MccDaq.Reload.LoadReg) or alternately load from the load register, then the hold register (reload = MccDaq.Reload.LoadAndHoldReg).

recycleMode

Execute once (MccDaq.RecycleMode.OneTime) or reload and recycle (MccDaq.RecycleMode.Recycle) to count repetitively.

bcdMode

Counter may operate in binary coded decimal count (MccDaq.BCDMode.BCDCount) or binary count (MccDaq.BCDMode.BinaryCount).

countDirection

AM9513 may count up (MccDaq.CountDirection.CountUp) or down (MccDaq.CountDirection.CountDown).

outputControl

The type of output desired. Set it to one of the constants in the "outputControl parameter values" section below.

## Returns

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

### gateControl parameter values

All of the gateControl settings are MccDaq.GateControl enumerated constants. To set a variable to one of these constants, you must refer to the MccDaq object and the GateControl enumeration (for example, variable = MccDaq.GateControl.NoGate, variable = MccDaq.GateControl.AhlTcPrevCtr, etc.).

NoGate | No gating
AhlTcPrevCtr | Active high TCN -1
AhlNextGate | Active High Level GATE N + 1
AhlPrevGate | Active High Level GATE N - 1
AhlGate | Active High Level GATE N
AllGate | Active Low Level GATE N
AheGate | Active High Edge GATE N
Alegate | Active Low Edge GATE N

### counterSource parameter values

All of the counterSource settings are MccDaq.CounterSource enumerated constants. To set a variable to one of these constants, you must refer to the MccDaq object and the CounterSource enumeration (for example, variable = MccDaq.CounterSource.TcPrevCtr, variable = MccDaq.CounterSource.CtrInput1, etc.).

TcPrevCtr | TCN - 1 (Terminal count of previous counter)
CtrInput1 | SRC 1 (Counter Input 1)
CtrInput2 | SRC 2 (Counter Input 2)
CtrInput3 | SRC 3 (Counter Input 3)
CtrInput4 | SRC 4 (Counter Input 4)
CtrInput5 | SRC 5 (Counter Input 5)
Gate1 | GATE1
Gate2 | GATE2
Gate3 | GATE3
Gate4 | GATE4
Gate5 | GATE5
Freq1 | F1
Freq2 | F2
Freq3 | F3
Freq4 | F4
Freq5 | F5

### outputControl parameter values

All of the outputControl settings are MccDaq.9513OutputControl enumerated constants. To set a variable to one of these constants, you must refer to the MccDaq object and the 9513OutputControl enumeration (for example, variable = MccDaq.9513OutputControl.AlwaysLow, variable = MccDaq.9513OutputControl.HighPulseOnTc, etc.).

AlwaysLow | AlwaysLow
HighPulseOnTc | High pulse on Terminal Count
ToggleOnTc | TC Toggled
Disconnected | Inactive, Output High Impedance
LowPulseOnTc | Active Low Terminal Count Pulse
3, 6, 7 | (numeric values) Illegal

## Notes

- The information provided here and in C9513Init() will only help you understand how Universal Library syntax corresponds to the 9513 data sheet (9513A.pdf). It is not a substitute for the data sheet. You cannot program and use a 9513 counter/timer without it.