niSwitch_RelayControl

NI-SWITCH Functions

niSwitch_RelayControl

Specific Function

C Function Prototype

ViStatus niSwitch_RelayControl (ViSession vi, ViConstString relayName, ViInt32 relayAction);

Purpose

Controls individual relays of the switch. When controlling individual relays, the protection offered by setting the usage of source channels and configurations channels is void.

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
relayAction ViInt32 Specifies whether to open or close a given relay.

Defined values:
NISWITCH_VAL_OPEN_RELAY
NISWITCH_VAL_CLOSE_RELAY (default).