10-22-2012 09:13 AM - edited 10-22-2012 09:18 AM
I have a gpib read that spits out two values at a offset. This is in a loop thats defined by the initial , final and step size parameters. My question is, why does the gpib read freezes (or doesn't exectue; whenever I turn the debug light on(after it's been run), it 'lights' up only till the gpib read and nothing further). I replaced the gpib read with visa read , it doesn't freeze anymore but it only records zeros (when I can clearly see my system outputting some values). Any help would be appreciated.
*there was a similar topic about debug light and the reasoning was made to be a race condition. but I dont see how my situation is a race condition.
Thanks,
kb.
Solved! Go to Solution.
10-22-2012 09:26 AM - edited 10-22-2012 09:27 AM
Hi kb,
ever considered to clean up that VI?
Considered to replace the stacked sequence with a flat one?
Considered to program some error checking?
The problem probably occurs before the GPIB read function. Most probably your GPIB device needs some time between command write and read request. But well, you have hidden all that in the stacked sequence...
And yes, I would recommend to use VISA functions instead of plain old GPIB calls!
10-22-2012 10:05 AM
Cleaning up...for me thats the cleaned up version. I'm still figuring out labview.
Stacked sequence made the perfect sense in a 1-2-3 logical reasoning.
I'm not sure about error checking though. Labview never pops errors for my problem. It's just freezing up.
I'll take your advice and add a wait time in between write and read. But, after it's run...the code freezes right at read. Any wires after gpib read show not being executed yet.
I wrote my code from an ancient driver set. I figured why to mess with something that's already working. So, I built it all on gpib.
10-22-2012 12:01 PM
@kb003 wrote:
Cleaning up...for me thats the cleaned up version. I'm still figuring out labview.
Stacked sequence made the perfect sense in a 1-2-3 logical reasoning.
<snip>
I wrote my code from an ancient driver set. I figured why to mess with something that's already working. So, I built it all on gpib.
This brings up an ancient scrap I have with National Instruments. Namely, they advertize LabVIEW as something so easy to use, you can dive right in. Well the truth is, you can dive right in, but it's guaranteed you will be writing horrible code, and much more easily than with any other programming language.
In reality, you really have to have training, formal (classes) or informal (books on LabVIEW), just like with any other programming language. Because NI keeps promoting the LabVIEW Falsehood, you get managers that assign newbies to write complex code, and then you have issues like the one the poster has above.
I'll get off my soapbox now and return you to your local programming, already in progress...
10-22-2012 12:58 PM
First of all, I do highly recommend using the VISA calls.
Secondly, can you post the actual VI? That would aid us a lot more than the screen shot.
What instrument are you trying to communicate with?
10-22-2012 02:41 PM
That's my VI. The time delay (in between write and read) was recently added after the earlier suggestions.
Thank you.
10-23-2012 07:18 PM
It's been solved. It's got nothing to do with the program. There was an interference issue with another parallel machine. Once I got rid of that connection, everything worked like a charm.
Thank you all for your very valuable inputs.
-kb.