05-15-2013 08:41 AM
Hi,
I am triying to form an equation between two known points. I want to do this with the attached VI, the most critical point is that I will read the x1, y1, x2 and y2 coordinates from the same .txt file. They will be written in a .txt file and I will send them to the appropriate channel (x1, y1, x2 and y2) respectively. How can I get data in a rule from a .txt file?
Could anyone please help me with this issue,
Best regards.
05-15-2013 08:45 AM
You are almost there. You just need to index your values out of the 2-D array and wire each one to the respective terminal.
05-15-2013 09:17 AM
I have indexed them but it gives another error that expects array indexing in the formula node.
05-15-2013 09:22 AM
You have indexed your 2-D array into 4 1-D arrays. You need to send it 4 elements. So you need to wire up another input to tell which row or column of the 2-D array contains your data.
05-15-2013 09:23 AM
05-15-2013 09:50 AM
Thank you very much,
It has worked when I have indexed them.
05-16-2013 09:18 AM
Now I have to send data to index array module, in this vi I have send constanat input but I want the formula node to process the data from the 1.txt file row by row so what kind of input should I send to the index array?
Waiting for your valuable helps.
Best regards,
05-16-2013 09:21 AM
Sorry I forgot the 1.txt
05-16-2013 09:29 AM - edited 05-16-2013 09:29 AM
Because your file is fixed length, you should be using a For Loop instead of a While Loop.
Set up your Index Array to give you columns. Then auto-index at the loop tunnels to go row by row (as Apok had mentioned).
05-17-2013 03:06 AM
Dear RavensFan,
Thank you very much for your helps, I am bit new to labview so I usually can not find the appropriate functions easily. And a new problem has rised in my application. I should write the A, B and C numbers in the respective series to the file 2.txt. I am able to write them in a straight forward case but I want to write the next triples (A B C) in the next row. Like this;
A1 B1 C1
A2 B2 C2
A3 B3 C3
.
.
.
So how can I put new line constant and space constant to my VI?
Waiting for your valuable helps,
Best regards,