12-09-2015 09:46 AM - edited 12-09-2015 09:47 AM
Dear all,
This is the first time I post on the community forum and your help and suggestions are much appreciated. I tried to search among previous posts about my inquiry but I was not lucky to find the solution. I need your help in two matters, please.
1) How can I view a list of all variables (indicators or controls) and where/how many times they are used as local variables within the LABVIEW program? See, my program is big and so many indicators/controls are used. Is there a tool that provides what i am asking about?
2) I am using an XY graph indicator where multiple graphs (like six) are plotted and it is in a For loop. I would like to freeze couple of the graphs because they don't change - while the others do-. The problem is that at each iteration, the software overwrites the previous graphs of the XY graph indicator. Such that, if I keep the execution of the unchanging graphs outside the loop, they appear at the first execution only (1st iteration) and if I keep it inside the loop, that affects negatively the efficiency of my program since those graphs don't actually change. Is there a way to keep the unchanging graphs on the XY graph indicator from being overwritten while still having the other changing ones plotted as well (same XY graph indicator)?
Thanks and excuse me for the lengthy inquiry.
12-09-2015 10:07 AM - edited 12-09-2015 10:09 AM
For each control/indicator you can right-click..find...local variables.
Do you have a lot of hidden indicators the be used exclusively as local variables?
Seems you have serious architectural problems. I typically have the graph data as a 2D array (or such) in a shift register and replace the desired plots (i.e. rows) using "replace array subset". Are your x-values eqaully spaced? In that case you should be using a plain graph, not xy-graph.
We really need to see some code to give more targeted advice. A lot of solutions depend on code details. For example if you use dynamic data, things are much more difficult.
12-09-2015 10:17 AM - edited 12-09-2015 10:19 AM
1) How can I view a list of all variables (indicators or controls) and where/how many times they are used as local variables within the LABVIEW program? See, my program is big and so many indicators/controls are used. Is there a tool that provides what i am asking about?
Indicators and controls are not variables. They are user interface elements (and data entry ports for subVIs). To find a terminal for the control, double click it. To find local variables of current control, right click it, Find -> Local variables.
To find all local variables for all controls, press Ctrl+F -> Select object -> Functions -> Structures -> Local variables.
2) Is there a way to keep the unchanging graphs on the XY graph indicator from being overwritten while still having the other changing ones plotted as well (same XY graph indicator)?
Basically no, anyway you can not control it.
You can try to control graph performance with high level tools Right click -> Advanced -> Synchronous display / Smooth updates
If you are using "In place element structure" you can update only single entry of cluster or array without moving other data.
When you send array data to indicator, there is a chance it does not copy the same data, but I am not sure.
When drawing these new data, LabVIEW updates the whole graph area. There are some mechanisms not to redraw parts of the graph if it thinks it did not change (because sometimes they fail). May be it keeps layers in memory and merges them when drawing. Anyway, these are hidden from the user.
12-09-2015 11:09 AM
Thank you for your reply.
"Do you have a lot of hidden indicators the be used exclusively as local variables?"
I don't know what do you mean by "hidden" but most of the indicators/controls are used as local variables once in the program expect for one control which controls multiple parallel loops. Will the latter cause a problem?
Please find attached the part of the code illustrating what I described in the 2nd point. Four arrays are created using Formula Nodes - of equally spaced x-values -and plotted in the the XY graphs. These are the unchanged graphs. The 5th graph which is simply a single (x,y) point is calculated using a Formula Node as well and this is the changing graph. I am using a timed loop in order to control its frequency.
12-09-2015 11:18 AM
Thank you for your response, Alexander. I think i will take your suggestion and try to control the graph performance.
Thanks again.
12-09-2015 11:19 AM
I don't see any local variables. None of your graphs are equally spaced in x. They seem to be eqaully spaced in theta. Not the same.
Have you tried using complex arrays for xy graphs?
12-09-2015 11:52 AM
"I don't see any local variables."
This VI doesn't show the whole program and that's why you don't see the local variables. The main VI consists of other For loops and the "stop" control is used more than once as a local variable to control them.
"None of your graphs are equally spaced in x. They seem to be equally spaced in theta. Not the same."
If you try to write the arrays in a file you will see that every two graphs have the same exact x-values and all graphs have the same values of absolute "x", and this can be noticed given that the graph is symmetric.
"Have you tried using complex arrays for xy graphs?"
No, i haven't. Can you elaborate more on how this can be a solution to my problem.
Thank you.
12-09-2015 12:03 PM