niDCPower_GetChannelName

NI-DCPower Function Reference

niDCPower_GetChannelName

ViStatus niDCPower_GetChannelName (ViSession vi, ViInt32 index, ViInt32 bufferSize, ViChar channelName[]);

Purpose

Retrieves the output channelName that corresponds to the requested index. Use the NIDCPOWER_ATTR_CHANNEL_COUNT attribute to determine the upper bound of valid values for index.

Parameters

Input
Name Type Description
vi ViSession Identifies a particular instrument session. vi is obtained from the niDCPower_init or niDCPower_InitWithOptions function.
index ViInt32 Specifies which output channel name to return. The index values begin at 1.

bufferSize ViInt32 Specifies the number of bytes in the ViChar array you specify for channelName. If the channelName, including the terminating NUL byte, contains more bytes than you indicate in this attribute, 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 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 channelName.
Output
Name Type Description
channelName ViChar[] Returns the output channel name that corresponds to index.

Return Value

Name Type Description
StatusViStatus

Reports the status of this operation. To obtain a text description of the status code, call niDCPower_error_message. To obtain additional information concerning the error condition, call niDCPower_GetError.