11-10-2010 11:32 AM
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
Solved! Go to Solution.
11-10-2010 09:17 PM
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.
11-11-2010 02:51 PM
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,
11-11-2010 03:46 PM
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.
11-11-2010 04:45 PM - edited 11-11-2010 04:46 PM
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
11-11-2010 07:28 PM
Thank you. I got it.
11-11-2010 07:37 PM
This is what I had in mind.
11-12-2010 04:46 PM
Thank you Dennis.