LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use ibfind in a LabVIEW VI directly

Solved!
Go to solution

This may be a silly question, but I can't find anything close to answering my question.  Basically I know how to send an "ibfind DEVn" (with n being the device bus address which in this case is 24) command using some of the separate manual command utilities for GPIB communications and I know how to send the equivalent of the "ibwrt" command using either VISTA or other means in a VI.  I have not been able to find a clear way to use the specific "ibfind" command in a VI itself because I want to automate this process.  With the way we have things where I work I can't exactly try writing something in c or anything and then including that.  While it is so easy to find most of the commands I need (such as how to do "ibwrt"), I cannot find anything for this "ibfind" command.

 

Basically I have a multi-channel matrix scanner that does not have a microprocessor in the interface.  While the control is very simple in sending an "ibwrt" command specifying which channel you want and to which of the two outputs, it cannot complete the end-of-line handshake fully and so the interface has to be cleared.  However, it specifically states that it cannot accept polling or the usual interface clear commands.  I don't even know if the "ibdev" command is acceptable.  I don't want to experiment too much to avoid risking damaging the interface.

 

I found one example that uses the "Call Library Function Node" with the "ibdev" command from the gpib-32.dll file and I figured out how to switch it to "ibfind" (though it only actually listed "ibfindA" and "ibfindW"), but it had a bunch of parameters such as "ud" which was defined as a Numeric and I wasn't sure if just sending "24" would fill the same function as "DEV24".

 

The only other things I could find was to:

Use the "misc" function under the GPIB palette, but none of the examples mentioned anything close to just sending an "ibxxxx" command.

Use the command prompt and execute as the command "ibfind" and the input as "DEV24", but when I try just using a normal command prompt to experiment it doesn't recognize the "ibfind" command.

 

Any thoughts would be appreciated.

0 Kudos
Message 1 of 5
(3,300 Views)

You are approaching this all wrong. It is pointless to try to call the gpib DLL directly from LabVIEW. LabVIEW already has functions for talking over GPIB. They're in the Instrument I/O -> GPIB palette. For example, "GPIB Write" is the equivalent of "ibwrt". If you don't have this palette then you need to install the LabVIEW support VIs/functions when you install the device drivers. This is usually selected by default.

 

However, you should really be programming using VISA, as that is a higher-level API. 

0 Kudos
Message 2 of 5
(3,290 Views)

I appreciate the response, but I think you missed the part where I said I am fairly familiar with the GPIB palette and cannot find a suitable item.  As I said the problem is I have to use a direct equivalent of "ibfind" that does "ibfind" and nothing else.  If you know of one that does and would tell me I would appreciate it. 

 

I have searched and I can't find any that seems to directly correspond to the "ibfind" command.  As I mentioned for the device in question there is no microprocessor on the bus and so it can only accept 2 commands and no others.  That is "ibfind" and "ibwrt".  For "ibwrt" there is the GPIB and VISA palette items for GPIB write and I use them all the time for other devices.  I'm experimenting with a few other items in the palettes, but so far everything has just messed it up.  Fortunately so far nothing has permanently damaged the device but in some ways I just wish I could just find a way to just send the full "ibfind DEV24" command or any of the old commands.  I know this device can work with LabVIEW because I have seen programs, but most of them I'm fairly sure used C or another programming language that I annoyingly cannot use.

 

I cannot use the "Dev clear" or the "SendIFC" as those are interface clear commands and cause errors in the device's GPIB board since it cannot process them.  It doesn't recognize even the status and *IDN? type commands.  I do not know if the GPIB Initialization object or any other fulfils the exact same function and only the function as the "ibfind" command.  The problem is the help files are not specific in terms of the context of the old commands.  What about "FindLstn" or "ResetSys"? "Trigger" or "SendSetup"? What does the VISA "Open" tool do exactly?  I'm working my way through trying these different items as I said, but it doesn't seem promising.

 

Thanks again.

0 Kudos
Message 3 of 5
(3,277 Views)
Solution
Accepted by topic author LeifKing

Well apparently once I shut everything down and started from scratch the "VISA Open" tool started working for what I needed without any problems so far.  I guess maybe there was some garbage on the interface board that was staying and messing everything up.  Hopefully it will keep working.

 

Thaks for your assitance.  I feel kinda silly now.

0 Kudos
Message 4 of 5
(3,271 Views)
Your board does not appear to provide a "true" GPIB interface. As such, just about anything you do will need to be a kludge, by definition. The LabVIEW GPIB Misc function does not provide a means to issue an ibfind command. The FindLstn is not the same as ibfind. As for the ibfind function in the GPIB DLL, the "A" and "W" versions refer to whether the string you provide for the device descriptor should be interpreted as a string using 1-byte characters or "wide" characters. In this case you want the "A". The return value of that function is a device descriptor "ID" which would then be passed to another GPIB function, like ibwrt.
0 Kudos
Message 5 of 5
(3,259 Views)