03-31-2022 07:24 AM
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!!
Solved! Go to Solution.
03-31-2022 07:28 AM
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…
03-31-2022 07:46 AM
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.
03-31-2022 08:15 AM
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?
03-31-2022 09:03 AM - edited 03-31-2022 09:04 AM
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)].
03-31-2022 09:59 AM
I would be really thankful for any help 🙂
03-31-2022 10:10 AM - edited 03-31-2022 10:12 AM
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!
03-31-2022 10:21 AM
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)].
03-31-2022 10:31 AM
@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?
03-31-2022 11:26 AM
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