From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

Oscilloscope with Arduino and Labview

Solved!
Go to solution

Hey there,

I am currently working on an Arduino based Oscilloscope. The project is divided in two main parts:

1.) Measuring

For this I use an Arduino Uno and the "analogRead" command to read the values.Then I store the measured data and send it via "seriellPrint" via USB to my Computer.

2.) Data processing

In LabView I use the VISA-Interface to Read it. However, I have a problem: I have tried to store the received data in an array and convert it to an analog Signal. For storing the data in an 1D array I use a for-loop and it's iteration counter. But when I look into this array I see that only the last two slots of the array were used for data storing. The rest of the array is always empty.

Please can you tell me where my mistake is?

Download All
0 Kudos
Message 1 of 4
(6,360 Views)

Hello,

The function “Replace Array Subset” will replace elements of the array at the point that you specify it.

(Picture attached)

replace array.jpg

 

if you want to store the data in an array, you can use the function "Insert into Array".insert into array.jpg

And add Shift Registers in the for loop to store the inserted values

Greetings and Regards,
James
0 Kudos
Message 2 of 4
(6,260 Views)
Solution
Accepted by topic author Surknival

Hi James and surknival,

 

ReplaceArrayElements is perfectly fine - once the array is defined before the loop and kept in a shift register!

(Right now the array is initialized inside the loop in each iteration…)

 

Instead of InsertIntoArray you should also use BuildArray to append/prepend elements to an array!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 4
(6,252 Views)

Hello Surknival,

 

can you flag the questions as answered in case your problem was solved?

This helps other users to easier find questions with a useful reply and we can close the associated ticket.

Good luck with your developments!

Best,

Daniel

Daniel Maron
Applications Engineering Team
NI Germany
0 Kudos
Message 4 of 4
(6,200 Views)