NI-HSDIO C Function Reference

niHSDIO_InitGenerationSession

  • Updated2023-02-21
  • 2 minute(s) read

ViStatus = niHSDIO_InitGenerationSession ( ViRsrc resourceName, ViBoolean IDQuery, ViBoolean resetDevice, ViConstString optionString, ViSession *vi);

Purpose

Call this function to create a new generation session. You can perform static and dynamic generation operations with this session.

Creating a new session does not automatically tristate your front panel terminals or channels that might have been left driving voltages from previous sessions (refer to the niHSDIO_close function for more information about leaving lines driving after closing a session).

Pass VI_TRUE into the resetInstrument parameter to place your device in a known start-up state when creating a new session. This action is equivalent to calling the niHSDIO_reset function, and it tristates the front panel terminals and channels.

Related topics:

Parameters

Input
Name Type Description
Resource Name ViRsrc Specifies the device name, for example, "Dev1" where "Dev1" is a device name assigned by Measurement & Automation Explorer.
ID Query ViBoolean Specifies whether the driver performs an ID query on the device. When this parameter is set to VI_TRUE, NI-HSDIO ensures compatibility between the device and the driver.

Defined Values

VI_TRUE (1)—Perform ID query.
VI_FALSE (0)—Skip ID query.
Reset Instrument ViBoolean Specifies whether the driver resets the device during initialization of the session. Refer to niHSDIO_reset for more information about what happens during a device reset.

Defined Values

VI_FALSE (0)—Do not reset device.
VI_TRUE (1)—Reset device.
Note  Resetting your device resets the entire device. Acquisition or generation operations in progress are aborted and cleared.
Option String ViConstString Currently unused. Set this string to "".
Output
Name Type Description
vi ViSession Returns a ViSession handle. Use this handle to identify the device in all subsequent instrument driver function calls related to your acquisition operation.

Return Value

Name Type Description
Status ViStatus

Reports the status of this operation. To obtain a text description of the status code, call the niHSDIO_error_message function. To obtain additional information concerning the error condition, use the niHSDIO_GetError and niHSDIO_ClearError functions.

The general meaning of the status code is as follows:

Value Meaning
0 Success
Positive Values Warnings
Negative Values Errors

Log in to get a better experience