IviSwtch_GetPath

CVI/LabWindows IVI Class Driver

IviSwtch_GetPath

IviSwtchBase Capability Group

C Function Prototype

ViStatus IviSwtch_GetPath (ViSession vi, ViConstString channel1, ViConstString channel2, ViInt32 bufSize, ViChar pathList[]);

Purpose

In some cases there is more than one possible path between two channels. The driver or the instrument selects the path when you connect two channels with the IviSwtch_Connect function. Thus, you cannot guarantee that every call to the IviSwtch_Connect function establishes exactly the same path when you pass the same channels. This function returns a string that uniquely identifies the path you create with the IviSwtch_Connect function. The first and the last names in the string are the channels names of the path, all other names represent configuration channels involved in the path creation. You can pass this string to the IviSwtch_SetPath function to establish the exact same path in the future.

Note  This function returns only those paths that you explicitly create by calling the IviSwtch_Connect and IviSwtch_SetPath functions. For example, if you connect channels CH1 and CH3, and then channels CH2 and CH3, the explicit path between channels CH1 and Ch2 does not exist and this function returns the IVISWTCH_ERROR_NO_SUCH_PATH error.

Parameters

Inputs Type Description
vi ViSession The instrument handle that you obtain from the IviSwtch_init or IviSwtch_InitWithOptions functions. The handle identifies a particular IVI session.
channel1 ViConstString You identify a path with two channels. Pass one of the virtual channel names for which you want to create a path. Pass the other channel name as the channel2 parameter.

Virtual channel names are aliases for instrument specific channel strings. The instrument specific channel strings can differ from one instrument to another. Virtual channel names allow you to use and swap instruments without having to change the channel names in your source code. You assign a virtual channel name to an instrument specific channel through MAX. This control accepts virtual channel names you have assigned to the specific instrument you are using. It also accepts the instrument specific channel names.

Note  You can specify the channel name as a string variable or as a literal enclosed in double quotes.
channel2 ViConstString You identify a path with two channels. Pass one of the virtual channel names for which you want to create a path. Pass the other channel name as the channel1 parameter.

Virtual channel names are aliases for instrument specific channel strings. The instrument specific channel strings can differ from one instrument to another. Virtual channel names allow you to use and swap instruments without having to change the channel names in your source code. You assign a virtual channel name to an instrument specific channel through MAX. This control accepts virtual channel names you have assigned to the specific instrument you are using. It also accepts the instrument specific channel names.

Note  You can specify the channel name as a string variable or as a literal enclosed in double quotes.
bufSize ViInt32 Pass the number of bytes in the ViChar array you specify for the pathList parameter.

If the current value of the attribute, including the terminating NULL byte, contains more bytes that 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 "R1->C1" and the Buffer Size is 4, the function places "R1-" in the buffer and returns 7.

If you pass 0, you can pass VI_NULL for the pathList parameter. This enables you to find out the path size and to allocate the buffer of the appropriate size before calling this function again.
     
Outputs Type Description
pathList ViChar[] The comma-separated path between channels you specify in the channel1 and channel2 parameters.

Return Values