LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

local vs wires.

I create an indictor array with a lot of items.
I then have to change the array to a control to input into a sub vi.
However, most (all) veterans advise not to use local variables, so what's the best way to input the data in the array into the vi.
Can I have a sub vi, with at the moment, 57 and growing inputs?
I
0 Kudos
Message 1 of 21
(3,598 Views)
How on earth do you have 57 inputs? I assume that includes items that are bundled...Consider breaking those up into several subvi's that each handle a specific task.
Don't use local variables if you can avoid it, consider usuing "functional global variables" instead (basically VI's with uninitialized shift registers to hold the values, you should be able to find help on the subject if needed).
To asnwer the main question the best way is to wire the array directly. Post your VI, and I can help suggest specific modifications.
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 2 of 21
(3,593 Views)
On the front panel of the subVI, just hook the aray to the connector pane.
 
Now connect the WIRE which is going to the indicator to the subVI's terminal.
 


exo wrote:
I then have to change the array to a control to input into a sub vi.


Why is it required?, connect the wire directly to the subVI
 


exo wrote:
Can I have a sub vi, with at the moment, 57 and growing inputs?


No. Maximum you can have is 28.


0 Kudos
Message 3 of 21
(3,592 Views)


exo wrote:
I create an indictor array with a lot of items.

If I understand you right, you have an array with 57 elements. Is this correct?


exo wrote:
I then have to change the array to a control to input into a sub vi.

You don't need to! Chances are that there is a wire going to your indicator array. Branch the same wire and hook it up to your subVI connector.


exo wrote:
However, most (all) veterans advise not to use local variables, so what's the best way to input the data in the array into the vi.
Can I have a sub vi, with at the moment, 57 and growing inputs?

Use a single array input connector!
 
Please attach an example so we see better what you are talking about. 🙂
Message 4 of 21
(3,580 Views)
There's no example yet because the vi is still under construction. Here's the deal. I need to write a lot, on the order of 60 items, into a image header in a very specific form. Each line in the header has three parts: The item name, the value; and a comment. In the vi I have two arrays; one contains the names; one contains the comments. In the main program, I was planning to construct a third (indicator) array with the values. However this array needs to be a control so that I can get at the values and concatenate them with there respective names and comments before being written to the header.
0 Kudos
Message 5 of 21
(3,559 Views)


@exo wrote:
However this array needs to be a control so that I can get at the values and concatenate them with there respective names and comments before being written to the header.

How are you planning to concatenate? Why that array has to be a control to concatenate? It would be better if you post a small code of what you are trying to achieve.

If the idea is to convert the numeic value array to string array and cocatenate,(or build Smiley Indifferent ) you can just build them to 2D array and use the methods mentioned earlier in the post to connect it into a subVI.


Message Edited by Vsh on 04-07-2008 01:27 PM
0 Kudos
Message 6 of 21
(3,524 Views)
When I figure out the vi, I can sent it to you. See the attached. Three arrays, the inner array has to be updated after every image is taken. Corresponding elements in each array have to be concatenated and each new string has to be added one at a time to the header file. The first and third arrays can be left in the sub vi but I suspect the only way to do this is to create the middle array in the main vi, and then use a local variable to convert from a control to an indicator and wire it to the sub vi.
0 Kudos
Message 7 of 21
(3,513 Views)
If I have understood your post properly, then you need to pass these arrays into a subVI  right?

If so, why cant you pass it just like this,

0 Kudos
Message 8 of 21
(3,498 Views)
Because the middle array is not simply output from a camera; In fact, none of it comes from the camera; It all has to be input into the array.
0 Kudos
Message 9 of 21
(3,487 Views)


@exo wrote:
Because the middle array is not simply output from a camera; In fact, none of it comes from the camera; It all has to be input into the array.

Ok.. it was just an example, ... what do you mean by input into the array?  Can you elaborate a bit more?
0 Kudos
Message 10 of 21
(3,480 Views)