Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

IVI callback functions

Hello all,

I'm currently working on a testsystem for automated hardware tests and wanted to try out the IVI technology for this purpose (Labwindows/Teststand). I have some basic questions about the IVI technology and hope that you can help me. As far as I know an IVI class Driver or IVI Specific Driver defines a set of attributes which can be set/get with the aid of lowlevel
Ivi_SetAttributeViXXX or Ivi_GetAttributeViXXX functions. Then the IVI Engine invokes various callback functions, checks range and so on.
In almost every example, that I have seen, the body of the callback functions contain VISA statements like viPrintf(...) which send a command string to the device. Is it possible to call other "non-visa" functions within the callback functions (from a dll for example)?

If yes, I have also an other question. I have a driver dll with some functions for an IOLink device (COM3).
This functions need the handle of the device to send data to it. Is it possible to get the device handle and not the IVI driver session handle?
I know, that it is not the aim of the IVI concept - but I need a way to communicate with the IOLink device (and I have no source code for this dll, most functions look like this: setMode(handle, mode), setData(handle, mode)...).

Thanks for help
7even
0 Kudos
Message 1 of 7
(4,708 Views)

Hello 7even,

       IVI drivers are based on an attribute model, but it is highly recommended that you call the high-level API functions to control the instrument.  Get/Set should be used only if there is not a function that meets your needs.

 

       Most IVI Specific Drivers use VISA to communicate with the instrument because it abstracts out the instrument control bus, but you can use other communication methods.

 

What type of instrument is your IOLink device?

 

 

Cheers,

 

NathanT

0 Kudos
Message 2 of 7
(4,673 Views)
First thanks for your reply NathanT. Your are right and now I'm trying out another solution for my problem. I have attached an image to explain my plan. The IVI engine invokes VISA Methods and on the VISA layer an appropiate passport is loaded to communicate with the device. My current plan is to write a custom passport to communicate with the IOLink Master. At the moment the NI-VISA serial passport is automatically loaded and executed. How can I change this passport? I searched a lot but I didn't understand how NI-VISA loads this library module (relation between visa32.dll and passport dll)
Are there any examples/tutorials which explain how to implement a custom Passport? I have loaded the NI-VISA reference and user manuals but have problems to understand in which way a passport works. Does a passport just represent a dll which exposes and implements the VISA methods/attributes which are specified in the reference?


Extern Link to directupload, "Add Attachement" didn't work
0 Kudos
Message 3 of 7
(4,639 Views)
Now I know, how I can add a new Passport library to NI-VISA. I found the tool called PassportRegEdit. But I have also found a post from an user ("sth") which frustates my plan:

I will quote the reply:

"...to translate this into NI terms, to make this device available to VISA for use, one would have to create a "Passport" file. These are part of the VISA infrastructure and connect VISA to hardware. However, NI does not make the API for Passports public, thus it is impossible for any third party to create a Passport."

Link to Thread

Is it not possible to write a custom Passport?
If it is possible... how does VISA know which Passport library it has to load?
0 Kudos
Message 4 of 7
(4,630 Views)

Hello 7even,

       I am by no means a VISA expert, so hopefully someone who is can answer your question about VISA passports; however, I don't think that creating a custom VISA passport is the best approach.  Please take a look at these two online IVI documents:

 

How IVI-C Instrument Driver Technology Enables System Longevity and Platform Portability

 

Using IVI Drivers to Build Hardware-Independent Test Systems with LabVIEW and LabWindows/CVI

 

The IVI Engine does not directly call into VISA, it is at the IVI Specific Driver level that the Instrument I/O calls are made, and most (but not all) IVI Specific Drivers use VISA.

 

Cheers,

 

NathanT

0 Kudos
Message 5 of 7
(4,609 Views)

7even,

 

What sth said in his/her post is correct. We do not make the VISA spec readily available for general public to implement custom passports. Obviously, if someone wants to make a passport that makes business sense for NI, we can certain consider sharing the spec. 

 

In your particular case, it doesn't sound like a custom passport is necessary. For one, as Nathan has pointed out, you do not need to go through VISA to make an IVI driver. Also, It seems that the IOLink is connected via the serial port. Is there anything missing in the existing VISA Serial passport?

Regards,

Song Du
Systems Software
National Instruments R&D
0 Kudos
Message 6 of 7
(4,585 Views)
Thanks for help, I have solved my problem!
I have rewritten the init functions and now it works with my library. I have tried this a week ago but it didn't work and I thought there is no way to set the device handle although there is the "IVI_ATTR_IO_SESSION" attribute. I thought, that the "device management" was done by the IVI driver session and because of this I can't get the handle of the device but rather the handle for the driver session... error in reasoning 🙂

Thanks
7even
Message 7 of 7
(4,560 Views)