niSwitch_GetRelayCount
Specific Function
C Function Prototype
ViStatus niSwitch_GetRelayCount (ViSession vi, ViConstString relayName, ViInt32* relayCount);
Purpose
Returns the number of times the relay has changed from closed to open. Relay count is useful for tracking relay lifetime and usage. Call niSwitch_WaitForDebounce before niSwitch_GetRelayCount to ensure an accurate count.
Refer to Devices to determine if the switch module supports individual relay control.
Parameters
Name | Type | Description |
---|---|---|
vi | ViSession | A particular NI-SWITCH session established with niSwitch_InitWithTopology, niSwitch_InitWithOptions, or niSwitch_init and used for all subsequent NI-SWITCH calls. |
relayName | ViConstString | Name of the relay. Refer to Devices for a list of valid relay names for the switch module. Examples of valid relay names: ch0, ab0, 1wire, hlselect |
relayCount | ViInt32 | The number of relay cycles. |