LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array as counters??

Hello there

 

I'm relatively new to LabVIEW. Just a simple question. If I'm using arrays (index array,array subset, etc ) i have to connect a constant value to its index length to control the number of element as my output in my array.

 

What if my vi does not have a fix value of data?..And I'm not sure what value should I put in as my constant ?

 

Say, I want to extract a few elements from my 2-D array. Do i have to change my constant value at the subarray index? Or, is there a way to build some sort of counter to automatically pick the element that i needed instead of manually key-in and change the constant value repeatly??

 

Any comments are WELCOME!!.....Thanks!!

 

Guitar Girl

0 Kudos
Message 1 of 18
(3,937 Views)

There are many ways to create counters in labview, but we need more details to help you.

 

Can you post a simplified VI ?

JD

 


J.D.
French Labview beginner
N'oubliez pas de complimenter les bonnes réponses - Don't forget Kudos for good answers
0 Kudos
Message 2 of 18
(3,929 Views)

If you don't know how many elements is within your array then you can use the 'Array Size' vi to find it.

But i am not sure if that's what you are asking.

0 Kudos
Message 3 of 18
(3,925 Views)

Please post an image of your code to help illustrates your question.

 

Now on to the guessing!

 

On the array palette there is an "array length" function (as Dimetrios posted)

 

 

 that tells you how many elelements are in the aray. You can combine the value returned by the Array Length operator with functions from the Numeric pallette to add to subract from to change the value as you need.

 

Probably wrong with the guess so reply with clarification and images please.

 

Ben

Message Edited by Ben on 06-14-2010 09:34 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 18
(3,922 Views)

Now,here's the vi. Yes, i thought of using array size. If you look at my vi, i have to build several array subset . Im just wondering do i need to build countless array subset and change the value at 'selection' every single time?

 

Have a look. Thanks. ..

0 Kudos
Message 5 of 18
(3,898 Views)

"Im just wondering do i need to build countless array subset and change the value at 'selection' every single time? "

 

Please rephrase that question and we'll take a crack at answering it.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 18
(3,882 Views)
Depends what you want to do. It is not very clear from your description or your vi.
0 Kudos
Message 7 of 18
(3,877 Views)

Well, it appears that you are indexing columns 1 and 2 specifically.

Are you saying that the data you want will not necessarily be in these locations all the time? 

Cory K
0 Kudos
Message 8 of 18
(3,865 Views)

Let's say I want to get the value of the 3rd column of array2, i build an array subset with the index constant set to 2. If i want to get the value from the 4th column, i change the index constant as 3. I've labelled both as 'Selection'. So back to the question, if the array has 100 columns or rows, do i have to copy and paste again and again the array subset and just change the index labelled as 'Selection' ? I'm creating a GUI. Yes, it's tedious if i have to ask the user to key in the constant value repeatly.

 

Please advice. Thanks!

0 Kudos
Message 9 of 18
(3,860 Views)

Still guessing!

 

Have you looked at using a For loop and letting the index "i" terminal serve for your math?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 18
(3,845 Views)