04-24-2025 08:28 AM
Hello dear community,
I'm currently facing an issue with a LabVIEW setup that involves reading data simultaneously from an Almemo device and a sensor connected to an Arduino. I've written a LabVIEW program to handle both, but I'm encountering problems with the data collection process.
Here's the situation:
The Arduino sends a start signal to LabVIEW to initiate synchronized measurements on both the Arduino and Almemo device.
LabVIEW should then begin acquiring data from the Almemo and continue until a stop signal is received from the Arduino.
During this period, all data from the Almemo should be stored in an array, which will be averaged and displayed once the acquisition stops.
However, the array only stores a single value, instead of continuously appending new values (e.g., 60 samples). I verified this using indicators after the append function.
Strangely, when I remove the Arduino-controlled start/stop mechanism and run the measurement independently, the data collection and averaging work perfectly.
Does anyone have an idea why the array isn’t appending values when controlled via the Arduino signals? Could it be a timing issue, or is the loop structure in LabVIEW blocking proper appending?
I've attached a screenshot showing the relevant LabVIEW code section (note: the Arduino section is not included, but it functions correctly and sends the expected start/stop signals).
Thanks in advance for your support!
Best regards,
BEJO
Solved! Go to Solution.
04-24-2025 08:39 AM
Hi Bejo,
@BEJO66 wrote:
However, the array only stores a single value, instead of continuously appending new values (e.g., 60 samples). I verified this using indicators after the append function.
Because you programmed it this way!
The routine works as programmed, but not as intended…
You need to THINK DATAFLOW: there are two routines in parallel and they aren't coupled. So the "ALMEMO" routine starts before the "ARDUINO" routine had a chance to set the stop condition correctly - and the "ALMEMO" loop stops after the first iteration…
@BEJO66 wrote:
Does anyone have an idea…
Stop the "ALMEMO" acquisition only on a falling edge of its stop condition…
04-25-2025 06:46 AM
Hi GerdW,
it's working now - thank you so much for your help!
Best regards and have a great weekend,
Bejo