LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

visa session simulation

Can I run a simulated visa instrument although the real instrument is not connected to my PC. I'm using TestStand with LV 8.2. i need to develop without the gpip instrument connected. I can remember with IVI driver I was able to run simulated instruments...
0 Kudos
Message 1 of 7
(8,126 Views)

There is no direct way like you have in IVI. You might be able to use the technique indicated in this article.

 
0 Kudos
Message 2 of 7
(8,119 Views)
hmm, it appears the non-controller.vi is NOT of much use. It takes a visa resource say GPIB0::5::0::INSTR write *IDN? and reads its own response. see the attached
0 Kudos
Message 3 of 7
(8,112 Views)
That's actually the controller VI. The non-controller VI in that article is supposed to be run first. Keep in mind that this technique requires a secondary GPIB board. After all, I didn't say you would be able to use it, only that you might be able to use it.

An alternative way is to create wrapper VIs for the VISA Read and VISA Write. In the wrapper VI you simply don't execute the code if the instrument is not present. I used a similar mechanism in my previous project so you could still run tests if some instruments were not present, and those tests didn't use those instruments.
0 Kudos
Message 4 of 7
(8,082 Views)

richjoh,

Thank you for contacting National Instruments.

It is correct, that there is not a direct way to simulate the GPIB device. You
can set one of the configuration parameters when instantiating the IVI driver to simulate that instrument.

Additional resources beyond the Developer Zone Example previously suggested. There is a Developer Zone Tutorial: Using IVI Drivers to Simulate Your Instrumentation Hardware in LabVIEW and LabWindows/CVI that is a good reference. Also there is a Developer Zone Article: Creating or Modifying IVI Class Simulation Drivers that gives additional information as well.

Hope this is able to help and have a great day.

 
Sarah S.
Applications Engineering
National Instruments
0 Kudos
Message 5 of 7
(8,070 Views)
Problem related to this thread:  I need to turn a PC running LabVIEW 7.1 into a GPIB instrument.  My preferred way would be to insert some code right into my existing LabVIEW application.  I attempted to use the "non-controller.vi" sample as it seemed to be what I needed.  Unfortunately, it doesn't work properly.  My setup is a PC with a PCI GPIB card.  To test, I'm using another PC with another PCI GPIB card and using MAX to "communicate with the instrument", that instrument being the first PC with the LabVIEW code.  I'm including the VI in question along with the capture log from the computer doing the talking.  The first several calls work fine.  I can send ID queries all day and get back a valid response.  The problem comes when I try to close the communicator window, MAX sends the "ibclr" command.  This crashes the LabVIEW VI and will ocassionally hang LabVIEW completely, requiring a force quit and re-start.  In fact, looking at the spy logs, anytime the "ibclr" command hits the GPIB bus, the LabVIEW VI hangs.  My question is: what's up with that?  Is there a way to get it to gracefully handle this case?
Also, I've been trying to get NI-Device to work to do much the same thing.  So please don't suggest that as a possible route.  My NI-Device issue is that the documentation is apparently incomplete when it comes to adding data types.  I've been struggling (also with no avail) to modify the advanced example to handle string data (or float or anything else aside from short-integer) in messages.
 
This needs to be figured out quickly.  At this point, I'd accept anything that I can to get a PCI running LabVIEW to handle arbitrary GPIB messages as though it were a dumb instrument.  Please email with ideas.  Thanks.
 
- Jim Cavera
 
Download All
0 Kudos
Message 6 of 7
(7,921 Views)

Jim,

I was able to go in and try to test out a similar situation, using MAX and the NI Instrument Simulator. I was able to replicate a portion of your NI SPY capture using the following process:

 

 

I opened the NI-488.2 Communicator, queried 3 times, then closed the NI-488.2 Communicator. I then reopened the NI-488.2 Communicator and did an additional query. I was able to replicate the ordering of your NI SPY capture, but I did not get the same error that you currently did.

I was wondering if you could me some additional information on the current setup of your application. If you could, please give me the step by step of your application, and also how you are communicating with MAX which then causes LabVIEW to hang.

 

 

What I am thinking is happening is the simulated GPIB device (your LabVIEW program) is hanging on a specific command, the ibwrt command. The ibclr command just clears a specific device, and doesn’t appear to be causing any problems with the GPIB communication. The ibwrt command gives the EABO error: which by going to Start >> All Programs >> National Instruments >> NI-488.2  >> NI-488.2 Help, I was able to find the following information to resolve the error:  Make sure that you have configured your device to send data before you request data.

 

 

So, if you could give me as much information as possible on the way that you are setting up the system and sending the commands to the GPIB simulated device, it would allow me to try to troubleshoot it.

 

 

Thanks

Sarah S.
Applications Engineering
National Instruments
0 Kudos
Message 7 of 7
(7,900 Views)