01-19-2010 10:47 AM
Hello.
In my program i have a gaussmeter that takes measurement of magnetic field in each of the 3 axes (x, y, z). It has 3 outputs that are connected to NI 9215, to A0-A2
However sometimes not all the measurements needed. For example i want to check only Y axis of the field.
So i have an enum to choose which axis/axes are needed (enum with 7 options: x,y,z,x&y,x&z,y&z,x&y&z).
Following the enum there is case structure with 7 cases.
So if i need only Y axis i want to take that measurement and then put it into some indicator for example. But if I put the A1(in that example) in this("y") case i won't be able to place it in "x&y case", for example.
The only solution i know is to take all the 3 measurements every time, then wire them to the case struct and inside the cases make the wirings to the indicators which are used. But why do i need all the measurements if i won't use them? It takes system resource (not really), and it is not correct logically (at least for me).
Is there some possibility to copy A1(in my example) node to many cases?
Thanks.
01-19-2010 12:14 PM
If you are talking about a control for your "input node" that shows up on your front panel, then you can put a local variable of that control in the other cases. But there isn't really any penalty for having all 3 outside the case structure. What system resources are you worried about?
Post an example of your VI and we can comment better on it.
01-19-2010 03:04 PM
Here is a little i example i made to illustrate the question:
AI0 is an input that comes from NI9215 used with cRIO.
As u can see, it is used only in cases "0" and "1", but in case "2" i don't even need to have that measurement.
But if I would put AI0 into case "0", for example, I won't be able to use in case "1" where I need it too.
So I wired it from outside, and it solves the problem, but again, measurement taken even when it not needed.
Now it is not really overloads the system, but in my head I have some maybe old school principle which says "don't use it if you don't need it".
So my question is if there some option to have "a copy" of AI0, so it can be wired inside the cases.
Thanks
01-19-2010 06:50 PM
It looks like a shared variable. I don't recognize the symbol that is on it.
You should be able to make a copy of that very same variable and place it in the other cases.
Try it.