I am using two DAQ Assistant to acquire data. The logic is as follows and PFA the VI.
NI USB 6356 continuously monitors for a signal in its terminal a0 from an Arduino's output pin. It can be set to HIGH or LOW. Based on a conditional check, a case structure is executed. Inside the case structure, another DAQ assistant is used to acquire data from NI USB 9215A. Once a preset number of data points are acquired, they are written to an xls file using Write to Measurement File block. The files are saved to a series with a file termination condition matching the number of samples read from the 2nd DAQ.
Effectively, I am trying to trigger, once, the acquisition of NI USB 9215A based on Arduino's output. And this has to be repeated inside a loop, as the Arduino will be generating a pulsed output. Screenshot of the VI is as follows:
The issue I am facing is that - when the second DAQ Assistant's setting to acquire data from NI USB 9215A is set to 54 samples at 2.7Hz(in N samples Acquisition mode) and the file termination setting for the writing block is also 54 samples, then everything is fine. In order to sample fewer data points, I reduce the number of samples to lesser value and also the file termination to the corresponding value. But DAQ error always props up - Error -200284.
This is unexpected because by the time the xls file is saved, the Arduino output has changed and hence the False case has to be executed. But this does not seem to occur. To my surprise, the vi is working as expected for a specific set of samples to acquire but not for all possible values.
Hope my explanation is clear and please do help me in figuring out the problem.
Thanks!