LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call Library Function Node

So I am trying to reverse engineer a driver I downloaded from the NI website because one of the functions doesn't work.  The problem I am having is that all of the sub.vis are written with the call library function node (I've never used this function before), so the GPIB commands that are sent to the device aren't right there on the block diagram for me to see/read.  How can I see what commands are being sent with each parameter?  I attached an image of the block diagram and one of the driver .vis themselves.

 

 

Download All
0 Kudos
Message 1 of 10
(2,484 Views)

Can you use NI Spy in Measurment and Automation Explorer?

=====================
LabVIEW 2012


0 Kudos
Message 2 of 10
(2,482 Views)

I have NI SPY but have never used it.  I just opened it and it wants me to open a capture file (.spy) and I am not sure what that is or how to get it. 

 

I've been trying to use the "communicate with this intrument" in MAX and the instrument's user manual but there is a command that the posted .vi is sending to the device that initializes it that I can't find.

0 Kudos
Message 3 of 10
(2,478 Views)

I havn't used it in a long time either which shows from my reply - I couldn't find it on my LV2011 system and found that it is now called NI-I/O Trace. I couldn't find that either.

 

But back when I used NI Spy there was an option to configure which VISA device to capture. It would log all activity which made it (somewhat) easy to figure out the protocol for unknown instruments.

 

Edit: Found this

=====================
LabVIEW 2012


0 Kudos
Message 4 of 10
(2,473 Views)

Datron NI SPY.JPG

 

Ok so NI SPY is actually a pretty cool/useful program for this stuff.  This is what I get when I run the series of drivers to send a signal.  Can someone help me out with the translating and tell me what ibpad, ibln, and ibwrt are?  #4 on the list is a command I send mannually with the visa write functions, so that is why it doesn't match the others.  Also, am I correct in assuming that only things in quotes are commands sent to the intstrument?  If so then hints to the meanings of the UD2, the number 12, the NO_SAD (0) and the TRUE (1) as they appear would be nice, if they are instrument specific commands then I can probably find them in the manual.

0 Kudos
Message 5 of 10
(2,469 Views)

Those things ibpad, ibln, ibwrt are the GPIB transactions. For what you want to do I think all you have to look at are the VISA Writes and Reads. It may be possible to filter out everything but VISA but I can't remember and don't have VISA installed on the system I currently have access to.

=====================
LabVIEW 2012


0 Kudos
Message 6 of 10
(2,465 Views)

The issue I have been having is that if I go into NI MAX, go to my GPIB instruments and select this one and "communicate with instrument" I can't make it do anyting.

 

i.e. the visa write function in the image above, M1.000000 sets the instrument voltage to 1 volt.  If I go into MAX and send the string M1.000000, in NI SPY it looks like ibwrt(UD0, "M1.000000", 9 (0x9)) and has no response from the device, while in the string sent above it is preceded by lines 1-3 and sets the voltage just fine.  This tells me that something in lines 1-3 of the NI SPY capture above is a necessary command that I need to send to the device before it will listen to anything I tell it.

 

It looks like the UD2 is the board it is communicating with (notice it is UD2 when I use the driver and UD0 when I use MAX, maybe this is one of the issues)

12 is the device address, NO_SAD means there is no secondary address. 

 

Playing around with MAX while I was writing this message I realized "FOR0=" is actually "F0R0=" i.e. zeros and not capital Os and this string seems to be the one I am going to have to play with.

 

Thanks for the help!

0 Kudos
Message 7 of 10
(2,459 Views)

The driver is actually using the GPIB functions and those functions are explained in NI-488.2 Help. Open that. And yes, UD is the board descriptor

0 Kudos
Message 8 of 10
(2,455 Views)

So I have figured out my problem, but am still curious about the call library function node. 

 

Dennis, you say the driver is using the GPIB functions, but I don't see them.  Where are they and where does it store the strings it sends? Is there a way to sort of open it up so you can see what each parameter leads to? I don't really need them now becasue, as I said, I've figured out the issue I was having and can remake the one that doesn't work (without the call library function node) but I would like to be able to understand what I am looking at when I open these drivers.  I have tried right clicking and selecting "configure" which brings me to a window with 4 tabs.  The parameters tab lists the the functions it performs, but I don't see the actual code it sends.

0 Kudos
Message 9 of 10
(2,449 Views)

You see the GPIB functions in the NI-Spy file. To see the actual code, you would need to open the C source code. It's part of the download. In fact, on the download page, all I see is the source code - not a dll.

0 Kudos
Message 10 of 10
(2,446 Views)