LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading values from a Matrix

Solved!
Go to solution

Hello everyone,

 

i have a big VI with a big while in it, which generats at the End an Array (Attatched). I want to read the Values (continually) from the Matrix, what i am getting now is only the last Value 😞 For example: i want for X to read: 0, and then 250, then 0, then 250. BUT i am only getting the 250 at the End). Can anyone helps me how to split the values from the array and then read the vlaues from each coulomn one for one? 

 

Thanks a lot!!

0 Kudos
Message 1 of 18
(2,284 Views)

Hi Ayman,

 


@AymanB95 wrote:

i have a big VI with a big while in it, which generats at the End an Array (Attatched). I want to read the Values (continually) from the Matrix, what i am getting now is only the last Value 😞 For example: i want for X to read: 0, and then 250, then 0, then 250. BUT i am only getting the 250 at the End). Can anyone helps me how to split the values from the array and then read the vlaues from each coulomn one for one? 


As long as you don't attach your VI we cannot tell you where you went wrong…

Attach (a simplified version of) your VI which shows the problem you have right now!

 

Please don't mix the terms "array" and "matrix", these are two different things in LabVIEW…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 18
(2,280 Views)

Thanks for your reply.

 

i made a really simplified version to show what i mean.

 

So what i need is: to seperate the x coloumn from the y coulomn and read each line from the column step by step. That means: i would like to read in an indicator the first value of x then the second one....etc. and the same for y.

 

 

 

0 Kudos
Message 3 of 18
(2,274 Views)

Hi Ayman,

 


@AymanB95 wrote:

So what i need is: to seperate the x coloumn from the y coulomn


When you need to read two columns in a 2D array you should use IndexArray…

 


@AymanB95 wrote:

read each line from the column step by step.


Use an autoindexing loop on your "X column" array…

 

Both is pretty basic LabVIEW stuff: did you take care of those training resources offered at the top of the LabVIEW board?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 18
(2,262 Views)

Thanks again for your reply.

 

of course i tried autoindexing. But my problem is: i need to feed these numbers to a motor control in x direction, and i want to give the motor the values in x step by step. if i use Autoindexing it would allow me to have a scalar only inside the for loop. I tried to wire the input of the motor insid the for loop where i am getting the values of the x column and i keep getting: The type of the source is long [32-bit integer (-2147483648 to 2147483647)].
The type of the sink is 1D array of
double [64-bit real (~15 digit precision)].

0 Kudos
Message 5 of 18
(2,253 Views)

I would be really thankful for any help 🙂 

0 Kudos
Message 6 of 18
(2,240 Views)

Hi Ayman,

 


@AymanB95 wrote:

of course i tried autoindexing. But my problem is: i need to feed these numbers to a motor control in x direction, and i want to give the motor the values in x step by step. if i use Autoindexing it would allow me to have a scalar only inside the for loop. I tried to wire the input of the motor insid the for loop where i am getting the values of the x column and i keep getting: The type of the source is long [32-bit integer (-2147483648 to 2147483647)].
The type of the sink is 1D array of
double [64-bit real (~15 digit precision)].


Again you forgot to attach the VI. How should we debug your VIs when you always forget to present them???

 

See this:

These are two very basic operations: indexing columns from a 2D array and autoindexing an 1D array using a loop…

 

Btw. your "X Y" array contains 5 columns even though you decided to show only the first two columns!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 18
(2,235 Views)

Hello, 

Thank you so much again! 

I didnt show the VI because im using property nodes to move the microscope stages and it wouldn't work if i put it here. 

 

Its exactly what you did is what i tried to do.


The problem is: the property (node to move the x stage) takes just integers as input. And when I connect to the autoindexing loop, it tells me The type of the source is long [32-bit integer (-2147483648 to 2147483647)].
The type of the sink is 1D array of
double [64-bit real (~15 digit precision)].

 

 


 

0 Kudos
Message 8 of 18
(2,229 Views)

@AymanB95 wrote:


The problem is: the property (node to move the x stage) takes just integers as input. And when I connect to the autoindexing loop, it tells me The type of the source is long [32-bit integer (-2147483648 to 2147483647)].
The type of the sink is 1D array of
double [64-bit real (~15 digit precision)].

 


This makes absolutely no sense. The "source" is your value and the "sink" is what the property node expects.

 

You need to show us your code, even if we don't have your instrument.

 

What kind of property node is this? Part of a driver package? Do you have documentation?

0 Kudos
Message 9 of 18
(2,226 Views)

I did a simplified VI where i can show the problem, i hope that the property node shows if you open the VI.

 

thank you so much in advance!!

 

P.S.: i cant put the property node in the autoindexing loop, in the big VI that woukld be too complicated 😞

 

Thanks

Download All
0 Kudos
Message 10 of 18
(2,216 Views)