From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

program hangs when normally run, but works fine with highlight execution or single step??

I´m making a program to control a Marconi 2030 signal generator over GPIB.
Just using the Marconi drivers (IFR20xx), no low level GPIB stuff.

Made a very simple test program, just a loop where I can set the frequency and output level.

Now the weird thing: The program works fine, as long as I highlight execution, or single step through it. But when I normally run it, it only allows to set the frequency once, and then hangs.

Don´t have a clue why that is happening....
0 Kudos
Message 1 of 4
(2,995 Views)
Update: I seem to have found a workaround. When multithreading is disabled in Labview, it also runs fine. Must have something to do with timing... Any guess where the problem would lie? Is this related to the GPIB, the Signal generator VI's, or something in Labview itself?
0 Kudos
Message 2 of 4
(2,983 Views)
I haven't used this particular instrument but there's a couple things to try. First see if you can isolate the problem by putting some delays between the VIs or setting a breakpoint one by one to determine if it's due to a certain function. You can also delete the timeout event in your loop. Also, it would appear that you're using the IVI driver. Make sure you have the latest version of VISA and the IVI compliance package. Have you tried the LabVIEW driver? If the LabVIEW driver works, that would at least point to a problem to either the driver itself or your IVI setup. Unless there's a real reason to use IVI, I always recomend the native LabVIEW driver instead.
Message 3 of 4
(2,988 Views)
Thanks for all the suggestions. I seemed to get it working by adding a wait after almost all SG VI´s. Not very convenient... VISA and IVI compliance package were more recent than asked for by the driver. Updated them nevertheless, but that didn´t seem to help.

I was using the IVI version because I hadn´t noticed there was also a seperate Labview version...

Downloaded the Labview version, and now I don´t have any problems anymore.

Thanks!
0 Kudos
Message 4 of 4
(2,964 Views)