niSwitch_GetChannelName

NI-SWITCH Functions

niSwitch_GetChannelName

IviSwtchBase Capability Group

C Function Prototype

ViStatus niSwitch_GetChannelName (ViSession vi, ViInt32 index, ViInt32 bufferSize, ViChar[] channelNameBuffer);

Purpose

Returns the channel string that is in the channel table at the specified index.

Use niSwitch_GetChannelName in a For Loop to get a complete list of valid channel names for the switch. Use the NISWITCH_ATTR_CHANNEL_COUNT attribute to determine the number of channels.

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 Value of Channel Count attribute.

bufferSize ViInt32 Pass the number of bytes in the ViChar array you specify for the Channel Name Buffer parameter. If the channel 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 bufferSize 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.

channelNameBuffer ViChar[] Returns the channel name that is in the channel table at the index you specify.