09-16-2021 05:15 AM
Hi
I am trying to create program to achieve getting each line separatlly from .txt file. I have done it using "For Loop" structure. Inside this loop I can get one by one each line from .txt file, but in outside the loop i only see the last line from the .txt file. I want to achieve possibility to get info from each line to another part of program. I want to set supplyes, meters according to command from .txt files using gpib (sending one by one). It is possible to get this info in real time outside loop or antoher good solution?
Thanks in advance for help
Using: LabVIEW Community Edition
Solved! Go to Solution.
09-16-2021 06:00 AM
It only outputs last value because you have it set that way.
Right click on the output node and select "Tunnel mode --> Indexing" (or concatenating, depends on what data type you want).
09-16-2021 06:08 AM
I try this, but does not work as I wanted to. Even if i use indexing. The values in array appers after taht each line will be taken in loop.
09-16-2021 07:03 AM - edited 09-16-2021 07:09 AM
Hi Spock,
@mrspock wrote:
I am trying to create program to achieve getting each line separatlly from .txt file. I have done it using "For Loop" structure. Inside this loop I can get one by one each line from .txt file, but in outside the loop i only see the last line from the .txt file. I want to achieve possibility to get info from each line to another part of program. I want to set supplyes, meters according to command from .txt files using gpib (sending one by one). It is possible to get this info in real time outside loop or antoher good solution?
Simplify your VI:
Your question is very basic LabVIEW stuff, so I suggest to take care of those "Training resources" listed at the top of the LabVIEW board!
09-16-2021 07:10 AM
Why are you reading the file twice? You could just autoindex on the array of lines.
As far as passing the line around, you could use Queues, Notifiers, or User Events to send it to whoever you think needs it.
09-17-2021 07:24 AM
GerdW thanks a lot for the answer and tips. Aftear reading about this synchronization functions I choose the queue operations and it works great. In attachment screenshot of the program.
Best regards:
Dawid
09-17-2021 08:13 AM