Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Is It Possible to Use Both IVI and VISA In the Same Session?

Primary Software: Instrument Drivers/IVI>>IVI Specific Driver
Primary Software Version: N/A
Primary Software Fixed Version: N/A
Secondary Software: Driver Software>>NI-VISA, Instrument Drivers/IVI>>IVI Class Driver, Instrument Drivers/IVI>>IVI Compliance Package

Problem:
I have an instrument driver that uses IVI to open and close sessions. I am trying to use VISA Reads and Writes to communicate with the device. LabVIEW is not showing any broken wires and I can run the VI, but the instrument does not respond.

Solution:
Even though LabVIEW may not show any error and you will be able to run the VI, it is not possible to mix IVI and VISA sessions. When an instrument driver is an IVI driver it calls upon a DLL made for that instrument that has the functions necessary to communicate with that instrument, while VISA uses the VISA32.dll. In the instance where there is an IVI driver, IVI Session Open and Close are used, so a VISA Write or Read will not communicate with the instrument.



Since the IVI driver uses a specific instrument DLL, it will have to use the functions from that DLL to communicate with the instrument. For that reason, many IVI drivers contain VIs for reading and writing that make that call for you.

In the case a VISA instrument driver, the Open and Close functions for that driver contain VISA Open and Close. This is the case where you can use VISA Reads and Writes because they all use the VISA32.dll to communicate with the instrument.

If you do want to use IVI and VISA in the same VI, make sure you follow the order below:
  1. Open the VISA session
  2. Use VISA functions to communicate with the instrument
  3. Close the VISA session
  4. Open the IVI session
  5. Use the IVI instrument driver VIs to communicate with the instrument
  6. Close the IVI session
OR
  1. Open the IVI session
  2. Use the IVI instrument driver VIs to communicate with the instrument
  3. Close the IVI session
  4. Open the VISA session
  5. Use VISA functions to communicate with the instrument
  6. Close the VISA session


Related Links:
Instrument Control Support: Instrument Drivers and NI-VISA Support
Developer Zone: Instrument Driver Network

Attachments:


IVICorrect.JPG - IVICorrect.JPG
IVIIncorrect.JPG - IVIIncorrect.JPG



Report Date: 11/02/2006
Last Updated: 03/19/2008
Document ID: 4318N7AC

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit