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: 

Start - save - stop

Thank you for your quick response.

 

I'm trying to understand the vi. Can you please tell me if I get it right?

 

When pressing start, the DAQmx is started. ( Event 1: start)

As long as no other button is pressed, the data will be acquired and displayed on the two charts ( Event 0: timeout)

When STOP LOGGING is pressed, the data will be no longer aqcuired, but will still be kept in the array. ( Event 2: stop log)

After STOP is pressed, the program will be terminated.

When pressing SAVE, the data will be saved to the specified location.

 

 

I don't fully understand what notes you wrote in the program: "keep zero timeout" , "set timeout to zero" , "set timeout to infinite (-1)" and "keep current timeout". Can you explain this to me, please?

 

 

Best regards,

Dries

 

 

0 Kudos
Message 11 of 16
(737 Views)

DriesM wrote: 

I don't fully understand what notes you wrote in the program: "keep zero timeout" , "set timeout to zero" , "set timeout to infinite (-1)" and "keep current timeout". Can you explain this to me, please?


The next timeout for the event structure is decided in each event and placed in a shift register. If start is pressed the timeout is set to zero and the timeout case executes continuously (replacing your inner loop). Firing other events sets the timeout to infinity (-1), stopping the acq.

Message 12 of 16
(731 Views)

Thank you for the information.

 

I will try if it works as soon as possible and will keep you posted 🙂

 

 

Thanks!

 

 

Kind regards,

Dries

0 Kudos
Message 13 of 16
(710 Views)

@altenbach: I have tested the .vi.

 

Thes start, stop and save buttons work perfect. However, whenever the programming is running and acquireing measurements, both of the charts are constantly flashing.

The image on the charts are black for around 1 second. Then for about 0.1 second I can see the measured data on the chart. Afterwards the chart becomes black again for 1 second and the whole proces repeats itself until the measurements are finished.

 

( only the image on the charts in flashing, and not my whole screen)

 

What could be the cause of this?

 

I've added the vi in attachment.

 

 

Best regards,

Dries

0 Kudos
Message 14 of 16
(680 Views)

Why do you clear the history in the timeout case? That should probably happen in the start case!

(Sorry, that was my mistake. I don't have DAQ so I could not test and I must have grabbed the wrong event case for that 😉 Only spent a few minutes on this...).

 

You could also make a seperate event case with a "clear history" button. In that same case, you also might want to cleat the upper 2D array. Right now it grows forever and you will run out of memory at one point.

 

 

I would also try to avoid overlapping objects on the front panel.

 

0 Kudos
Message 15 of 16
(672 Views)

Try this

 

(Not tested! Modify as needed)

0 Kudos
Message 16 of 16
(658 Views)