IviPwrMeter_GetChannelName
IviPwrMeterBase Capability Group
C Function Prototype
ViStatus IviPwrMeter_GetChannelName (ViSession vi, ViInt32 index, ViInt32 bufferSize, ViChar[] channelName);
Purpose
This function returns the physical channel identifier that corresponds to the one-based index specified by the ChannelIndex parameter.
Notes:
(1) If you pass in a value for the ChannelIndex parameter that is less than one or greater than the value of the Channel Count attribute, the function returns an empty string in the ChannelName parameter and returns an error.
(2) By passing 0 for the buffer size, you can ascertain the buffer size required to get the entire channel name string and then call the function again with a sufficiently large buffer.
Parameters
Name | Type | Description |
---|---|---|
vi | ViSession | The ViSession handle that you obtain from the IviPwrMeter_init or IviPwrMeter_InitWithOptions function. The handle identifies a particular instrument session. Default Value: None |
index | ViInt32 | A 1-based index into the channel table.
Valid Range: 1 to number of channels. Default Value: 1 |
bufferSize | ViInt32 | Pass the number of bytes in the ViChar array you specify for the Channel Name parameter.
If the channel name, including the terminating NUL byte, contains more bytes than you indicate in this parameter, the function copies BufferSize - 1 bytes into the buffer, places an ASCII NUL 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 the Buffer Size 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 Channel Name buffer parameter. Default Value: None |
channelName | ViChar[] | Returns the highest-level channel name that corresponds to the specific driver channel string that is in the channel table at an index you specify..
The buffer must contain at least as many elements as the value you specify with the Buffer Size parameter. If the channel name description, including the terminating NUL byte, contains more bytes than you indicate with the Buffer Size parameter, the function copies Buffer Size - 1 bytes into the buffer, places an ASCII NUL 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 the Buffer Size is 4, the function places "123" into the buffer and returns 7. If you pass 0 for the Buffer Size, you can pass VI_NULL for this parameter. |