LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does the instrument I/O assistant work by itself but sometimes does not in the vi?

Solved!
Go to solution

I have a really large program that controls multiple instruments and I repetitively use the Instrument I/O assistant without any problems, except for a few instances. Attached is the portion that changes the horizontal scaling of the oscilloscope. When I open the Instrument I/O assistant and run it from within its GUI it works fine, the scaling is set to what I have preset. Unfortunately, when I run the VI I get a different result and it is the same result every time. My preset in the I/O assistant and what is going into the I/O assistant are the same values but the scaling that is set for my preset is 500 nS/div and the scaling set from running the VI is 25 pS/div which is the smallest scale the scope offers. Any ideas as to what could be wrong?

0 Kudos
Message 1 of 6
(2,767 Views)

Maybe IO assistant is writing out all the commands faster than your GPIB device can handle it.

 

Instead of using IO assistant, why don't you use the VISA read and write functions directly that way you can put small delays between the writes?

0 Kudos
Message 2 of 6
(2,761 Views)

Well that was my thought as well, but you can add delays to each step inside the I/O assistant and it doesn't matter how much of a delay I set it to it still does the same thing. I would like to avoid the I/O assistant if that will fix my problem. Do you have some sample coding on how to read and write to a GPIB device using the VISA functions? I believe I tried that a while back but I was having issues interpreting one of the commands and wasn't able to get it to work. 

0 Kudos
Message 3 of 6
(2,751 Views)
Solution
Accepted by Vamp

I don't have any examples, but if you right click on the Instrument IO and select Open Front Panel, it will turn the Express VI into a regular subVI you can open and see how the code is actually running inside.

0 Kudos
Message 4 of 6
(2,746 Views)

That's awesome, I actually helped another guy I work with break an I/O assistant apart like that but I couldn't remember how we got there. It looks like they use a number to fractional string conversion and after you reach 5E-7 it doesn't convert properly. I changed it to number to exponential string and it works just fine. Thanks for the help.

0 Kudos
Message 5 of 6
(2,737 Views)

That makes sense.  The default precision for Number to Fractional String is 6.  So 5e-7 is too small for that.

0 Kudos
Message 6 of 6
(2,730 Views)