LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

The Init With Options and Close functions of the IVI driver were imported using the Instrument LabWindows/CVI Driver Import Wizard.

Driver Import Wizard version: 2020
LavVIEW 2020

LabWINDOWS/CVI 2017

 

I am a beginner with LabVIEW and would like to ask why, after using the LabWindows/CVI Driver Import Wizard, the 'InitWithOption' function calls 'ivi.h' instead of the .h file I wrote myself. The 'Close' function has the same issue. (As the picture)

Download All
0 Kudos
Message 1 of 4
(155 Views)

Because the Ivi InitWithOptions function takes as two of its parameters the actual function prefix of your exported functions and the DLL name. It then will initialize the Ivi session to link with that driver and call the Init function in your driver. The Ivi driver interface also has the option to call other generic function in the according driver to manage all kinds of attributes. Most Ivi drivers maintain a complex state of attributes that mirror the state of the device and will for instance attempt to optimize the device communication by not issuing unnecessary driver calls to change the device state if it is already known to be in that state because of an different earlier command.

 

The close function will call the device driver specific close function and then deallocate the actual Ivi session with its various allocated resources. The actual driver DLL doesn't know about everything that IviInitWithOption() and other functions have allocated so couldn't easily clean up itself.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 4
(130 Views)

Thank you for your reply. I’d like to ask: if I want to use RS-232 communication and need to set the baud rate and flow control, would the best approach be to enter these settings in the option string during initialization, and then use Ivi_GetAttributeViString (CHR11050_ATTR_DRIVER_SETUP) to configure the baud rate and flow control?

0 Kudos
Message 3 of 4
(108 Views)

@James_Hungcc wrote:

Thank you for your reply. I’d like to ask: if I want to use RS-232 communication and need to set the baud rate and flow control, would the best approach be to enter these settings in the option string during initialization, and then use Ivi_GetAttributeViString (CHR11050_ATTR_DRIVER_SETUP) to configure the baud rate and flow control?


I'm not exactly sure. I did develop an IVI driver over 25 years ago, when the whole IVI standard was still fairly in its infancy and haven't really gone into a lot of such details. Writing an IVI driver was involved enough and communication at that point was for most instruments simply over GPIB, without such things as bus specific initialization being necessary.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 4
(79 Views)