LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array, how to change from indicator to control?

I have a set of block diagrams which builds an array - user will input 10 integer numbers and these numbers will be stored in Array_A.

Now I would like to perform some arithmetic operation to Array_A, e.g perform addition on Array_A and a constant array Array_B.

But since Array_A is an indicator, how do I make it a control, before I perform the addition?

0 Kudos
Message 1 of 9
(2,811 Views)

Hi Splee,

 

You can make use of the Local Variables of the Array Controls to write or read values to it. To create a local variable, just right click the control and click create local variable. But make sure you don't create any race conditions.

 

Regards,
Nitz

(Give Kudos to Good Answers, Mark it as a Solution if your Problem is Solved;)) 

0 Kudos
Message 2 of 9
(2,810 Views)

Check this example. Don't use sequence structures like this in your program. I used it just to show you how the local variable works.

 

Regards,
Nitz

(Give Kudos to Good Answers, Mark it as a Solution if your problem is Solved;)) 

0 Kudos
Message 3 of 9
(2,801 Views)

"The wire is the variable". Since you generate your data and wire the result to the indicator, you already have a wire with the "expected" data, don't you?

Think of the LV block diagram a little like a printed circuit in electronics. How would you pass on a signal from a given source to a measurement point (e.g. the indicator) and a following element like an OP?

Correct - a branch.

 

So go for it.

If the data is required within a loop, but different iterations and it has to change, use shift registers.

Variables are the least option you should ever think off (if at all.....).

 

thanks,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 4 of 9
(2,797 Views)

Hi Norbert,

 

Thanks for pointing this out. I failed to read the post well enough that i posted such a suggestion. I explained here how to update a control with two different values (at different instatnces) and while creating an example for showing it, i unknowingly explained what you just stated (taking the wires to send data) 🙂  

 

Thanks again.. 

 

Regards,
Nitz 

 

 

0 Kudos
Message 5 of 9
(2,791 Views)

"user will input 10 integer numbers and these numbers will be stored in Array_A." "Array_A is an indicator"

 

You should never store anything in an indicator, nor consider the indicator a variable.

 

The wire is the storage and variable. The indicator is a window to see it's data.

 

/Y 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 9
(2,769 Views)

Hi Yamaeda,

If on the front panel I have a numeric control to let user key in any number and I would like to store e.g the 10 different numbers the user key in, how would I do so?

I thought storing in an array indicator would be a natural solution. Could you please advise which method should be used?

Can a wire store a series of number?

0 Kudos
Message 7 of 9
(2,761 Views)

Hi Norbert,

I am a novice and I don't understand how a wire can be used to store a series of data.

Could you please show me an example?

Thank you.

0 Kudos
Message 8 of 9
(2,759 Views)

Pretty basic:

 

 

Message 9 of 9
(2,751 Views)