Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set EOS properties in IVI driver

Solved!
Go to solution

I am coding an IVI compliant driver (in CVI/LabWindows) for an old GPIB instrument that does not support EOI. To read the device response I need to set the EOS character and terminate read on EOS. In MAX I can sucessfully set the communication properties and communicate with the device, but I don't know how to set these values within my driver. I have tried setting various attributes (for example with viSetAttribute (io, VI_ATTR_TERMCHAR_EN, VI_TRUE)), but always get run-time errors (I guess I must be using the session handles wrong). How do I set these properties inside the IVI device driver properly? These settings are to be active for this specific device only - all the other devices on the bus use the EOI. So I think I cannot just globally set this property on the board.

 Any help is appreciated. Thanks in advance,

 Martin

 

0 Kudos
Message 1 of 4
(3,798 Views)
Solution
Accepted by topic author mcfischer

To change VISA attributes such as EOS settings through the IVI driver, first your app has to acquire the valid VISA handle (VISA session) or IVisaSession interface. The former is applied to when the IVI driver uses VISA-C API, and the later is applied to when the IVI driver uses VISA COM API. The IVI-C's session handle (which was returned by <prefix>_init() function) is ***NOT*** a VISA handle so you can't call VISA C API with the session handle.

 

I don't know if the IVI driver you are using has such a property or attribute allowing to access VISA handle or IVisaSession interface, but for example, Agilent IVI COM driver has "IO" property that returns the reference to IVisaSession or any good interface to VISA COM.

 

makoto

0 Kudos
Message 2 of 4
(3,783 Views)

Martin,

 

You could probably take a look at one of the existing IVI-C drivers on IDNet such as Agilent 34401A . I believe this driver supports the serial interface which requires specifying a termination character in the driver source code. The driver source code can be found under C:\Program Files\IVI Foundation\IVI\Drivers.

Message 3 of 4
(3,763 Views)
Makoto and gagi1,
 I had not quite gotten the difference between the IVI session handle and the VISA session handle. Works now!
Thanks for your help!
0 Kudos
Message 4 of 4
(3,752 Views)