10-18-2024 01:29 AM
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)
10-21-2024 05:13 AM - edited 10-21-2024 05:17 AM
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.
11-01-2024 01:42 AM
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?
11-02-2024 10:06 AM
@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.