LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

save data in txt


@sinclair15 wrote:

ignore about the loops, i just want to be able to control the path and change files while the program is running, how do i do that?


This has already been answered. Did you try?

0 Kudos
Message 11 of 16
(159 Views)

How do I try it, how do I close and open a new file? Where can I see an example of the architecture in question? What steps should I take? I'm really still a noob.

0 Kudos
Message 12 of 16
(143 Views)

If you have a control for "file path (use dialog)" input, you can configure it (right-click - Propeties - Browse options), e.g. to allow a new file only; Open/Create/Replace File function has input for operation - you can select create, this causes error if an existent file name is passed to it; the function, if having unwired file path input, asks for file name and with a create-only operation (not e.g. "replace or create") will not overwrite an existent file. For closing a file, you have a Close File function.

 

Using a new file for each run seems to be more safe: when a run is terminated by an error, the file may contain an incomplete line, and appending to the file may append to the line, producing some nonsense data.

0 Kudos
Message 13 of 16
(133 Views)

@sinclair15 wrote:

ignore about the loops, i just want to be able to control the path and change files while the program is running, how do i do that?


You can't just "ignore about the loops" because it's the loops that are the issue. As I said before you are going to need to use a proper program architecture like a simple state machine. 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 14 of 16
(105 Views)

@RTSLVU wrote:

@sinclair15 wrote:

ignore about the loops, i just want to be able to control the path and change files while the program is running, how do i do that?


You can't just "ignore about the loops" because it's the loops that are the issue. As I said before you are going to need to use a proper program architecture like a simple state machine. 


you could do two loops in parallel (producer consumer architecture),

but propably a state machine architecture (with one loop) is sufficient

0 Kudos
Message 15 of 16
(85 Views)

@alexderjuengere wrote:

@RTSLVU wrote:

@sinclair15 wrote:

ignore about the loops, i just want to be able to control the path and change files while the program is running, how do i do that?


You can't just "ignore about the loops" because it's the loops that are the issue. As I said before you are going to need to use a proper program architecture like a simple state machine. 


you could do two loops in parallel (producer consumer architecture),

but propably a state machine architecture (with one loop) is sufficient


But even the Producer/Consumer architecture will need a simple State Machine as its core in the Consumer loop if the OP wants to change data files while the program is running. 

 

Everybody needs to learn the state machine because it's by far the most used architecture.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 16 of 16
(77 Views)