LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Optimizing memory useage

Have an application that takes data off varioius instruments - most of them over a GPIB.  Have had the program hang up a few times over the last several days, and have a feeling it's a memory issue.  I haven't been able to figure a way to limit the amount of RAM my LabVIEW application uses - is there a way.  Also, how would I go about troubleshooting where things are crashing.  What I've experience before the crashes is one of the instruments on the bus getting an error - sometimes by the instrument displaying "Error" on the front panel.  Other times instruments have recieved commands that cause it to change states - like I had a DVM that was set up to read currents, all of a sudden displaying resistance in Ohms - and no where in the program do I read ohms off of any instrument.

Also, I haven't tried this - but would creating an executeable be more memory efficient than just running my project?  I think where I work we have limited versions that we can create executeables, and I have personally never done this.  Most of our LabVIEW users are EE's using LabView for small programs where they just want to set up 3-6 instruments and get some data.  This project is a little more complex than what I've attempted in the past, and would appreciate some feedback.

Thanks

Dave
0 Kudos
Message 1 of 4
(2,839 Views)
Dave,

It is hard to tell without seeing the code. Please post the VI if possible. What version of LV are you suing? Did this ever work? Why do you suspect a memory issue?

Do you have all of the error clusters wired? What error do you get? Are you repeatedly opening VISA references inside a loop and not closing them? Are you building large arrays or strings?

How are the commands to the instruments generated? This may be a clue, since the instruments are obviously receiving valid commands, although ones you did not intend to send. An invalid command would not switch the DMM to ohms.

Lynn
0 Kudos
Message 2 of 4
(2,785 Views)
I agree with Lynn that code would help us diagnose this issue.
 
lacking more specific symptoms...
 
Make sure you are using the latest and greatest version of VISA since there was a bug back in the LV 7.1 days (or there-abouts) that would cause an app to hang.
 
But that is just guessing!
 
Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 4
(2,782 Views)
Try sprinkling a few of the VIs I posted below through your code. They post a string to the Windows debug output. You can view the debug output using DebugView from Microsoft SystInternals (it is free). This will give you persistent logging after LabVIEW crashes, so you can find out where the crash is occurring. Judiciously setting your strings will also give you some clues as to what is going wrong with commands. All of this assumes a software error, not a hardware problem. Good luck!
0 Kudos
Message 4 of 4
(2,753 Views)