LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to dynamically control the indice of an array

Solved!
Go to solution

Hi ,

 

In fact I have two request:

 

1/

I want to create an array that have different size? depending on user's request!

So I would like to be able to set the indice of the array so that allow the user to have his array with different ligne in is array (1D)!

 

On my test the number of ligne will be affected by an other application (a for loop used in an other part of my application)!

 

2/ Is it possible to have two loops "for" that command in the same time a sequence loop (with indexation)?

 

Tx

0 Kudos
Message 1 of 11
(2,918 Views)

Hi akim_10,

which values shall the array elements have? You can use the "initialize array" function. What do you mean with your second point?

 

Mike

Message 2 of 11
(2,916 Views)

Hai,

Can you post some more details on what exactly is your requirement or some sample vi's

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 3 of 11
(2,907 Views)

Hello,

 

My application is not done as I don't know how to do it! What i want to do is:

 

Create an array of numbers that will set the timer for diiferents points , for the moment i set a numeric value  for each timer of my sequence!

But I want to have only one timer set by an array that will follow the same loop of my points!

 

See file attached, the loop "for" is commanded by a txt file for different points and my timer for this point 10 ==> my timer will be then out of my sequence inside the "for" loop commanded by the array ousaide the "for" loop!

 

tx

 

0 Kudos
Message 4 of 11
(2,899 Views)

I fear that I've misunderstood your intent but, in the event that I haven't, consider this.

The 'control' control I added would be the result "commanded by a txt file for different points".  The 'Timer delays' could be a control on the Front Panel or an array generated somewhere else.

 

Code Capture Tool

Message Edited by jcarmody on 03-09-2009 06:52 AM
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 5 of 11
(2,862 Views)

In fact what i need is to create dynamically the array that will command the timer!

 

if I have 3 points ==> the array should be able to set 3 differents timing on timer

if I have 5 points ==> the array should be able to set 5 differents timing on my timer

 

That the reason I want to know how I could set the indice of the array (not by changing the form of the array on the front panel

0 Kudos
Message 6 of 11
(2,843 Views)
That should be easy enough, after I know what the n different timings should be.  How do you know what they should be?  I'm guessing that you want them all different, otherwise you'd be able to use a scalar.
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 7 of 11
(2,833 Views)

I think you may be confusing array terms here.  You wrote "set the indice of the array" but I'm wondering if you are talking about its size.  You use an index to pick an array element, but you're talking about dynamically creating the array based on the number of points - that's the size.


I want to create an array that have different size? depending on user's request!

So I would like to be able to set the indice of the array


Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 8 of 11
(2,827 Views)

Yes exactelly, they should be different, so each value of my array should be the timing!

 

So if i have an array of 3 value ==> the user will be able to set 3 different timing...etc..

0 Kudos
Message 9 of 11
(2,825 Views)

you are right, what  I need is to be able to set the size of my array !

 

sorry for this! so is there a solution?

0 Kudos
Message 10 of 11
(2,811 Views)