Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Intermittent Labview/Windows XP hangs using Agena driver

Hi all,
I'm trying to save marker values from an E5061A network analyser using the Agena v1.1 instrument driver. The 'agena Marker Search' VI is placed in a While Loop to continuously read maximum and minimum marker values. My VI works well initially but then completely hangs both Labview and Windows XP after a seemingly random number of loop cycles (anything from several hundred to many thousand cycles). When this happens, my only solution appears to be restarting the Labview platform (a PXI-8186 controller in a PXI-1011 chassis).
 
I've tried using the Profile Window in Labview and the Task Manager in Windows XP to see if there was a memory problem while the VI is running, but everything seems reasonable. The controller is running LV 7.1 and VISA 3.2, while the instrument control uses GPIB. I'm a newbie at this, so any suggestions are welcome,
 
Thanks,
Brian
 
 
0 Kudos
Message 1 of 7
(4,808 Views)

Hi

At this moment the newest visa driver is 3.6. I would upgrade but don't guarantee that it helps.
I seriously suspect a communication problem. Could you print the statusbyte (first ask the instrumenmt) just before each new communication with the instrument?

 

greetings from the Netherlands
0 Kudos
Message 2 of 7
(4,805 Views)

Hi Albert,

Thanks for the advice. I installed NI-VISA 3.6 but still got the same behaviour. I'm not familiar with using the Status Register, so I'm concentrating on correctly triggering the measurements from within the While Loop. At the moment the E5061A is using a continuous internal trigger, with the VIs looping independently - there is no synchronisation. I suspect that this may cause a problem, but I'm not sure. At the moment I'm working on a GPIB-controlled trigger which will be in the loop.

I still don't understand how this could hang both Labview and Windows, however. Does anyone else have experience of this?

0 Kudos
Message 3 of 7
(4,780 Views)

Please attach your VI and we can try to reproduce it on our side.

You might consider placing a small delay in your loop to see what effect that has.  Also, monitor your memory usage for the LabVIEW process in Task Manager to see if there is a memory leak in your code.

0 Kudos
Message 4 of 7
(4,776 Views)

Hi Jason,

I've attached a simple example VI to show the hanging problem: this typically fails after several thousand loop iterations. The calibration, sweep setup etc. of the E5061A are manually set on the analyser - all I need the VI to do is display maximum and minimum values (which will eventually be written to file). For most sweep setups, the While loop iteration time is shorter than the analyser's sweep time (on a continuous internal trigger), so several loop iterations may display the same measurement values. This doesn't occur when I use bus triggering (see below), but I don't think this should hang both Labview and Windows. As mentioned above I've used Task Manager to monitor memory usage, but there doesn't seem to be a problem while the VI is running.

I've also implemented a version of this VI using bus triggering (see 2nd attachment). Note that the 'agena Configure Trigger' VI is modified to remove point triggering options, which aren't supported by the E5061A. The '*OPC?' query ensures that the sweep is complete before marker measurements and loop iterations are performed, and so I don't think a loop delay is required in this case. I'm still testing this at the moment so I'm not sure if stability is improved.

Thanks for your help on this.

Download All
0 Kudos
Message 5 of 7
(4,747 Views)
Branching the VISA session in the Hang Example looks suspicious and I'm not sure if this causes an eventual race condition leading to the hang.  Can you try programming that in series like in the 2nd example you attached?
0 Kudos
Message 6 of 7
(4,739 Views)
Running the marker search VIs in series definitely seems to be more stable: a series version of the first VI I posted ran for over 100,000 iterations before I voluntarily stopped it. The triggered VI also appears to be stable at the moment. I was treating the VISA session wire just as a normal data path, but evidently this isn't the case. It would be good if the Labview debugger could flag this branching problem, or at least stop it hanging the whole PC if a problem occurs. Thanks a lot for your help on this!    
0 Kudos
Message 7 of 7
(4,734 Views)