NI DCPOWER Attribute Functions - ni/grpc-device GitHub Wiki

Attribute Functions

niDCPower_SetAttributeViInt32

ViStatus niDCPower_SetAttributeViInt32(ViSession vi, ViConstString channelName, ViAttr attribute, ViInt32 value);

Purpose

Sets the value of a ViInt32 attribute.

This is a low-level function that you can use to set the values of device-specific attributes and inherent IVI attributes.

Parameters

Input
Name Type Description
vi ViSession Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannel function.
channelName ViConstString

Specifies the channel(s) to use. Specify the channel(s) using the form PXI1Slot3/0,PXI1Slot3/2-3,PXI1Slot4/2-3 or PXI1Slot3/0,PXI1Slot3/2:3,PXI1Slot4/2:3, where PXI1Slot3 and PXI1Slot4 are instrument resource names and 0, 2, and 3 are channels.

If you pass "" for this control, all channels in the session are used.

attribute ViAttr

Specifies the ID of an attribute. From the function panel window, you can use this control as follows.

- In the function panel window, click on the control or press Enter or the spacebar to display a dialog box containing hierarchical list of the available attributes. Attributes whose value cannot be set are dim. Help text is shown for each attribute. Select an attribute by double-clicking on it or by selecting it and then pressing Enter.

- Read-only attributes appear dim in the list box. If you select a read-only attribute, an error message appears. A ring control at the top of the dialog box allows you to see all IVI attributes or only the attributes of type ViInt32. If you choose to see all IVI attributes, the data types appear to the right of the attribute names in the list box. Attributes with data types other than ViInt32 are dim. If you select an attribute data type that is dim, LabWindows/CVI transfers you to the function panel for the corresponding function that is consistent with the data type.

- If you want to enter a variable name, press Ctrl+T to change this ring control to a manual input box. If the attribute in this ring control has named constants as valid values, you can view the constants by moving to the value control and pressing Enter.

value ViInt32 Specifies the value to which you want to set the attribute. If the attribute currently showing in the attribute ring control has constants as valid values, you can view a list of the constants by pressing Enter on this control. Select a value by double-clicking on it or by selecting it and then pressing Enter.
Note  Some of the values might not be valid depending upon the current settings of the device session.

Return Value

Name Type Description
Status ViStatus Reports the status of this operation. To obtain a text description of the status code, call the niDCPower_error_message function. To obtain additional information concerning the error condition, call the niDCPower_GetError function.

niDCPower_SetAttributeViReal64

ViStatus niDCPower_SetAttributeViReal64(ViSession vi, ViConstString channelName, ViAttr attribute, ViReal64 value);

Purpose

Sets the value of a ViReal64 attribute.

This is a low-level function that you can use to set the values of device-specific attributes and inherent IVI attributes.

Parameters

Input
Name Type Description
vi ViSession Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function.
channelName ViConstString

Specifies the channel(s) to use. Specify the channel(s) using the form PXI1Slot3/0,PXI1Slot3/2-3,PXI1Slot4/2-3 or PXI1Slot3/0,PXI1Slot3/2:3,PXI1Slot4/2:3, where PXI1Slot3 and PXI1Slot4 are instrument resource names and 0, 2, and 3 are channels.

If you pass "" for this control, all channels in the session are used.

attribute ViAttr

Specifies the ID of an attribute. From the function panel window, you can use this control as follows.

- In the function panel window, click on the control or press Enter or the spacebar to display a dialog box containing hierarchical list of the available attributes. Attributes whose value cannot be set are dim. Help text is shown for each attribute. Select an attribute by double-clicking on it or by selecting it and then pressing Enter.

- Read-only attributes appear dim in the list box. If you select a read-only attribute, an error message appears. A ring control at the top of the dialog box allows you to see all IVI attributes or only the attributes of type ViReal64. If you choose to see all IVI attributes, the data types appear to the right of the attribute names in the list box. Attributes with data types other than ViReal64 are dim. If you select an attribute data type that is dim, LabWindows/CVI transfers you to the function panel for the corresponding function that is consistent with the data type.

- If you want to enter a variable name, press Ctrl+T to change this ring control to a manual input box. If the attribute in this ring control has named constants as valid values, you can view the constants by moving to the value control and pressing Enter.

value ViReal64 Specifies the value to which you want to set the attribute. If the attribute currently showing in the attribute ring control has constants as valid values, you can view a list of the constants by pressing Enter on this control. Select a value by double-clicking on it or by selecting it and then pressing Enter.
Note  Some of the values might not be valid depending upon the current settings of the device session.

Return Value

Name Type Description
Status ViStatus Reports the status of this operation. To obtain a text description of the status code, call the niDCPower_error_message function. To obtain additional information concerning the error condition, call the niDCPower_GetError function.

niDCPower_SetAttributeViString

ViStatus niDCPower_SetAttributeViString(ViSession vi, ViConstString channelName, ViAttr attribute, ViConstString value);

Purpose

Sets the value of a ViString attribute.

This is a low-level function that you can use to set the values of device-specific attributes and inherent IVI attributes.

Parameters

Input
Name Type Description
vi ViSession Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function.
channelName ViConstString

Specifies the channel(s) to use. Specify the channel(s) using the form PXI1Slot3/0,PXI1Slot3/2-3,PXI1Slot4/2-3 or PXI1Slot3/0,PXI1Slot3/2:3,PXI1Slot4/2:3, where PXI1Slot3 and PXI1Slot4 are instrument resource names and 0, 2, and 3 are channels.

If you pass "" for this control, all channels in the session are used.

attribute ViAttr

Specifies the ID of an attribute. From the function panel window, you can use this control as follows.

- In the function panel window, click on the control or press Enter or the spacebar to display a dialog box containing hierarchical list of the available attributes. Attributes whose value cannot be set are dim. Help text is shown for each attribute. Select an attribute by double-clicking on it or by selecting it and then pressing Enter.

- Read-only attributes appear dim in the list box. If you select a read-only attribute, an error message appears. A ring control at the top of the dialog box allows you to see all IVI attributes or only the attributes of type ViString. If you choose to see all IVI attributes, the data types appear to the right of the attribute names in the list box. Attributes with data types other than ViString are dim. If you select an attribute data type that is dim, LabWindows/CVI transfers you to the function panel for the corresponding function that is consistent with the data type.

- If you want to enter a variable name, press Ctrl+T to change this ring control to a manual input box. If the attribute in this ring control has named constants as valid values, you can view the constants by moving to the value control and pressing Enter.

value ViConstString Specifies the value to which you want to set the attribute. If the attribute currently showing in the attribute ring control has constants as valid values, you can view a list of the constants by pressing Enter on this control. Select a value by double-clicking on it or by selecting it and then pressing Enter.
Note  Some of the values might not be valid depending upon the current settings of the device session.

Return Value

Name Type Description
Status ViStatus Reports the status of this operation. To obtain a text description of the status code, call the niDCPower_error_message function. To obtain additional information concerning the error condition, call the niDCPower_GetError function.

niDCPower_SetAttributeViBoolean

ViStatus niDCPower_SetAttributeViBoolean(ViSession vi, ViConstString channelName, ViAttr attribute, ViBoolean value);

Purpose

Sets the value of a ViBoolean attribute.

This is a low-level function that you can use to set the values of device-specific attributes and inherent IVI attributes.

Parameters

Input
Name Type Description
vi ViSession Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function.
channelName ViConstString

Specifies the channel(s) to use. Specify the channel(s) using the form PXI1Slot3/0,PXI1Slot3/2-3,PXI1Slot4/2-3 or PXI1Slot3/0,PXI1Slot3/2:3,PXI1Slot4/2:3, where PXI1Slot3 and PXI1Slot4 are instrument resource names and 0, 2, and 3 are channels.

If you pass "" for this control, all channels in the session are used.

attribute ViAttr

Specifies the ID of an attribute. From the function panel window, you can use this control as follows.

- In the function panel window, click on the control or press Enter or the spacebar to display a dialog box containing hierarchical list of the available attributes. Attributes whose value cannot be set are dim. Help text is shown for each attribute. Select an attribute by double-clicking on it or by selecting it and then pressing Enter.

- Read-only attributes appear dim in the list box. If you select a read-only attribute, an error message appears. A ring control at the top of the dialog box allows you to see all IVI attributes or only the attributes of type ViBoolean. If you choose to see all IVI attributes, the data types appear to the right of the attribute names in the list box. Attributes with data types other than ViBoolean are dim. If you select an attribute data type that is dim, LabWindows/CVI transfers you to the function panel for the corresponding function that is consistent with the data type.

- If you want to enter a variable name, press Ctrl+T to change this ring control to a manual input box. If the attribute in this ring control has named constants as valid values, you can view the constants by moving to the value control and pressing Enter.

value ViBoolean Specifies the value to which you want to set the attribute. If the attribute currently showing in the attribute ring control has constants as valid values, you can view a list of the constants by pressing Enter on this control. Select a value by double-clicking on it or by selecting it and then pressing Enter.
Note  Some of the values might not be valid depending upon the current settings of the device session.

Return Value

Name Type Description
Status ViStatus Reports the status of this operation. To obtain a text description of the status code, call the niDCPower_error_message function. To obtain additional information concerning the error condition, call the niDCPower_GetError function.

niDCPower_SetAttributeViSession

ViStatus niDCPower_SetAttributeViSession(ViSession vi, ViConstString channelName, ViAttr attribute, ViSession value);

Purpose

Sets the value of a ViSession attribute.

This is a low-level function that you can use to set the values of device-specific attributes and inherent IVI attributes.

Parameters

Input
Name Type Description
vi ViSession Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function.
channelName ViConstString

Specifies the channel(s) to use. Specify the channel(s) using the form PXI1Slot3/0,PXI1Slot3/2-3,PXI1Slot4/2-3 or PXI1Slot3/0,PXI1Slot3/2:3,PXI1Slot4/2:3, where PXI1Slot3 and PXI1Slot4 are instrument resource names and 0, 2, and 3 are channels.

If you pass "" for this control, all channels in the session are used.

attribute ViAttr

Specifies the ID of an attribute. From the function panel window, you can use this control as follows.

- In the function panel window, click on the control or press Enter or the spacebar to display a dialog box containing hierarchical list of the available attributes. Attributes whose value cannot be set are dim. Help text is shown for each attribute. Select an attribute by double-clicking on it or by selecting it and then pressing Enter.

- Read-only attributes appear dim in the list box. If you select a read-only attribute, an error message appears. A ring control at the top of the dialog box allows you to see all IVI attributes or only the attributes of type ViSession. If you choose to see all IVI attributes, the data types appear to the right of the attribute names in the list box. Attributes with data types other than ViSession are dim. If you select an attribute data type that is dim, LabWindows/CVI transfers you to the function panel for the corresponding function that is consistent with the data type.

- If you want to enter a variable name, press Ctrl+T to change this ring control to a manual input box. If the attribute in this ring control has named constants as valid values, you can view the constants by moving to the value control and pressing Enter.

value ViSession Specifies the value to which you want to set the attribute. If the attribute currently showing in the attribute ring control has constants as valid values, you can view a list of the constants by pressing Enter on this control. Select a value by double-clicking on it or by selecting it and then pressing Enter.
Note  Some of the values might not be valid depending upon the current settings of the device session.

Return Value

Name Type Description
Status ViStatus Reports the status of this operation. To obtain a text description of the status code, call the niDCPower_error_message function. To obtain additional information concerning the error condition, call the niDCPower_GetError function.

niDCPower_GetAttributeViInt32

ViStatus niDCPower_GetAttributeViInt32(ViSession vi, ViConstString channelName, ViAttr attribute, ViInt32 *value);

Purpose

Queries the value of a ViInt32 attribute.

You can use this function to get the values of device-specific attributes and inherent IVI attributes.

Parameters

Input
Name Type Description
vi ViSession Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function.
channelName ViConstString

Specifies the channel(s) to use. Specify the channel(s) using the form PXI1Slot3/0,PXI1Slot3/2-3,PXI1Slot4/2-3 or PXI1Slot3/0,PXI1Slot3/2:3,PXI1Slot4/2:3, where PXI1Slot3 and PXI1Slot4 are instrument resource names and 0, 2, and 3 are channels.

If you pass "" for this control, all channels in the session are used.

attribute ViAttr

Specifies the ID of an attribute. From the function panel window, you can use this control as follows.

- In the function panel window, click on the control or press Enter or the spacebar to display a dialog box containing hierarchical list of the available attributes. Help text is shown for each attribute. Select an attribute by double-clicking on it or by selecting it and then pressing Enter.

- A ring control at the top of the dialog box allows you to see all IVI attributes or only the attributes of type ViInt32. If you choose to see all IVI attributes, the data types appear to the right of the attribute names in the list box. Attributes with data types other than ViInt32 are dim. If you select an attribute data type that is dim, LabWindows/CVI transfers you to the function panel for the corresponding function that is consistent with the data type.

- If you want to enter a variable name, press Ctrl+T to change this ring control to a manual input box. If the attribute in this ring control has named constants as valid values, you can view the constants by moving to the value control and pressing Enter.

Output
Name Type Description
value ViInt32* Returns the current value of the attribute. Passes the address of a ViInt32 variable.

If the attribute currently showing in the attribute ring control has constants as valid values, you can view a list of the constants by pressing Enter on this control. Select a value by double-clicking on it or by selecting it and then pressing Enter.

Return Value

Name Type Description
Status ViStatus Reports the status of this operation. To obtain a text description of the status code, call the niDCPower_error_message function. To obtain additional information concerning the error condition, call the niDCPower_GetError function.

niDCPower_GetAttributeViReal64

ViStatus niDCPower_GetAttributeViReal64(ViSession vi, ViConstString channelName, ViAttr attribute, ViReal64 *value);

Purpose

Queries the value of a ViReal64 attribute.

You can use this function to get the values of device-specific attributes and inherent IVI attributes.

Parameters

Input
Name Type Description
vi ViSession Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function.
channelName ViConstString

Specifies the channel(s) to use. Specify the channel(s) using the form PXI1Slot3/0,PXI1Slot3/2-3,PXI1Slot4/2-3 or PXI1Slot3/0,PXI1Slot3/2:3,PXI1Slot4/2:3, where PXI1Slot3 and PXI1Slot4 are instrument resource names and 0, 2, and 3 are channels.

If you pass "" for this control, all channels in the session are used.

attribute ViAttr

Specifies the ID of an attribute. From the function panel window, you can use this control as follows.

- In the function panel window, click on the control or press Enter or the spacebar to display a dialog box containing hierarchical list of the available attributes. Help text is shown for each attribute. Select an attribute by double-clicking on it or by selecting it and then pressing Enter.

- A ring control at the top of the dialog box allows you to see all IVI attributes or only the attributes of type ViReal64. If you choose to see all IVI attributes, the data types appear to the right of the attribute names in the list box. Attributes with data types other than ViReal64 are dim. If you select an attribute data type that is dim, LabWindows/CVI transfers you to the function panel for the corresponding function that is consistent with the data type.

- If you want to enter a variable name, press Ctrl+T to change this ring control to a manual input box. If the attribute in this ring control has named constants as valid values, you can view the constants by moving to the value control and pressing Enter.

Output
Name Type Description
value ViReal64* Returns the current value of the attribute. Passes the address of a ViReal64 variable.

If the attribute currently showing in the attribute ring control has constants as valid values, you can view a list of the constants by pressing Enter on this control. Select a value by double-clicking on it or by selecting it and then pressing Enter.

Return Value

Name Type Description
Status ViStatus Reports the status of this operation. To obtain a text description of the status code, call the niDCPower_error_message function. To obtain additional information concerning the error condition, call the niDCPower_GetError function.

niDCPower_GetAttributeViString

ViStatus niDCPower_GetAttributeViString(ViSession vi, ViConstString channelName, ViAttr attribute, ViInt32 bufSize, ViChar value[]);

Purpose

Queries the value of a ViString attribute.

You can use this function to get the values of device-specific attributes and inherent IVI attributes.

Parameters

Input
Name Type Description
vi ViSession Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function.
channelName ViConstString

Specifies the channel(s) to use. Specify the channel(s) using the form PXI1Slot3/0,PXI1Slot3/2-3,PXI1Slot4/2-3 or PXI1Slot3/0,PXI1Slot3/2:3,PXI1Slot4/2:3, where PXI1Slot3 and PXI1Slot4 are instrument resource names and 0, 2, and 3 are channels.

If you pass "" for this control, all channels in the session are used.

attribute ViAttr

Specifies the ID of an attribute. From the function panel window, you can use this control as follows.

- In the function panel window, click on the control or press or the spacebar to display a dialog box containing hierarchical list of the available attributes. Help text is shown for each attribute. Select an attribute by double-clicking on it or by selecting it and then pressing .

- A ring control at the top of the dialog box allows you to see all IVI attributes or only the attributes of type ViString. If you choose to see all IVI attributes, the data types appear to the right of the attribute names in the list box. Attributes with data types other than ViString are dimmed. If you select an attribute data type that is dimmed, LabWindows/CVI transfers you to the function panel for the corresponding function that is consistent with the data type.

- If you want to enter a variable name, press to change this ring control to a manual input control. If the attribute in this ring control has named constants as valid values, you can view the constants by moving to the value control and pressing .

bufSize ViInt32 Passes the number of bytes in the buffer and specifies the number of bytes in the ViChar array you specify for value. If the current value of value, including the terminating NUL byte, is larger than the size you indicate in this 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.

To obtain the required buffer size, you can pass 0 for this attribute and VI_NULL for value. If you want the function to fill in the buffer regardless of the number of bytes in the value, pass a negative number for this attribute.
Output
Name Type Description
value ViChar[] The buffer in which the function returns the current value of the attribute. The buffer must be of type ViChar and have at least as many bytes as indicated in bufSize.

If the current value of the attribute, including the terminating NUL byte, contains more bytes that 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 specify 0 for bufSize, you can pass VI_NULL for this attribute.

If the attribute currently showing in the attribute ring control has constants as valid values, you can view a list of the constants by pressing on this control. Select a value by double-clicking on it or by selecting it and then pressing .

Return Value

Name Type Description
Status ViStatus 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.

niDCPower_GetAttributeViBoolean

ViStatus niDCPower_GetAttributeViBoolean(ViSession vi, ViConstString channelName, ViAttr attribute, ViBoolean *value);

Purpose

Queries the value of a ViBoolean attribute.

You can use this function to get the values of device-specific attributes and inherent IVI attributes.

Parameters

Input
Name Type Description
vi ViSession Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function.
channelName ViConstString

Specifies the channel(s) to use. Specify the channel(s) using the form PXI1Slot3/0,PXI1Slot3/2-3,PXI1Slot4/2-3 or PXI1Slot3/0,PXI1Slot3/2:3,PXI1Slot4/2:3, where PXI1Slot3 and PXI1Slot4 are instrument resource names and 0, 2, and 3 are channels.

If you pass "" for this control, all channels in the session are used.

attribute ViAttr

Specifies the ID of an attribute. From the function panel window, you can use this control as follows.

- In the function panel window, click on the control or press Enter or the spacebar to display a dialog box containing hierarchical list of the available attributes. Help text is shown for each attribute. Select an attribute by double-clicking on it or by selecting it and then pressing Enter.

- A ring control at the top of the dialog box allows you to see all IVI attributes or only the attributes of type ViBoolean. If you choose to see all IVI attributes, the data types appear to the right of the attribute names in the list box. Attributes with data types other than ViBoolean are dim. If you select an attribute data type that is dim, LabWindows/CVI transfers you to the function panel for the corresponding function that is consistent with the data type.

- If you want to enter a variable name, press Ctrl+T to change this ring control to a manual input box. If the attribute in this ring control has named constants as valid values, you can view the constants by moving to the value control and pressing Enter.

Output
Name Type Description
value ViBoolean* Returns the current value of the attribute. Passes the address of a ViBoolean variable.

If the attribute currently showing in the attribute ring control has constants as valid values, you can view a list of the constants by pressing Enter on this control. Select a value by double-clicking on it or by selecting it and then pressing Enter.

Return Value

Name Type Description
Status ViStatus Reports the status of this operation. To obtain a text description of the status code, call the niDCPower_error_message function. To obtain additional information concerning the error condition, call the niDCPower_GetError function.

niDCPower_GetAttributeViSession

ViStatus niDCPower_GetAttributeViSession(ViSession vi, ViConstString channelName, ViAttr attribute, ViSession *value);

Purpose

Queries the value of a ViSession attribute.

You can use this function to get the values of device-specific attributes and inherent IVI attributes.

Parameters

Input
Name Type Description
vi ViSession Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function.
channelName ViConstString

Specifies the channel(s) to use. Specify the channel(s) using the form PXI1Slot3/0,PXI1Slot3/2-3,PXI1Slot4/2-3 or PXI1Slot3/0,PXI1Slot3/2:3,PXI1Slot4/2:3, where PXI1Slot3 and PXI1Slot4 are instrument resource names and 0, 2, and 3 are channels.

If you pass "" for this control, all channels in the session are used.

attribute ViAttr

Specifies the ID of an attribute. From the function panel window, you can use this control as follows.

- In the function panel window, click on the control or press Enter or the spacebar to display a dialog box containing hierarchical list of the available attributes. Help text is shown for each attribute. Select an attribute by double-clicking on it or by selecting it and then pressing Enter.

- A ring control at the top of the dialog box allows you to see all IVI attributes or only the attributes of type ViSession. If you choose to see all IVI attributes, the data types appear to the right of the attribute names in the list box. Attributes with data types other than ViSession are dim. If you select an attribute data type that is dim, LabWindows/CVI transfers you to the function panel for the corresponding function that is consistent with the data type.

- If you want to enter a variable name, press Ctrl+T to change this ring control to a manual input box. If the attribute in this ring control has named constants as valid values, you can view the constants by moving to the value control and pressing Enter.

Output
Name Type Description
value ViSession* Returns the current value of the attribute. Passes the address of a ViSession variable.

If the attribute currently showing in the attribute ring control has constants as valid values, you can view a list of the constants by pressing Enter on this control. Select a value by double-clicking on it or by selecting it and then pressing Enter.

Return Value

Name Type Description
Status ViStatus Reports the status of this operation. To obtain a text description of the status code, call the niDCPower_error_message function. To obtain additional information concerning the error condition, call the niDCPower_GetError function.
⚠️ **GitHub.com Fallback** ⚠️