08-28-2009 07:59 AM
08-28-2009 08:51 AM
08-28-2009 08:55 AM
Thank you for the response.
No, active X would not be welcome. They want to send commands using the VISA layer, to keep things consistent with the rest of their program.
08-28-2009 09:51 AM
In that case it seems that you're basically looking to be like an instrument vendor who wants to adhere to the VXIplug&play's VISA specification for their instrument. This seems to me like a tall order. I assume you could get the VISA spec from the IVI foundation. That would probably contain the information you're looking for.
Just to see what happens when you send an *IDN? command to an instrument over VISA I ran Wireshark, and I noted a bunch of packets going back and forth between my computer and the instrument over several different ports. The packet that contained the actual *IDN? command was one of them. Whether or not you can safely ignore the other packets I have no clue.
08-28-2009 10:28 AM
Thanks for the response.
Yes, making my executable "look like" a VXI PnP instrument is exactly what I want to do...
If I have to program this from scratch, I agree that this is a tall order. But I was hoping that NI already implimented what I need...
Certainly, they have the portion that allows me to send commands to an instrument and read responses from an instrument using VISA. My question is if there is a way to use the same VISA read routine in my executable to monitor and wait for a command to come from somewhere else, and when the command comes in, can I then respond to it using the VISA write routine?
I am assuming that this is not possible, but maybe I am wrong?
If it is not possible, perhaps someone has done something similar that I can use, such as the TCP read and write, which I have never used before.
My end goal is to provide my customer with a well known and easy way to send the commands to my executable. (By using a VISA write.) This way I know that they already have the capability in their existing programs, and they will be able to do this will little effort from their side.
So it would be ok for me to use a TCP read (or any other approach) in my executable as long as it can intercept the VISA write that was sent from my customer's program (which is not written in LabVIEW).
Asked from another ponit of view altogether, is there a way to impliment the equivilent of NI-Spy in a LabVIEW executable. This would at least allow me to monitor all VISA traffic, and I can scan the traffic for commands that are intended for my executable. That would solve 1/2 of the problem, and would be a start.
Thanks again for the response.
08-28-2009 10:44 AM
It sounds like your customer is being a bit unrealistic. The typical thing to do would to provide them a dll that any c programmer should be able to call and is probably already being done in their programs. This idea of emulating an instrument is pretty far off the norm. I have heard of external pc's being used to emulate an instrument.
And I don't believe it is possible to use any VISA Reads or Writes in your program.
08-28-2009 02:44 PM
Would it truly be that hard? If you have your basic LabVIEW program, then add in another parallel loop that handles the communication. It listens for commands on a TCP/IP channel. Parses them out and passes the commands into the real part of the program. If there is a response, it reads a local variable, queue, action engine, whatever and passes a response back out.
It would all be VISA communication. It wouldn't be at the level where the computer shows up as some sort of instrument in MAX which is what I think would be the ridiculous request.
08-28-2009 03:17 PM
08-28-2009 03:26 PM
Ravens Fan wrote:Would it truly be that hard? If you have your basic LabVIEW program, then add in another parallel loop that handles the communication. It listens for commands on a TCP/IP channel. Parses them out and passes the commands into the real part of the program. If there is a response, it reads a local variable, queue, action engine, whatever and passes a response back out.
It would all be VISA communication. It wouldn't be at the level where the computer shows up as some sort of instrument in MAX which is what I think would be the ridiculous request.
The problem is that the short capture I did with Wireshark indicates there's other packets being sent back and forth that are not commands. These are probably part of the VISA spec, but as to what they are I have no idea. I also have no idea how the low-level VISA API would interpret not seeing these packets from the "instrument". If they're part of the communication would it interpret it as an error?
08-28-2009 04:05 PM
I guess this is a good discussion. I have seen this type of thing provided before, where software emulates an instrument. I liked it a lot because I could control the software from LabVIEW without doing anything special at all. (VISA writes and reads.) But I agree this is a bit off the normal track.
If I can not do it with VISA writes and reads, is there a chance I can do it with the TCP writes and reads? It looks like this is a good way to send messages between two different programs, and LabVIEW supports it for sure. My concern is if my customer will be able to easily send the commands to a TCPIP port in their software. Again, Visual BASIC, C and Matlab are common programs that my customers will have. Do they also support this type of thing?
If it is common for all of these programs to support TCP writes and reads, then I will go in that direction.
Thank you for any additional advice on this topic.