LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading input data file

Solved!
Go to solution

Dear All,

 

I am wondering if somebody helps me.

 

I have a labview program which I am using right now. At this stage I need to read from an input file (dat or txt or excel) in a real time.

 

for example, here is my input data (2 column, 5 row):

       

1.2           2.2

2.3           2.3

3.05           3.3

4.3          4.4

5.2          5.5

 

for example in evry second I want to read jut one row and do the calculation. in this way, during real time i can read each row one by one.

 

How can I do that?

 

Regards,

Mehdi 

0 Kudos
Message 1 of 8
(3,023 Views)
Solution
Accepted by topic author Neka

For text, just use the Read From Spreadsheet. Take the 2D output and wire it to a for loop. Put a 1 second wait inside the loop and you are done.

0 Kudos
Message 2 of 8
(2,988 Views)

Dear Dennis,

 

Thank you so much. but My code still has problem. I did what you said and tried to plot what is happening in every second .

As soon as i ran the program, all data appear without any delay. I expect to see the data in every second.

 

I am wondering if you look at my code and help me.

 

Regards,

 

Download All
0 Kudos
Message 3 of 8
(2,952 Views)


Read the entire file at once before the loop.

 

Inside the loop, index the array one row (column?) at a time and feed to the Build Graph VI with whatever delay you desire for the loop iteration.

0 Kudos
Message 4 of 8
(2,940 Views)

Your delay has the wrong units. The units are mS so if you want to delay by 1 Sec you need to have 1000 mS. Your time interval is also defaulting to zero and the control is out of sight on your front panel. Move it up next to the rest of your controls and indicators so that you can see it.

 

I am assuming that you want the plot to grow as each second goes by. In order to do that you need to put the build xy graph inside the for loop and each second adjust the length of the array feeding the build xy graph. You can use the [i] in the lower let corner of the for loop and the appropriate array function to do this.

 

Norm

0 Kudos
Message 5 of 8
(2,933 Views)

Thank you. I got it.

0 Kudos
Message 6 of 8
(2,920 Views)

This is what I had in mind.

0 Kudos
Message 7 of 8
(2,917 Views)

Thank you Dennis.

0 Kudos
Message 8 of 8
(2,884 Views)