LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LINX Arduino Uno Oscilloscope

Hello,

I'm working on creating a simple oscilloscope using LabVIEW and Arduino Uno as the analog input. I'm using LINX to interface the Arduino with LabVIEW. The issues I'm having are as follows:

 

  1. Tone measurements (amplitude and frequency) are not functioning when sending an analog input via Arduino. If I generate a sine wave within LabVIEW(and replace the LINX analog read), tone measurements work perfectly. I'm assuming my analog signals are not being sampled at a high enough rate to satisfy these functions. Attached pictures are 1Hz, 2.5Vp and 60Hz, 2.5Vp respectively.
  2. I would like to find the exact sampling rate within the waveform chart. My 60Hz signal looks quite under sampled and I'm trying to determine by how much. I have not come across examples of this being done using LINX.

Reading through similar examples tells me that a potential bottleneck is the serial USB connection from hardware to LabVIEW. I'm unsure how to determine if this is the case here. I do have access to a myRIO as a hardware alternative if this makes more sense.

 

Thanks!

 

1hz.JPG60hz.JPG

0 Kudos
Message 1 of 5
(4,901 Views)

I think the problem lies in the value you're connecting to your measurements - it is a scalar value. It has no time information (even implicitly) and so you can't make a meaningful tone measurement.

 

If you add a buffer of the last N points, you'll have better luck.This will somewhat average the result over that number of samples though.

 


@daftendire wrote:

Reading through similar examples tells me that a potential bottleneck is the serial USB connection from hardware to LabVIEW. I'm unsure how to determine if this is the case here. I do have access to a myRIO as a hardware alternative if this makes more sense.


Well, I don't believe the problem is inherently in the USB (or pseudo-COM connection). It's possible you're undersampling the signal, but it looks vaguely ok. It may be that you'll struggle at higher frequencies unless you can set up some code on the Arduino to continuously measure and stream values (which I think will prohibit the use of the LINX toolkit, but I'm not sure).

 

The myRIO is a signficantly more powerful piece of hardware, and you could easily use that to do this. However, it's also a significantly more expensive piece of hardware, so if that's an issue, you could continue with the Arduino setup (it should work, at least for low-ish frequencies).

Especially if you use the FPGA in the myRIO, you could sample fairly fast frequencies with no problem. I'm not sure what the maximum "scan rate" is for the non-FPGA option.


GCentral
0 Kudos
Message 2 of 5
(4,847 Views)

Thank you for the reply. I will work on applying a buffer to my existing signal. If I cannot get that to function I will most likely migrate to myRIO for the improved sampling rate.

0 Kudos
Message 3 of 5
(4,799 Views)

I have to agree with cbutcher, last time I played with LINX I was getting under 200Hz loop rate doing nothing but updating a boolean.

 

<200Hz sampling frequency is going to make a pretty sad oscilloscope.

 

You could try writing the Ardunio part using the Arduino native language and then communicate with it using VISA just like any other instrument on a serial port.

 

That will certainly be faster than LINX

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 5
(4,787 Views)

I added a loop counter via LINX toolbox and saw that im getting 121Hz (loop rate). Quite slow indeed and barely enough to handle a 60Hz input. I am going to change over to the myRIO platform and continue from there.

 

thanks for the replys

0 Kudos
Message 5 of 5
(4,774 Views)