09-21-2011 02:22 PM - edited 09-21-2011 02:27 PM
Ben,
I think it's probably better to post my code here so you expert can help me with some suggestions. Please forgive that my code is not written in good manner - I'm not really a trained programmer but more like a self-educated user. I put all the sequence structures in flat so I can print them out as a image for you but turns out it's way too long to show in webpage. I did not change back as I think this might easier to read.
This is the only VI I worte for my program. Generally speaking what I do is the following (this is the original code w/o change):
1. Initialization
2. Read 7 4-20mA current inputs from the 9203 card
3. Process the raw data and calculate the "corrected" values
4. Output 7 4-20mA current via 9265 card to customer DCS
5. Data collection/calculation/outputing are done in a big while loop. I set wait time as 5 secs to save cpu some jucie
6. There is a configuration file I read/save every cycle in case customer reboots the system. Also I do data logging to a file (every 10min by default)
7. Some other small things like local display and stuff.
Do you think I should open a new topic to post my code? I don't want to duplicate same topic to waste other's time.
I truely appreciate your help!
Rgds,
Harry
09-21-2011 02:50 PM
I suggest you start a new thread on this topic since off-topic follow-up Q deep in a thread will not get much exposure.
Moving the code to a properly named thread about memory leak will be esier to search as well.
Add to tht list "Now Ben I told you about doing code reviews for free..." is a quote I don't want to hear from my boss (again) so I will not be able do the code review. But if the image is posted by somebody, I am allowed to comment on pictures.
Don't worry if I can't reply directly. There are plenty of giants on this forum that are more than capable of pointing out the issues.
So start a new thread and "gird up your loins". You will be beaten about the head and shoulders verbally but will be a better developer because of it An inapropriate quote from Psalms that applies is;
"Thy rod and they staff they comfort me."
Prep to be comforted.
Ben
09-21-2011 05:12 PM - edited 09-21-2011 05:21 PM
@Harry.W wrote:
Thanks Guenter.
I checked this Desktop Execution Trace Toolkit and it costs ~$1000 so I probably have to relay on "manual" approach to identify the issue. But I do think you, and also Ben, are right about it's probably my program's fault. I'll try to dig in a bit more...
Thanks again!
Harry
I spent the $1000 a few months ago and it was well worth every penny. You can download a 30 day trial.
I wish I would have waited though. DETT now comes with LabVIEW 2011 developer suite. So all you people who have never used this tool but now have 2011 go check it out under tools/profile/execution. I should have bought the state chart module or something!
Then again I would not have gotten the usage out of it over the time I have had it. It is invaluable for finding leaked references and watching memory allocations. This thing itself is worth the upgrade price to LV2011.
09-22-2011 02:12 AM
Right you are, Steve.