LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW communication with Arduino and Almemo

Solved!
Go to solution

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

0 Kudos
Message 1 of 3
(1,090 Views)
Solution
Accepted by topic author BEJO66

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(1,086 Views)

Hi GerdW,

 

it's working now - thank you so much for your help!

 

Best regards and have a great weekend,

Bejo

0 Kudos
Message 3 of 3
(1,007 Views)