LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB read freezing when running vi without debug light ... (it works with the light)

Solved!
Go to solution

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.

0 Kudos
Message 1 of 7
(2,669 Views)

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(2,638 Views)

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.

 

 

 

0 Kudos
Message 3 of 7
(2,616 Views)

@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...

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 7
(2,590 Views)

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?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 7
(2,585 Views)

That's my VI. The time delay (in between write and read) was recently added after the earlier suggestions. 

 

Thank you.

0 Kudos
Message 6 of 7
(2,572 Views)
Solution
Accepted by topic author kb003

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.

Message 7 of 7
(2,500 Views)