LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I change a 1D array to an element?

Solved!
Go to solution

I am trying to create a state machine using a 2X13 matrix and for loop to transfer one row of binary data to the output lines of the DAQ assistant (see attachments)

 

Tutorials, context help, Labview help are getting me there. 

 

The For loop N variable is a 1D array.  How do I convert it the 32 bit integer element for input to the "Array Subset Function".  How do I change the Array Subset Function" output array to 1D expected as input by the DAQ Assistant?  Why is the N variable of the For loop a 1D array?

Download All
0 Kudos
Message 1 of 20
(4,236 Views)

What looks like a 2-D array of Booleans is really a 14-D array!  Did you intend that?  Looks like you nested a 2-D array inside another array container 12 more times!  Hard to peel that onion.

 

If you really had a 2-D array with 13 rows of 5 columns, you could easily access each row one-at-a-time by simply wiring the array itself into the side of the For Loop, leaving the "N" input unwired.  LabVIEW will "unpack one level" for you, that is, it will run the For loop 13 times (one for each row), and what comes out of the "array tunnel" will be the 1-D array corresponding to that row.  You should be able to wire this (1-D) array (inside the loop) to your DAQ Assistant.  Note that this calls the Assistant 13 times, one for each row.

Message 2 of 20
(4,220 Views)
Solution
Accepted by topic author user17625

Nothing you have there is correct. First, you don't have a matrix. A matrix is special type in LabVIEW. You don't have 2x13 array either. You have a 14D array. I really have no idea how you created that. What you want is a 5x13 array - 5 columns for each of your digital lines and 13 for the number of patterns you want to run. The For loop you have is outputing the values of the i terminal - not the n terminal. When you exit a for loop, the default is to autoindex the output and create an array.

 

To make it simple, create a correct Boolean array and simply wire it into a for loop with the DAQ Assistant inside.

 

 

 

Message 3 of 20
(4,216 Views)

I don't know whwther it is the right place to ask this question:

Suppose we have a 1D array with continuously changing array elements.Is it possible to make one of the array element as fixed?while the others are changing?

0 Kudos
Message 4 of 20
(4,179 Views)

@jkuttu wrote:

I don't know whwther it is the right place to ask this question:

Suppose we have a 1D array with continuously changing array elements.Is it possible to make one of the array element as fixed?while the others are changing?


You could have started a seperate thread. Alright how is it changing?. Yes you can hold a constant value in the array but you cannot avoid changing but you can replace that index with a constant element after you get the updated array in a loop. It would be better if you can post a code where you find the changing elements and which element you don't want to change.

-----

The best solution is the one you find it by yourself
Message 5 of 20
(4,172 Views)

jkuttu wrote:

Suppose we have a 1D array with continuously changing array elements.Is it possible to make one of the array element as fixed?while the others are changing?


Nothing changes by itself, there is always code that makes the change. In all cases, the code can be modified such that certain elements don't change.

 

For more detailed help, we need to see some code. The question is too vague out of context.

Message 6 of 20
(4,147 Views)

123.JPG

Please can anyone tell me the name of this function? I will be thankful to you..

0 Kudos
Message 7 of 20
(4,139 Views)
asmat,

Don't hijack unrelated threads and don't spam the board with the same question multiple times.
0 Kudos
Message 8 of 20
(4,134 Views)

Sorry..

0 Kudos
Message 9 of 20
(4,104 Views)

Here is my VI.I want my array's first element should be always 23.while the others are constantly changing.Is it possible to do it?How can we make one of the array element always constant?

Thamks in advance.

0 Kudos
Message 10 of 20
(4,052 Views)