-
Notifications
You must be signed in to change notification settings - Fork 52
NI DCPOWER Utility Functions
- niDCPower_Disable
- niDCPower_ResetWithChannels
- niDCPower_reset
- niDCPower_ResetDevice
- niDCPower_self_test
- niDCPower_ImportAttributeConfigurationFile
- niDCPower_ExportAttributeConfigurationFile
- niDCPower_ImportAttributeConfigurationBuffer
- niDCPower_ExportAttributeConfigurationBuffer
- niDCPower_revision_query
- niDCPower_ResetWithDefaults
- niDCPower_GetChannelName
- niDCPower_GetChannelNameFromString
- niDCPower_GetNextCoercionRecord
- niDCPower_ClearInterchangeWarnings
- niDCPower_ResetInterchangeCheck
- niDCPower_GetNextInterchangeWarning
- niDCPower_GetError
- niDCPower_ClearError
- niDCPower_error_message
- niDCPower_LockSession
- niDCPower_UnlockSession
ViStatus niDCPower_Disable(ViSession vi);
This function performs the same actions as the niDCPower_ResetWithChannels function, except that this function also immediately sets the NIDCPOWER_ATTR_OUTPUT_ENABLED attribute to VI_FALSE.
This function opens the output relay on instruments that have an output relay.
This function applies to all channels and instruments in the session.
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
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. |
ViStatus niDCPower_ResetWithChannels(ViSession vi);
Resets the specified channel(s) to a known state. This function disables power generation, resets channel attributes to their default values, commits the channel attributes, and leaves the channel(s) in the Uncommitted state.
Programming States
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. |
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. |
ViStatus niDCPower_reset(ViSession vi);
This function is deprecated. Use niDCPower_ResetWithChannels instead.
Resets the device to a known state. This function disables power generation, resets session attributes to their default values, commits the session attributes, and leaves the session in the Uncommitted state. Refer to the Programming States topic for more information about NI-DCPower software states.
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
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. |
ViStatus niDCPower_ResetDevice(ViSession vi);
Resets all instruments in the session to a known state. The function disables power generation, resets all attributes for all instruments included in the session to their default values, clears errors such as overtemperature and unexpected loss of auxiliary power, commits the instrument attributes, and leaves the instrument(s) in the Uncommitted state. This function also performs a hard reset on the instrument(s) and driver software. This function has the same functionality as using reset in Measurement & Automation Explorer (MAX).
This also opens the output relay on instruments that have an output relay.
Programming States
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
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. |
ViStatus niDCPower_self_test(ViSession vi, ViInt16 *selfTestResult, ViChar selfTestMessage);
Performs the device self-test routine and returns the test result(s). Calling this function implicitly calls the niDCPower_ResetWithChannels function.
When calling this function with the PXIe-4162/4163, specify all channels of your PXIe-4162/4163 with the resourceName input of the niDCPower_InitializeWithIndependentChannels function. You cannot self test a subset of PXIe-4162/4163 channels.
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
Output | ||
Name | Type | Description |
selfTestResult | ViInt16* | Returns the value result from the device self-test. |
Self-Test Code | Description |
---|---|
0 | Self test passed. |
1 | Self test failed. |
selfTestMessage | ViChar | Returns the self-test result message. The size of this array must be at least 256 bytes. |
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. |
ViStatus niDCPower_ImportAttributeConfigurationFile(ViSession vi, ViConstString filePath);
Imports a configuration to the session from the specified file.
You can export and import supported configurations only between NIDCPower devices with identical model numbers and the same number of configured channels.
!Note | Note You cannot call this function while any channel is in the Running state. |
---|---|
Supported Configurations |
You can export and import the following configurations between NIDCPower sessions:
- Attribute configurations
- Advanced sequences
Support for this Function
You must set the session source mode to NIDCPOWER_VAL_SEQUENCE in order to configure or export and import advanced sequences.
Configuration exports from sessions created with the niDCPower_InitializeWithIndependentChannels function cannot be imported into sessions created with deprecated initialize functions.
!Note | Note Exporting and importing simple sequences in Sequence source mode is unsupported. |
---|---|
Channel Mapping Behavior |
When importing and exporting session attribute configurations between NIDCPower sessions that were initialized with different channels, the configurations of the exporting channels are mapped to the importing channels based on the order of the resources you specify in the resourceName input to the niDCPower_InitializeWithIndependentChannels function.
Refer to Import/Export Attribute Configuration Mapping Behavior for details.
Related Topics:
Programming States
Using Properties and Attributes
Setting Properties and Attributes Before Reading Them
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
filePath | ViConstString | The absolute path to the file that contains the configuration to import. If you specify an empty or relative path, this function returns an error. Default File Extension: .nidcpowerconfig |
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. |
ViStatus niDCPower_ExportAttributeConfigurationFile(ViSession vi, ViConstString filePath);
Exports a session configuration to the specified file.
You can export and import supported configurations only between NIDCPower devices with identical model numbers and the same number of configured channels.
This function verifies that the attributes you have configured for the session are valid. If the configuration is invalid, NIDCPower returns an error.
Supported Configurations
You can export and import the following configurations between NIDCPower sessions:
- Attribute configurations
- Advanced sequences
Support for this Function
You must set the source mode to NIDCPOWER_VAL_SEQUENCE in order to configure or export and import advanced sequences.
Configuration exports from sessions created with the niDCPower_InitializeWithIndependentChannels function cannot be imported into sessions created with deprecated initialize functions.
!Note | Note Exporting and importing simple sequences in Sequence source mode is unsupported. |
---|---|
Channel Mapping Behavior |
When importing and exporting session attribute configurations between NIDCPower sessions that were initialized with different channels, the configurations of the exporting channels are mapped to the importing channels based on the order of the resources you specify in the resourceName input to the niDCPower_InitializeWithIndependentChannels function.
Refer to Import/Export Attribute Configuration Mapping Behavior for details.
Related Topics:
Using Properties and Attributes
Setting Properties and Attributes Before Reading Them
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
filePath | ViConstString | The absolute path to a placeholder file you must create to contain the configuration you want to export. If you specify an empty or relative path, this function returns an error. Default file extension: .nidcpowerconfig |
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. |
ViStatus niDCPower_ImportAttributeConfigurationBuffer (ViSession vi, ViInt32 size, ViAddr configuration);
Imports a configuration to the session from the specified buffer.
You can export and import supported configurations only between NIDCPower devices with identical model numbers and the same number of configured channels.
!Note | Note You cannot call this function while any channel is in the Running state. |
---|---|
Supported Configurations |
You can export and import the following configurations between NIDCPower sessions:
- Attribute configurations
- Advanced sequences
Support for this Function
You must set the source mode to NIDCPOWER_VAL_SEQUENCE in order to configure or export and import advanced sequences.
Configuration exports from sessions created with the niDCPower_InitializeWithIndependentChannels function cannot be imported into sessions created with deprecated initialize functions.
!Note | Note Exporting and importing simple sequences in Sequence source mode is unsupported. |
---|---|
Channel Mapping Behavior |
When importing and exporting session attribute configurations between NIDCPower sessions that were initialized with different channels, the configurations of the exporting channels are mapped to the importing channels based on the order of the resources you specify in the resourceName input to the niDCPower_InitializeWithIndependentChannels function.
Refer to Import/Export Attribute Configuration Mapping Behavior for details.
Related Topics:
Programming States
Using Properties and Attributes
Setting Properties and Attributes Before Reading Them
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
size | ViInt32 | Specifies the size, in bytes, of the byte array to import. If you enter 0, this function returns the needed size. |
configuration | ViAddr | Specifies the byte array buffer that contains the attribute configuration to import. |
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. |
ViStatus niDCPower_ExportAttributeConfigurationBuffer (ViSession vi, ViInt32 size, ViAddr configuration);
Exports a session configuration to a buffer.
You can export and import supported configurations only between NIDCPower devices with identical model numbers and the same number of configured channels.
This function verifies that the attributes you have configured for the session are valid. If the configuration is invalid, NIDCPower returns an error.
Supported Configurations
You can export and import the following configurations between NIDCPower sessions:
- Attribute configurations
- Advanced sequences
Support for this Function
You must set the source mode to NIDCPOWER_VAL_SEQUENCE in order to configure or export and import advanced sequences.
Configuration exports from sessions created with the niDCPower_InitializeWithIndependentChannels function cannot be imported into sessions created with deprecated initialize functions.
!Note | Note Exporting and importing simple sequences in Sequence source mode is unsupported. |
---|---|
Channel Mapping Behavior |
When importing and exporting session attribute configurations between NIDCPower sessions that were initialized with different channels, the configurations of the exporting channels are mapped to the importing channels based on the order of the resources you specify in the resourceName input to the niDCPower_InitializeWithIndependentChannels function.
Refer to Import/Export Attribute Configuration Mapping Behavior for details.
Related Topics:
Using Properties and Attributes
Setting Properties and Attributes Before Reading Them
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
size | ViInt32 | Specifies the size, in bytes, of the byte array to export. If you enter 0, this function returns the needed size. |
configuration | ViAddr | Specifies the byte array buffer to be populated with the exported attribute configuration. |
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. |
ViStatus niDCPower_revision_query(ViSession vi, ViChar instrumentDriverRevision, ViChar firmwareRevision);
Returns the revision information of NI-DCPower and the device firmware.
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
Output | ||
Name | Type | Description |
instrumentDriverRevision | ViChar |
Returns the driver revision information for NI-DCPower. In multi-instrument sessions, this function returns an error if any instruments have different firmware revisions. In this case, instead of using this function, read the NIDCPOWER_ATTR_INSTRUMENT_FIRMWARE_REVISION attribute for the instrument you specify. |
firmwareRevision | ViChar | Returns firmware revision information for the device you are using. The size of this array must be at least 256 bytes. |
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. |
ViStatus niDCPower_ResetWithDefaults(ViSession vi);
Resets all channels in the session to a known state. This function disables power generation, resets session attributes to their default values, commits the session attributes, and leaves the session in the Running state. In addition to exhibiting the behavior of the niDCPower_ResetWithChannels function, this function can assign user-defined default values for configurable attributes from the IVI configuration.
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
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. |
ViStatus niDCPower_GetChannelName(ViSession vi, ViInt32 index, ViInt32 bufferSize, ViChar channelName);
Returns channel name(s) from a one-based index. Use the NIDCPOWER_ATTR_CHANNEL_COUNT attribute to determine the upper bound of valid values for index.
Use this function to identify the fully qualified names of channels. Fully qualified channel names are required to access channels in multi-instrument sessions.
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels 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 0, you can pass VI_NULL for channelName. |
Output | ||
Name | Type | Description |
channelName | ViChar | Returns a string of the channel name(s). |
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. |
ViStatus niDCPower_GetChannelNameFromString(ViSession vi, ViInt32 index, ViInt32 bufferSize, ViChar channelName);
Returns a comma-separated list of channel names from a string index list.
Use this function to identify the fully qualified names of channels. Fully qualified channel names are required to access channels in multi-instrument sessions.
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
index | ViChar |
Specifies an index list for the channels in the session. Valid values are from zero to the total number of channels in the session minus one. The index string can be one of the following formats: - A comma-separated list - for example, "0,2,3,1" - A range using a hyphen - for example, "0-3" - A range using a colon - for example, "0:3" You can combine comma-separated lists and ranges that use a hyphen or colon. Both out-of-order and repeated indices are supported ("2,3,0", "1,2,2,3"). White space characters, including spaces, tabs, feeds, and carriage returns, are allowed between characters. Ranges can be incrementing or decrementing. |
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 0, you can pass VI_NULL for channelName. |
Output | ||
Name | Type | Description |
channelName | ViChar | Returns a string of the channel name(s). |
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. |
ViStatus niDCPower_GetNextCoercionRecord(ViSession vi, ViInt32 bufferSize, ViChar coercionRecord);
Returns the coercion information associated with the IVI session and clears the earliest instance in which NI-DCPower coerced a value you specified.
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
bufferSize | ViInt32 | Specifies the number of bytes in the ViChar array you specify for coercionRecord. If the next coercion record string, 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 0, you can pass VI_NULL for coercionRecord. |
Output | ||
Name | Type | Description |
coercionRecord | ViChar | Returns the next coercionRecord for the IVI session. If there are no coercionRecords, the function returns an empty string. |
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. |
ViStatus niDCPower_ClearInterchangeWarnings(ViSession vi);
Clears the list of current interchange warnings.
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
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. |
ViStatus niDCPower_ResetInterchangeCheck(ViSession vi);
When developing a complex test system that consists of multiple test modules, it is generally a good idea to design the test modules so that they can run in any order. To do so requires ensuring that each test module completely configures the state of each instrument it uses. If a particular test module does not completely configure the state of an instrument, the state of the instrument depends on the configuration from a previously executed test module. If you execute the test modules in a different order, the behavior of the instrument and therefore the entire test module is likely to change. This change in behavior is generally instrument specific and represents an interchangeability problem.
You can use this function to test for such cases. After you call this function, the interchangeability checking algorithms in the specific driver ignore all previous configuration operations. By calling this function at the beginning of a test module, you can determine whether the test module has dependencies on the operation of previously executed test modules.
This function does not clear the interchangeability warnings from the list of previously recorded interchangeability warnings. If you want to guarantee that the niDCPower_GetNextInterchangeWarning function only returns those interchangeability warnings that are generated after calling this function, you must clear the list of interchangeability warnings. You can clear the interchangeability warnings list by repeatedly calling the niDCPower_GetNextInterchangeWarning function until no more interchangeability warnings are returned. If you are not interested in the content of those warnings, you can call the niDCPower_ClearInterchangeWarnings function.
!Note | Note niDCPower_GetNextInterchangeWarning does not mark any attributes for an interchange check. |
---|
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
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. |
ViStatus niDCPower_GetNextInterchangeWarning(ViSession vi, ViInt32 bufferSize, ViChar interchangeWarning);
This function returns the interchangeability warning associated with the IVI session. It retrieves and clears the earliest instance in which the class driver recorded an interchangeability warning. Interchangeability warnings indicate that using your application with a different device may cause a different behavior.
NI-DCPower performs interchangeability checking when the NIDCPOWER_ATTR_INTERCHANGE_CHECK attribute is set to VI_TRUE. This function returns an empty string in warning if no interchangeability warnings remain for the session. In general, NI-DCPower generates interchangeability warnings when an attribute that affects the behavior of the device is in a state that you did not specify.
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
bufferSize | ViInt32 | Specifies the number of bytes in the ViChar array you specify for interchangeWarning. If the next interchangeability warning string, 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 0, you can pass VI_NULL for interchangeWarning. |
Output | ||
Name | Type | Description |
interchangeWarning | ViChar | Returns the next interchange warning for the IVI session. If there are no interchange warnings, the function returns an empty string. |
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. |
ViStatus niDCPower_GetError(ViSession vi, ViStatus *code, ViInt32 bufferSize, ViChar description);
Retrieves and then clears the IVI error information for the session or the current execution thread unless bufferSize is 0, in which case the function does not clear the error information. By passing 0 for the buffer size, you can ascertain the buffer size required to get the entire error description string and then call the function again with a sufficiently large buffer size.
If the user specifies a valid IVI session for vi, this function retrieves and then clears the error information for the session. If the user passes VI_NULL for vi, this function retrieves and then clears the error information for the current execution thread. If vi is an invalid session, the function does nothing and returns an error. Normally, the error information describes the first error that occurred since the user last called niDCPower_GetError or niDCPower_ClearError.
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
bufferSize | ViInt32 | Specifies the number of bytes in the ViChar array you specify for description. If the error description, 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 0 for this attribute, you can pass VI_NULL for description. |
Output | ||
Name | Type | Description |
Code | ViStatus* | Returns the error code for the session or execution thread. |
description | ViChar | Returns the error description for the IVI session or execution thread. If there is no description, the function returns an empty string. The buffer must contain at least as many elements as the value you specify with bufferSize. If the error description, including the terminating NUL byte, contains more bytes than you indicate with bufferSize, 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 bufferSize, you can pass VI_NULL for this attribute. |
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. |
ViStatus niDCPower_ClearError(ViSession vi);
Clears the error code and error description for the IVI session. If the user specifies a valid IVI session for vi, this function clears the error information for the session. If the user passes VI_NULL for vi, this function clears the error information for the current execution thread. If the ViSession parameter is an invalid session, the function does nothing and returns an error. The function clears the error code by setting it to VI_SUCCESS. If the error description string is non-NULL, the function de-allocates the error description string and sets the address to VI_NULL.
Maintaining the error information separately for each thread is useful if the user does not have a session handle to pass to the niDCPower_GetError function, which occurs when a call to niDCPower_InitializeWithChannels fails.
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
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. |
ViStatus niDCPower_error_message(ViSession vi, ViStatus errorCode, ViChar errorMessage256);
Converts a status code returned by an instrument driver function into a user-readable string.
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
errorCode | ViStatus | Specifies the status parameter that is returned from any of the NI-DCPower functions. |
Output | ||
Name | Type | Description |
error_message | ViChar | Returns the user-readable message string that corresponds to the status code you specify. You must pass a ViChar array with at least 256 bytes. |
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. |
ViStatus niDCPower_LockSession(ViSession vi, ViBoolean *callerHasLock);
Obtains a multithread lock on the device session. Before doing so, the software waits until all other execution threads release their locks on the device session.
Other threads may have obtained a lock on this session for the following reasons:
- The application called the niDCPower_LockSession function.
- A call to NI-DCPower locked the session.
- A call to the IVI engine locked the session.
- After a call to the niDCPower_LockSession function returns successfully, no other threads can access the device session until you call the niDCPower_UnlockSession function.
- Use the niDCPower_LockSession function and the niDCPower_UnlockSession function around a sequence of calls to instrument driver functions if you require that the device retain its settings through the end of the sequence.
You can safely make nested calls to the niDCPower_LockSession function within the same thread. To completely unlock the session, you must balance each call to the niDCPower_LockSession function with a call to the niDCPower_UnlockSession function. If, however, you use Caller_Has_Lock in all calls to the niDCPower_LockSession and niDCPower_UnlockSession function within a function, the IVI Library locks the session only once within the function regardless of the number of calls you make to the niDCPower_LockSession function. This behavior allows you to call the niDCPower_UnlockSession function just once at the end of the function.
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
Output | ||
Name | Type | Description |
callerHasLock | ViBoolean* |
This parameter is optional. If you do not want to use this parameter, pass VI_NULL. - If the value is VI_TRUE, the niDCPower_LockSession function does not lock the session again. - If the value is VI_FALSE, the niDCPower_LockSession function obtains the lock and sets the value of the parameter to VI_TRUE. - If the value is VI_FALSE, the niDCPower_UnlockSession function does not attempt to unlock the session. - If the value is VI_TRUE, the niDCPower_UnlockSession function releases the lock and sets the value of the parameter to VI_FALSE. Thus, you can, call the niDCPower_UnlockSession function at the end of your function without worrying about whether you actually have the lock, as shown in the following example. |
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. |
ViStatus niDCPower_UnlockSession(ViSession vi, ViBoolean *callerHasLock);
Releases a lock that you acquired on an device session using niDCPower_LockSession. Refer to niDCPower_LockSession for additional information on session locks.
Input | ||
---|---|---|
Name | Type | Description |
vi | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. |
Output | ||
Name | Type | Description |
callerHasLock | ViBoolean* |
This attribute is optional. If you do not want to use this attribute, pass VI_NULL. - If the value is VI_TRUE, niDCPower_LockSession does not lock the session again. - If the value is VI_FALSE, niDCPower_LockSession obtains the lock and sets the value of the parameter to VI_TRUE. - If the value is VI_FALSE, niDCPower_UnlockSessiondoes not attempt to unlock the session. - If the value is VI_TRUE, niDCPower_UnlockSessionreleases the lock and sets the value of the parameter to VI_FALSE. Thus, you can, call niDCPower_UnlockSession at the end of your function without worrying about whether you actually have the lock, as the following example shows. |
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. |
Creating and Setting Up a gRPC Server
Session Utilities API Reference
gRPC API Differences From C API
Sharing Driver Sessions Between Clients
C API Docs
NI-DAQmx
- gRPC API Differences From C API
- Task Configuration And Control
- Channel Configuration And Creation
- Timing
- Triggering
- Read Functions
- Write Functions
- Export Hardware Signals
- Scale Configuration
- Internal Buffer Configuration
- Advanced Functions
- System Configuration
- Error Handling
- Buffer Attributes
- Calibration Info Attributes
- Channel Attributes
- Device Attributes
- Export Signal Attributes
- Persisted Channel Attributes
- Persisted Scale Attributes
- Persisted Task Attributes
- Physical Channel Attributes
- Read Attributes
- Scale Attributes
- System Attributes
- Task Attributes
- Timing Attributes
- Trigger Attributes
- Watchdog Attributes
- Write Attributes
NI-DCPOWER
- Setup Functions
- Configure Functions
- Measurement Functions
- Control Functions
- Trigger And Event
- Attribute Functions
- Query Functions
- Calibration Functions
- Utility Functions
- Supported Device
- Source Attributes
- Transient Attributes
- Voltage Attributes
- Current Attributes
- Pulse Voltage Attributes
- Pulse Current Attributes
- Cutoff Attributes
- Measurement Attributes
- Trigger Attributes Functions
- Event Attributes
- Advanced Attributes
- Inherent Ivi Attributes
- Supported Device Attributes
NI-DIGITAL PATTERN DRIVER
- Init And Close Functions
- Session Locking Functions
- Utility Functions
- Error Handling Functions
- Calibration Functions
- Attributes Functions
- Pin Map Functions
- Low Level Functions
- Low Level Action Functions
- Pin Control Functions
- Static IO Functions
- Clock Generator Functions
- Levels And Timing Functions
- TDR Functions
- PPMU Configuration Functions
- DC Voltage Functions
- DC Current Functions
- PPMU Action Functions
- Pattern Configuration Functions
- Pattern Action Functions
- History Ram Functions
- Source Memory Functions
- Capture Memory Functions
- Triggers And Events Functions
- Conditional Jump Trigger Functions
- Sequencer Flag Functions
- Sequencer Register Functions
- Match Fail Combination Functions
- Pattern Results Functions
- Sort Results Functions
- Frequency Measurement Functions
- IVI Inherent Attributes
- Specific Driver Information Attributes, Read Only
- Driver Setup Information Attributes
- Device Attributes
- Pin Control Attributes
- Level Configuration Attributes
- Trigger Configuration Attributes
- PPMU Attributes
- Patterns Attributes
- Pattern Opcode Event Attributes
- Timing Offset Attributes
- Keep Alive Attributes
- Frequency Measurement Attributes
- Clock Generator Attributes
- History RAM
- Synchronization Attributes
- TDR Endpoint Termination Attributes
NI-FGEN
- Setup Functions
- Configuration Functions
- Standard Output Functions
- Arbitrary Waveform Output Functions
- Arbitrary Sequence Output Functions
- Incremental Waveform Write Functions
- Configure Clock Functions
- Trigger And Syncronizations Functions
- 5404 Routing Functions
- Script Output Functions
- Configure Onboard Signal Processing Functions
- Configure Peer To Peer Functions
- Attribute Functions
- Waveform Control Functions
- Error Functions
- Output Attributes
- Arbitrary Waveform Attributes
- Data Transfer Attributes
- Onboard Signal Processing Attributes
- Peer To Peer Attributes
- Standard Function Attributes
- Clock Attributes
- Event Attributes
- Triggering Attributes
- Instrument Specific Attributes
- Inherent IVI Attributes
- 5401 5411 5431
NI-RFmx Bluetooth
- gRPC API Differences From C API
- General Functions
- Configuration Functions
- Set And Get Attribute Functions
- Fetch Results Functions
- Utility Functions
- Build String Functions
- Advanced Functions
- General Attributes
- Trigger Attributes
- Packet Attributes
- Auto Detect Signal Attributes
- Modacc Attributes
- ACP Attributes
- Twenty dB Attributes
- Frequency Range Attributes
- TXP Attributes
- Advanced Attributes
NI-RFmx NR
- gRPC API Differences From C API
- General Functions
- Configuration Functions
- Set And Get Attributes Functions
- Fetch Results Functions
- Utility Functions
- Build String Functions
- Advanced Functions
- General Attributes
- Trigger Attributes
- Signal Detection Attributes
- Component Carrier Attributes
- List Attributes
- Modacc Attributes
- ACP Attributes
- CHP Attributes
- OBW Attributes
- SEM Attributes
- TXP Attributes
- Pvt Attributes
- Advanced Attributes
NI-RFmx LTE
- gRPC API Differences From C API
- General Functions
- Configuration Functions
- Ch Configuration Functions
- NB IoT Configuration Functions
- ModAcc Configuration Functions
- ACP Configuration Functions
- CHP Configuration Functions
- OBW Configuration Functions
- SEM Configuration Functions
- PVT Configuration Functions
- SlotPhase Configuration Functions
- SlotPower Configuration Functions
- Set And Get Attribute Functions
- ModAcc Fetch Functions
- ACP Fetch Functions
- CHP Fetch Functions
- OBW Fetch Functions
- SEM Fetch Functions
- PVT Fetch Functions
- SlotPhase Fetch Functions
- SlotPower Fetch Functions
- Utility Functions
- Build String Functions
- Advanced Functions
- General Attributes
- Trigger Attributes
- Component Carrier Attributes
- ModAcc Attributes
- ACP Attributes
- CHP Attributes
- OBW Attributes
- SEM Attributes
- PVT Attributes
- SlotPhase Attributes
- SlotPower Attributes
- Advanced Attributes
NI-RFmx SpecAn
- gRPC API Differences From C API
- General Functions
- Configuration Functions
- Set And Get Attribute Functions
- Read Functions
- Fetch Functions
- Utility Functions
- Marker Functions
- Build String Functions
- Advanced Functions
- General Attributes
- Trigger Attributes
- ACP Attributes
- Cdf Attributes
- CHP Attributes
- Fcnt Attributes
- Harm Attributes
- OBW Attributes
- SEM Attributes
- Spectrum Attributes
- Spur Attributes
- TXP Attributes
- AMPM Attributes
- Dpd Attributes
- IQ Attributes
- IM Attributes
- NF Attributes
- Phasenoise Attributes
- PAVT Attributes
- Advanced Attributes
NI-RFmx WLAN
- gRPC API Differences From C API
- General Functions
- Configuration Functions
- Set And Get Attribute Functions
- Fetch DSSS ModAcc Functions
- Fetch OFDM ModAcc Functions
- Fetch SEM Functions
- Fetch TXP Functions
- Fetch PowerRamp Functions
- Utility Functions
- Build String Functions
- Advanced Functions
- General Attributes
- Trigger Attributes
- OFDM Attributes
- Auto Detect Signal Attributes
- DSSS ModAcc Attributes
- OFDM ModAcc Attributes
- SEM Attributes
- TXP Attributes
- PowerRamp Attributes
- Advanced Attributes
NI-RFSA
- General Functions
- Configuration Functions
- Acquisition Functions
- Utility Functions
- Calibration Functions
- General Attributes
- Vertical Attributes
- Signal Path Attributes
- Acquisition Attributes
- Acquisition Attributes
- Triggers Attributes
- Events Attributes
- Device Characteristics Attributes
- Peer To Peer Streaming Attributes
- Configuration List Attributes
- Inherent IVI Properties Attributes
- De-embedding Attributes
- Self Calibration Attributes
- Factory Calibration Attributes
- External Alignment Attributes
- Device Specific Attributes
NI-RFSG
- General Functions
- Generation Configuration
- Utility Functions
- Calibration Functions
- Arb Attributes
- Clock Attributes
- Configuration List Attributes
- De-embedding Attributes
- Device Characteristics Attributes
- Device Specific Attributes
- Events Attributes
- External Calibration Attributes
- Inherent IVI Attributes Attributes
- IQ Impairment Attributes
- Load Configurations Attributes
- Modulation Attributes
- Obsolete Attributes
- Peer To Peer Attributes
- RF Attributes
- Self Calibration Attributes
- Triggers Attributes
NI-SCOPE
- Setup Functions
- Configure Functions
- Attribute Functions
- Acquisition Functions
- Measurement Functions
- Calibrate Functions
- Utility Funcitons
- Error Handling Functions
- IVI Compliance Or Obsolete Functions
- Vertical Attributes
- Horizontal Attributes
- Trigger Attributes
- Clocking Attributes
- Synchronization Attributes
- Acquisition Attributes
- Waveform Measurements Attributes
- Onboard Signal Processing Attributes
- Peer To Peer Streaming Attributes
- Device Attributes
- IVI Or Obsolete Attributes
- Instrument Capabilities Attributes
- If Digitizer Attributes
NI-XNET
- gRPC API differences from C APIs
- General Functions
- Cluster Properties
- Database Properties
- Device Properties
- ECU Properties
- Frame Properties
- Interface Properties
- LIN Schedule Entry Properties
- LIN Schedule Properties
- PDU Properties
- Session Ethernet Properties
- Session Frame Properties
- Session Interface Properties
- Session Properties
- Session SAE J1939 Properties
- Signal Properties
- Subframe Properties
- System Properties
- IP-Stack Functions
- Socket Options
- Socket Functions