06-25-2017 09:49 AM
Hi All,
I want to pass a 2D numeric array to a sub vi which will then run when an event is triggered. I can do this easily for a numeric control (see example image), is there an equivalent method to do this with a 2D numeric array?
I think what I am missing is the correct class of refnum and the correct property node.
Thanks
Solved! Go to Solution.
06-25-2017 11:44 AM
06-25-2017 01:51 PM
Thanks for the reply. It is the wrong data type I think, I want to pass the contents of the array which is a numeric.
06-25-2017 07:26 PM
06-26-2017 12:28 AM
Hi cbutcher, yes that is exactly it. I want to make this a double. When I connect this with a VI server reference in the top level VI, it errors because of the data type mismatch. Once I have connected the terminals how can I change the data type on the refnum control? Should I simply use a numeric digital control or does it need to be set as a array and configure it as a double?
If you can make a quick example that would be extremely helpful!
Thanks!
06-26-2017 01:52 AM
Hi Penguin,
create your array as needed, including correct datatype.
The right-click the array and create a refnum constant in the block diagram.
Right-click the refnum and create a control from it. Move this control to whereever you need it…
(There are other ways too, but that should get you started…)
06-26-2017 01:52 AM
On your Block Diagram (either is fine, probably easier from subVI) create an array constant. Place inside a DBL constant. Add a dimension by right clicking and clicking Add Dimension. You now have a 2D dbl array.
Right click on this (constant) 2D dbl array, and click Change to Control. If you create the array on the front panel, you probably don't need to do this, but then you need to change between BD and FP at different steps. On the (control) 2D array, right click and Create > Reference. Right click on the reference created and click Create > Control. Now you have a control version of a 2D dbl array refnum. Link this control to the connector pane.
In the main VI, you can now wire a reference to a 2D dbl array, and in the subVI, your Value property should return a 2D array of doubles.
06-26-2017 03:41 AM
Wonderful, thank you very much!