10-01-2014 03:16 PM
So I am trying to debug a code that someone previously wrote. I am a bit familiar with the code but as I mentioned did not write it myself. The deal is that when Im in running the front panel and the graph is graphing time vs any other parameter, if you press any button on the front panel or if a sub-vi gets called the graph will stall and one has to manually reset the graph. I am not too sure why this is going on. Attached are a few screen shots of where this section of the code lives. There is a stacked sequence with two subdiagrams and it is also being called in the event structure inside one of those subdiagrams. I could also upload the whole code if needed.
Thanks for the help guys
10-02-2014 02:21 AM
Hi julian,
showing a picture of the front panel will be no help to discuss this problem. Embedding that picture in a proprietary document format is a no-go… Next time you should attach a picture (PNG preferred) instead!
To your problem:
- Using stacked sequences is bad program design.
- Using event structures in stacked sequences is even worse…
- Using "default if unwired" tunnels in the event structure can be a root cause of your problem…
- Using lots of local variables (or "Value" property nodes) will not help to solve your problems…
10-02-2014 03:56 AM
These pictures are useless to troubleshoot. we need to see actual code.
I am not familiar with the operation "manually reset the graph". What do you actually do there?
Are you sure only the graph front panel update is stalled? Could it be that the some other part of the code is stalling?
10-07-2014 01:14 PM
here is the code, thanks for the help.
This is the path to the main VI
\FILE VSM_Controller Folder\Documents and Settings\2kA User\Desktop\Sondra VSM\File VSM_Controller.vi
10-07-2014 01:35 PM
I get a "path too long" error when trying to unzip. Please limit yourself to your own VIs and leave the instr.lib stuff etc. out of it.
10-07-2014 01:43 PM
sorry about that, lets see if this works
10-07-2014 01:50 PM
OK, I was able to get to the code by selective unzipping.
As a first step, you should eliminate all these value property nodes and replace them with plain local variables instead. The code os causing excessive thread switching and spends way too much time in the UI thread.
Overall, there is way too much code. For example you have in the "graphed parameter" event the same property node in every single case of the inner case structures. These property nodes belong after the case structure, only once instance each needed!
(Sorry, I have to do some other things now. Will look at it a little more later.....)
10-07-2014 01:54 PM
okay I appreciate the quick response, I will be looking forward to hearing from you later.
Thanks so much
10-07-2014 01:57 PM
Hi Julian,
you will have a hard time to debug this monster.
Lots of local variables, lots of events fired by "value (sgnl)" property nodes, lots of stacked sequences, lots of subVIs containing their own GUI event handling.
I'm out…
10-22-2014 01:06 PM
Do you think there is an easy way for me to fix the time stamp? I want the time stamp to not stall when I touch the front pannel? everything else I will look at fixing it myself