LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB vi created with Instrument I/O assistant not timing out

I am new to Labview and I am trying to write a program to control a HiPot tester via GPIB. This HiPot tester is used on several other projects, so its GPIB address can vary. I want to use Labview to scan for this device on the bus and then configure it.

I used the Instrument I/O Assistant to create a subVI that can query the device for its manufacturer and model information. In this VI I created some connectors that allow an outside program to input the bus and device number. These numbers are formatted into a string and then used to send commands to the GPIB device.

If I use this vi and specify the correct bus and device IDs for the hipot tester, I get back the expected data. However if I send in the wrong device ID (or wrong bus), the program hangs.

The Instrument I/O Assistant creates a timeout value of 2000 msec for the operations. The *RST and *IDN? commands are sent first and then the VI performs read operations to fill 128 bytes. So I figure that the longest this should take to timeout is 2000*130 msec = 4.3 minutes. But 10 minutes later the VI is still running.

Why does this operation not timeout if the device and bus IDs on GPIB are not correct?


--

Brian Rose
0 Kudos
Message 1 of 14
(4,375 Views)
I'm not sure what the problem is with the Instrument I/O Assistant (I don't use it at all), but one way to ease your problem of different addresses and different GPIB boards, is to create an alias for the instrument in MAX. Right click on the instrument listed in MAX and select Properties. You can type a meaningful name (i.e. HiPot) into the alias box and then refer to that in your LabVIEW program.
0 Kudos
Message 2 of 14
(4,368 Views)
Will this alias be persistent if the GPIB address changes?

The root of my problem is that the device is reconfigured for various test setups (that I do not control). I am trying to make a program that does not care about the device's current address and will be able to scan the GPIB bus and configure the hipot tester no matter which address it is using.


--

Brian Rose
0 Kudos
Message 3 of 14
(4,368 Views)
If someone changes the address on the same system, the alias does not persist. If that's what is happening, then you should use the VISA Find Resource function. If you use the expression "GPIB[0-9]*::?*INST" as mentioned in the help, it will return a list of all GPIB busses and instruments. Using the list, you can do an *IDN? query to find out which one is the instrument you want to use. Something like the code in the attachment should work.
Message 4 of 14
(4,369 Views)
Brian -

Can you post the Instrument I/O Assistant subVI?  I have a couple of ideas of what could be happening.

-Tommy
0 Kudos
Message 5 of 14
(4,356 Views)
Here is the VI. I created it using the Instrument I/O Assistant and then edited it so that the bus and device ID are passed in as parameters.



--

Brian Rose
0 Kudos
Message 6 of 14
(4,354 Views)
Dennis,

I tried building the VI that you submitted, but my VISA controls do not have the stopwatch in the upper right corner. I assume that these controls are timed out, while those without the stopwatch do not timeout.

Is this correct?



--

Brian Rose
0 Kudos
Message 7 of 14
(4,349 Views)

The little clock means that it does I/O asynchronously. Right click on the VISA control to change.

I looked at your code. There's a big broblem with the while loop. If there's an error condition, there is no status returned (it's an empty array) and your Index Array functions will return a false, making the loop run forever. It would be better to place the loop inside a case structure with the error cluster wired to the selector. How much of this VI is your code and how much is from the I/O Assistant? I'm curious because it uses GPIB functions and not VISA.

0 Kudos
Message 8 of 14
(4,346 Views)

Here are the steps I followed to make that vi

1) Start the Instrument IO Assistant
2) Add a step - Write *RST
3) Add a step - Query and Read *IDN? - Run the step and show it how to parse the manufacturer and model strings
4) Press OK and return to the VI
5) Right click the object and "Open Front Panel" which converts from an expressVI to a subVI.
6) Open the block diagram and replace the ResourceNameIn string with the input integers and string formatting section.
7) View the connectors and connect the input integers.

That's it. Most of that code is generated by Labview.



--

Brian Rose
0 Kudos
Message 9 of 14
(4,340 Views)
Hi Brian
the first problem would appear to be that you send a reset command. But you only give the instrument
100ms to reset/reboot before your query its identify. If you have the instrument manual check to see actual timing
of bus etc.
As a rule of thumb I wait 300ms - If you run  NI spy you will be able to see exactly when processes occur.
Add a sequence frame between reset command and id command.Place a  wait icon in the frame with a control on the input time so that you can adjust time from front panel.
Initially set time to 400msand see what NI spy reveals.

Go for it
chow xseadog

Message Edited by xseadog on 09-10-2005 01:47 AM

0 Kudos
Message 10 of 14
(4,333 Views)