From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save values for only some iterations of measurement loop for vacuum controller

Hello,

 

I am currently working on a control program for the Pfeiffer Vacuum TPG 256A vacuum measurement unit (see attached VI). The program should in general read the pressures from the controller in each loop and show them on the monitor (which already works). My problem is now to find a way, how I can press a button while the program is running that then allows to save the pressures in parallel for the next 20 sec, 2 min, etc. in a text file and then closes the file. I tried to use rendezvous for a parallel save while loop, but I am quite new in this topics and failed to realize a rendezvous.

You find the not working saving loop at the very bottom. I am also very interested in other tips to improve the quality of the program.

Thank you very much in advance and best regards,
FinalDestillation

0 Kudos
Message 1 of 5
(2,156 Views)

Use a Queue to send data to your logging loop.  To help you get started: Producer/Consumer


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 5
(2,134 Views)

@FinalDestillation wrote:

I tried to use rendezvous for a parallel save while loop, but I am quite new in this topics and failed to realize a rendezvous.


Typically a Queue is used.

Message 3 of 5
(2,132 Views)

Thank you for your information, that was very helpful to me. However, there are two problems left:

 

1) Only one single row of values are saved in the text file. Why aren't them appended to the file at every customer loop iteration?
2) After the customer loop has finished and the file is closed, the producer loop runs normal, but I am not anymore able to click any buttons. I have to restart the program to save again.

I attached the improved VI to the post. Thank you again in advance for your help!

FinalDestillation

0 Kudos
Message 4 of 5
(2,106 Views)

@FinalDestillation wrote:

However, there are two problems left:


There is a third problem... Ideally, any VI should fit a modest screen. Let's say ~1000X~700 pixels. Definitely ~6X~10 not screens.  Sequence structures are not or hardly used in well structured LabVIEW programs. Both issues will guarantee zero overview.

 


@FinalDestillation wrote:

 

1) Only one single row of values are saved in the text file. Why aren't them appended to the file at every customer loop iteration?


"Write Delimited Spreadsheet.vi" has an input, "append to file? (new file:F)". New file, False is the default. You get one column, because you set the delimiter to "\n". If you want rows, leave the delimiter to default, "\t".

 


@FinalDestillation wrote:

2) After the customer loop has finished and the file is closed, the producer loop runs normal, but I am not anymore able to click any buttons. I have to restart the program to save again.


The event structure handles one event, and then the flow continues. The event structure itself does not loop. You'll need (yet another) while loop.

Message 5 of 5
(2,097 Views)