02-16-2022 10:37 PM
I use Ni's simple state machine example to build a single acquisition DAQ project. The basic state is that the user clicks the start acquisition button - waveform display - waveform saving TDMS - ends and waits. Now it is necessary to change to continuous acquisition mode. The user clicks start acquisition - waveform display - save TDMS - end acquisition task - start acquisition. The whole project needs to switch between single acquisition and continuous acquisition. Please tell me how to do it.
02-16-2022 11:27 PM
@Comp1ex wrote:
I use Ni's simple state machine example to build a single acquisition DAQ project. The basic state is that the user clicks the start acquisition button - waveform display - waveform saving TDMS - ends and waits. Now it is necessary to change to continuous acquisition mode. The user clicks start acquisition - waveform display - save TDMS - end acquisition task - start acquisition. The whole project needs to switch between single acquisition and continuous acquisition. Please tell me how to do it.
How about adding Continuous Acquisition button that latches and when someone clicks button - waveform display - waveform saving TDMS - but then if the button is still true just keep repeating until the button is false, then go back to waiting for a button press
02-17-2022 05:44 AM
You mean, when I choose continuous mode, the start acquisition button is only valid when I press it for the first time, and then the button will be pressed automatically or the value will change in the next acquisition. When the stop button is pressed, everything returns to the waiting state. But how can I realize it? I can't think of how to realize it.
02-17-2022 09:21 AM - edited 02-17-2022 09:22 AM
Without seeing your code there is not much else I can say. But it sounds like you are using a state machine, so it should be fairly straight forward as every acquisition sequence is the same except at the end you either stop and wait for Start Acquisition to be pressed or you just start another acquisition sequence.
In fact you should not even need two buttons. Think about an oscilloscope it is normally in the continuous acquisition mode and you can select Single Sweep mode.