jlada Posted March 1, 2003 Report Share Posted March 1, 2003 Having a cluster array, I want to input it into a function, modify some data in the array and then output the modified array. Is there any way I can do this without duplicating the array on the front panel - having the duplicate input array passing information to the output array? So far all I've done is to hide the indicator (input array) on the front panel... Jeff Quote Link to comment
pblaze Posted March 4, 2003 Report Share Posted March 4, 2003 Use local variables. Quote Link to comment
Michael Aivaliotis Posted March 4, 2003 Report Share Posted March 4, 2003 You can use a local as indicated by the other poster, or you can use a constant on the diagram. Michael Quote Link to comment
jlada Posted March 4, 2003 Author Report Share Posted March 4, 2003 To my knowledge, local variables cannot be assigned as inputs or outputs to the 'icon connector' (terminals). This means that I have to duplicate the entire cluter array on the front panel, assign the duplicate the opposite case (either control or indicator), assign it to a terminal, and then hide it so that it doesn't clutter up the front panel. This works but, is a pretty cumbersome procedure. Is there a better way? Jeff Quote Link to comment
pblaze Posted March 11, 2003 Report Share Posted March 11, 2003 Right click on the local varible. You can select "change to read" or "change to write". In write mode it functions as an indicator. In read mode it functions as a control. Heres a vi that uses this method to write 100 random numbers into an array. Download File:post-10-1073103761.vi Quote Link to comment
jlada Posted March 11, 2003 Author Report Share Posted March 11, 2003 Thanks pblaze but, you missed my point completely. The connector for your vi isn't connected to anything. How would you call this vi from another, modify the array, and then use the modified array in another vi without duplicating the original input array? In fact, you could have accomplished the same thing in your vi with just one local variable, not two... Quote Link to comment
pblaze Posted March 11, 2003 Report Share Posted March 11, 2003 If you want to pass data to a sub vi, then yes you must copy your data structure to the front panel of the sub vi TWICE. Make one a control and wire that as an input. Make the other an indicator and wire it as an output. In the example I sent, you don't need any locals at all. I just set them up to illustrate that they could both write and read. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.