LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Write hangs after running OK for a while

VISA Write function (VISA abc W) in my VI runs OK, with a Return Count of 4, for a while (100's to 1000's of times)  then it hangs.  The Return Count from this function is then 0.  The Error In and Error Out show no errors.  Clicking HIGHLIGHT EXECUTION shows the output wires from the VISA Write as colored grey, while everything else has normal color. 
 
Clicking the VI red ABORT button, or any of the sub VIs red ABORT buttons, fails to abort or reset the VI even after 20 minutes.  Task Manager will stop LabVIEW, but then LabVIEW will not start up again without shutting down and restarting the computer.  Changing to a different Windows XP computer and a different PCI-GPIB, NI-488.2  board, as well as reinstalling LabVIEW 7.0, or using a different LabVIEW 7.0 serial number, has not solved the problem. 
 
Thank you for your help.
0 Kudos
Message 1 of 6
(3,383 Views)
Hard to diagnose without seeing your code. If you can send code we might be able to tell more. If so, do a Save with options, Development Distribution, zip the file if it is large. Or a screen capture of the part of the offending code, saved as a jpeg (Not BMP) file might be sufficient.
 
P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 6
(3,382 Views)
Thanks for your reply.  Attached is a PowerPoint file that shows info on our computer and LabView, and a For Loop
(Slide 3) that runs the VIs addressing one of our instruments (Hart 1590 Super Thermometer).  Slide 4 shows the
block diagram that is pretty much as downloaded from National Instruments.  The block diagrams for each of the
colored sub VIs contains a sub VI having a VISA abc W function as shown in Slide 5.  The only places this VISA
function hangs is in inside the While Loop, inside the yellow Meas. Status. VI or the blue Read Meas. VI.  The
Meas. Status. VI sends "new", and  the Read Meas. VI sends "tem" to the Hart instrument. 
Also attaced are the VIs for the Measurement Status and the Read Measurement.  In the course of trying to fix this
problem I've added various time delays of 50, 100 msec, up to 1 sec, thinking that the Hart needed more time to
respond before receiving another command; none of this improved the situation.  I added indicators and arrays to
capture the last several strings that were input to the VISA function, but I saw nothing unusual.  All I've been
able to determine is that the VISA abc W function hangs as described in my posted message. 
0 Kudos
Message 3 of 6
(3,356 Views)
Hi Dexter,

I've looked over the code and had a few requests for you. First, run NI-Spy from MAX and start a capture before you start your application. Save the spy capture once LabVIEW freezes. Attach that to your next post and we can see if there are errors there.

Second, watch your memory usage in the Windows Task Manager while the application runs. See if the memory usage constantly increases. If that's the case, there's a memory leak somewhere that's occuring.

With that info we can find out a little better what's causing the problems.

-Matt S.

LabVIEW Integration Engineer with experience in LabVIEW Real-Time, LabVIEW FPGA, DAQ, Machine Vision, as well as C/C++. CLAD, working on CLD and CLA.
0 Kudos
Message 4 of 6
(3,343 Views)
I ran NI-Spy and Task Manager/Performance as Matt S. suggested, but the VISA hang problem did not occur even after 2-1/2 days.  It has usually hung in the first few hours.  This seems to be an elusive problem.  I have attached the NI-Spy file and an image of the last Task Manager window.  The only thing I noticed was that the Available Memory appeared to slowly decrease.  When I started this recent test on 9/19/05 4:15pm it was 681545, and today is 640020; I don't know if this is a meaningful parameter.  I'd appreciate any ideas and suggestions. 
0 Kudos
Message 5 of 6
(3,315 Views)
Hi Dexter,

One thing to check out is the Processes tab in the Task Manager. You should see a process for LabVIEW. See if the number for memory use on that particular process is increasing as the application runs. You may see small changes here and there, but we're looking for a constant increase. If that's the case, you're probably building an array within LabVIEW that's constantly increasing in size at a high rate or something to that extent. The way that is handled may have to change just a bit.

Regards,
Matt S.


LabVIEW Integration Engineer with experience in LabVIEW Real-Time, LabVIEW FPGA, DAQ, Machine Vision, as well as C/C++. CLAD, working on CLD and CLA.
0 Kudos
Message 6 of 6
(3,307 Views)