LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read file .txt per line with timming

Hello guys, i'm new here and with labview.

I'd like to do a reader file with NMEA code and after open i'd like to read line per line or multiples lines (user control this step) until the end of file with a delay (user control this delay) and send it to a serial port.
Example

User set to read 2 lines/2000 ms

Line 1
Line 2
Send to serial port
Wait 2000 ms
Line 3
Line 4
Wait 2000 ms
...
0 Kudos
Message 1 of 9
(3,779 Views)

Hi gorio,

 

and what's your problem?

What have you programmed so far?

 

Sounds like you plan to program a state machine...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(3,774 Views)
I'm on my phone and i cant send an image to show my problem, but i can read file (all lines but not per lines with timming). Sorry my ignorance but ASAP i'll post my project here.
0 Kudos
Message 3 of 9
(3,766 Views)

Please look my project.. it works but i need to do something to fix the VISA write, because this software do it:

 

read Line 1

VISA write Line 1

wait 1000ms

read Line 1

read Line 2

VISA write Line 1

VISA write Line 2

wait 1000ms

...

 

I need to send just new lines..
Did you understand my ideia ? 

0 Kudos
Message 4 of 9
(3,749 Views)

Hi Gorio,

 

I cannot open your LV2011 VI, so you might attach a downconverted version?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 9
(3,736 Views)

I sent LabView v9 and v10

Download All
0 Kudos
Message 6 of 9
(3,726 Views)

Hi Gorio,

 

you always reload the full text file (or: you always start to read the text file at offset 0) because you use the file path for reading the file. If you would read the context help you would know that using a file reference would allow you to read the file line by line. There are surely examples supplied with LabVIEW that will show you the behaviour...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 9
(3,723 Views)

Insert something like this in your code.

 

Ben64

Download All
0 Kudos
Message 8 of 9
(3,713 Views)

Thanks. It works. sorry my ignorance..

0 Kudos
Message 9 of 9
(3,706 Views)