LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I interfere with the bus transmitted data?

Hi,

 

I have a software on a PC that controls an instrument via GPIB. Let's say that all the software does is ask for the value of some variable measured by the instrument every second and displays it. Now, what I want to do is to progamatically change the value of that variable before it reaches the software, so that it looks like the instrument provided that value. I think that I am trying to do something simillar to what the NI GPIB Analyzer does but via Labview.

0 Kudos
Message 1 of 6
(3,390 Views)

This question has come up many times, under various different wordings. Did you try a search? The basic question is "how do I simulate an instrument?". The answer is that it depends. If you have a GPIB instrument and you don't want to create IVI drivers, then the easiest way to do this is to create a wrapper VI for the VISA Write and VISA Read. Use the wrapper VIs rather than the ones in the functions palette. Then you can set a switch in your code so that the wrappers return simulated data rather than trying to talk to the instrument.

 

See also: http://digital.ni.com/public.nsf/allkb/2CC025149A5EC545862571BD004F0A22

 

You could also try this: http://zone.ni.com/devzone/cda/epd/p/id/5323

0 Kudos
Message 2 of 6
(3,385 Views)

Hey, Thanks for your quick response. I've looked over the stuff you suggested and some of the similar questions posted but I havent found a solution.

I am not sure what a wrapper does or how whould I be able to use it; maybe you can give me some more details about that.

 

Another thing I tried is creating a logical name ("GPIB0::5:INSTR" , my software only coomunicates with gpib number 5) with IVI drivers and I changed the gpib number of my physical instrument to 6. Now the software is seeing the virtual instrument and comunicates with it ( NI Spy was on, so I saw that commands like ibfind(DEV5), ibtmo, etc retuned no error but when it got to ibask did not get a respone so the software returned an error ). All I need to do now is figure out a way to forward whatever commands the software sends to the #5 virtual instrument to the #6 physical instrument and back so that the software gets a response back from the real instrument, while being able to interact with whatever is being sent and received.

I have no idea how to do that. I suppose I'm trying to do what NI Spy does within a VI program and not just read the data being sent but modify it as well.

 

Let me know if what I am trying to do can be done or if my quoestions makes sense.

 

Regards

0 Kudos
Message 3 of 6
(3,345 Views)

A wrapper VI is a simple VI that is used to take the place of the actualy VI/function that you're trying to call. In my example I was suggesting a wrapper for the VISA Write and a wrapper for the VISA Read. The wrapper VI would simply not send anything if it sees that you're in simulation mode. For a read, you could program the wrapper to return whatever you want, or even modify what was returned if you wanted to operate in "live" mode.

 

If you have an IVI driver, then I don't understand what you're issue is, since it handles simulation of instruments. What instrument are you trying to talk to, and where did you get the drivers?

 

I don't understand your comment

 


All I need to do now is figure out a way to forward whatever commands the software sends to the #5 virtual instrument to the #6 physical instrument and back so that the software gets a response back from the real instrument, while being able to interact with whatever is being sent and received.

 

Are you trying to talk to the instrument, or not? Why are you trying to use a virtual instrument?

 

 


I suppose I'm trying to do what NI Spy does within a VI program and not just read the data being sent but modify it as well.


NI Spy doesn't do anything within a VI "program". NI Spy acts independently of LabVIEW.

 

0 Kudos
Message 4 of 6
(3,337 Views)

Ok. I'll try to be more specific. I don't know Labview that well or the proper terms to use in forming my question but hopefully you'll get what I'm trying to do.

 

There is a physical instrument with gpib # 15 which is a temperature controller.

There is a software that controls the instrument. That software is made for that specific instrument and will only communicate with devices that have a gpib # of 15. It has an Visual Basic interpreter which should make integrating 3rd party instruments into the measurements but I don't want to use VB (not that I would know how to).

I have attached a text file with an example of how the GPIB activity looks like as recorded by NI Spy.

 

All I want to do is change the temperature value at line the last line 47 (which is "168.7659") with a number of my choosing, before it reaches the software; basically trick the software into thinking that the value that it gets comes from the instrument.

 

P.S. I think I'm missing the basic idea of the wrapper. I know I would understand what they are for if I had an example (like a wrapper for VISA Write).

 

Also, to clarify some things from my previous message:

 

 


 

1) "What instrument are you trying to talk to, and where did you get the drivers?"

I do not have an IVI driver. I just mentioned the logical name because it was the only way that I could make the software talk to something that has a gpib number 15 but is not the actual instrument; thinking that this way I could get access to the data being transmitted between the two (software and real instrument).


 

2) "Are you trying to talk to the instrument, or not? Why are you trying to use a virtual instrument?" I don't know if I need a virtual instrument. And by virtual instrumnet I ment simulated one. Also, I don't really need to talk to the real instrument. I need the software to talk to it and I need to have access to the conversation ( only the stuff sent from the instrument to the software).

 


Thank you!

 

 

 

0 Kudos
Message 5 of 6
(3,327 Views)

Now you're describing something way different. You're trying to write a LabVIEW program to insert itself into the middle of a GPIB stream. How, exactly, do you plan to do this? The only way I would know to do this is to replace the GPIB driver with your own.

 

Have you tried to simply find LabVIEW drivers for your instrument? All you've said is that it's a temperature controller. What kind? Manufacturer? Model number?

0 Kudos
Message 6 of 6
(3,311 Views)