C function for ni<driver> Get Session Reference.vi

Updated Jan 21, 2025

Reported In

Programming Language

  • C

Other

  • C Programming

Issue Details

  • In LabVIEW, there is a function known as niFgen Get Session Reference.vi. I would like to call the same function through C programming, however I did not find any. What is the replacement for this function?
  • I would like to use NI TClk in C programming with one of the NI modular instrument. In LabVIEW, there is ni<driver> Get Session Reference.vi to extract a session that can be used by the NI TClk function. How do I apply the same concept in C programming?

Solution

In C programming, there is no function for ni<driver> Get Session Reference.vi. For driver APIs that use ViSession for their session handles (e.g., niFgen, niScope, niRFGS, and niDMM), you can pass that directly to NI-TClk in C programming.

Take the niFgen C function as an example: niFgen_init, niFgen_InitWithOptions, and niFgen_InitializeWithChannels will output a ViSession type, which can later be used in NI TClk C function that require a ViSession type as input.

 

 

 

Additional Information

In LabVIEW, the ni<driver> Get Session Reference.vi is necessary to cast the wire type from an instrument handle to session reference so that the session reference can be passed into NI-TClk sessions.