niSwitch_GetRelayName

NI-SWITCH Functions

niSwitch_GetRelayName

Specific Function

C Function Prototype

ViStatus niSwitch_GetRelayName (ViSession vi, ViInt32 index, ViInt32 relayNameBufferSize, ViChar[] relayNameBuffer);

Purpose

Returns the relay name string that is in the relay list at the specified index.

Use niSwitch_GetRelayName in a For Loop to get a complete list of valid relay names for the switch. Use the NISWITCH_ATTR_NUMBER_OF_RELAYS attribute to determine the number of relays.

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.

index ViInt32 A 1-based index into the channel table. The default value is 1. The maximum value is the value of the NISWITCH_ATTR_CHANNEL_COUNT attribute.

relayNameBufferSize ViInt32 Pass the number of bytes in the ViChar array you specify for the relayNameBuffer parameter. If the relay name string, including the terminating NUL byte, contains more bytes than you indicate in this parameter, the function copies Buffer Size - 1 bytes into the buffer, places an ASCII NULL byte at the end of the buffer, and returns the buffer size you must pass to get the entire value. For example, if the value is "123456" and relayBufferSize is 4, the function places "123" into the buffer and returns 7. If you pass a negative number, the function copies the value to the buffer regardless of the number of bytes in the value. If you pass 0, you can pass VI_NULL for the Coercion Record buffer parameter.

relayNameBuffer ViChar[] Returns the relay name for the index you specify.