Initialize
- Updated2025-10-10
- 2 minute(s) read
Because you can have multiple signal generators connected to your computer, you must tell NI-FGEN which signal generator to communicate with by opening a session to the signal generator.
A session establishes a connection between the signal generator and your application. After this connection is established, the signal generator can transmit data to your application. Sessions also allow the driver to cache previous settings, which greatly improves performance.
LabVIEW Example
Call the niFgen Initialize VI to create a session. You can also use the niFgen Initialize with Channels VI or niFgen Initialize with Options VI as alternatives depending on the device.
- Resource Name must be set to the device identifier assigned to the signal generator in Measurement & Automation Explorer (MAX). You can find or set the resource name for your signal generator by launching MAX and selecting Devices and Interfaces.
- Id Query specifies whether or not to verify that NI-FGEN supports the device you initialize. Circumstances can arise where sending an ID query to the device is undesirable. When you set this parameter to FALSE, the VI initializes the device without performing an ID query.
- Reset Device allows you to reset the signal generator during initialization.
- Instrument Handle Out returns a handle that, when passed to subsequent VIs, allows you to communicate with the signal generator throughout your session.
C Example
Call the niFgen_init function to create a session. You can also use the niFgen_InitializeWithChannels function or niFgen_InitWithOptions function as alternatives depending on the device.
- The resourceName parameter must be set to the device identifier assigned to the signal generator in MAX. You can find or set the resource name for your signal generator by launching MAX and selecting Devices and Interfaces.
- The idQuery parameter specifies whether or not to verify that NI-FGEN supports the device you initialize. Circumstances can arise where sending an ID query to the device is undesirable. When you set this parameter to VI_FALSE, the function initializes the device without performing an ID query.
- The resetDevice parameter allows you to reset the signal generator during initialization.
- The vi parameter returns a handle that, when passed to subsequent functions, allows you to communicate with the signal generator throughout your session.