08-17-2009 10:58 AM
Hello,
Is there a way to create a variable without having a indicator or control in the front panel. I just want to save and update data in the block diagram.
Thank You,
Venkat Rao
Solved! Go to Solution.
08-17-2009 11:02 AM - edited 08-17-2009 11:04 AM
The best way would be to keep the data in a shift register or feedback node.
There are also shared variables.
Can you show us some code so we can give more specific advice?
08-17-2009 11:02 AM
That is exactly what a wire is in LabVIEW!
See alsohere.
Ben
08-17-2009 11:22 AM
Hello,
I have attached the VI I am working on.
On the front panel there are two variable called Top and Bottom Limit Variables. These variables get their value change inside the inner most case structure. This has no purpose being displayed to the user.
What is the most efficient way to change it?
Thank You,
Venkat Rao
08-17-2009 11:31 AM
08-17-2009 11:37 AM
Hi
you can use functional global
the another way is to create subVI (let say "ReadLimit.vi", His output is array of limits) and to wire it to shift register
Eugene
08-17-2009 11:37 AM
08-17-2009 11:48 AM
Hi
It seems that functional globals can you help
But, change your main function pattern. use event structure.
08-18-2009 09:45 AM
Hi venkat_rao,
I'm not sure what you mean by "what time to change". Do you want to know which one to run or know which one wrote to a variable last or what?
08-18-2009 10:22 AM
venkat_rao wrote:I have attached the VI I am working on.
OK, please tell us a bit more about the logic and how the various cases tie together. I assume that only one can be active (discarge vs. feed). If both can be active under some conditions, you would have several locations overwriting locals in arbitrary order with unpredictable results (race conditions!) This means you should have everything in one case structure.
There are other race conditions, for example you read from a local variable of the "data array" in parallel of the generation of the data array. Since things occur in parallel, there is no way to tell what happens first. Another race condition! To ensure that the case structure operates on the current values of "data array", you should use a wire instead of a local variable.
You also have several cases where you write to a terminal (e.g. ... valve open" in one case and to a local variable of same in the other case. Again, you should place the terminal outside the case structure and just wire the indicator to te same wire that goes to the case selector. No need for diagram constants and local variables. right?