LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem receiving Arduino Analog Data

Hi, I'm new to this forum, i'm trying to receive an EMG Myoware Sensor data through my Arduino Uno using the ADC and store that data with Labview. In the Arduino IDE i can visualize the data properly (Monitor Serie and Serial Plotter); nevertheless, when i try to start the data visualization using the waveform chart, there's simple no data, i receive nothing, i don't know what's wrong with my code and any help would be amazing. What i'm trying to do in the code is to receive the A0 pin data for just 6 seconds and then finish the data acquisition, i receive nothing in Voltage nor Waveform Chart

 

 

0 Kudos
Message 1 of 6
(1,660 Views)

Put an indicator on the error wire that comes out of the Arduino read function.

 

Are you sure you have the serial settings set properly?

 

You might need to attach your Arduino code.  Often the problem is that the Arduino code is not written properly to communicate with LabVIEW.

0 Kudos
Message 2 of 6
(1,643 Views)

Thanks for your fast response,

It's a really simple code, i have checked the NI-Visa Driver and there's the Arduino driver, when i see the Error out indicator there's simply nothing...

 

 

 

 

int valorA0;

void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
pinMode(A0,INPUT);
}

// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
valorA0 = analogRead(A0);
Serial.println(valorA0); //print the A0 pin value
}

 

 

I have changed the baud rate because i wanted to see the data better but basically it's all the same

 

0 Kudos
Message 3 of 6
(1,621 Views)

I believe LIFA uses special sketches for the Arduino.  So if you wrote your own, I'm not sure it will work.  Just use standard VISA calls to read the data.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Download All
Message 4 of 6
(1,567 Views)

Hello, actually yesterday i was searching why i couldn't use the LAbview intervface for Arduino and it seems that the tool is not long supported, i tried to use linx, but linx doesn't give the option to change the baud rate.

Thanks you so much for the file, actually why i wanted to ask you is how could i manipulate the sample rate, i store the data in the waveform chart but it only gives about 1000 samples in 6 seconds and that's a 1000/6 Hz sample rate. EMG values are in the range of 40-500hz so i need a sampling rate of minimum 1000hz, i don't care if it's a little bit higher. In theory, i would need something like 6000 samples so i could reach the 6000/6 Hz i need, in my arduino IDE, using 115200 Baud Rate i get something like 10000 samples in 6 seconds (i haven't measured it properly, it's just an estimation) but in labview (might it be for the byte count or for the elapsed time?) i don't even reach the 6000 samples, do you know how could i increase it?

0 Kudos
Message 5 of 6
(1,546 Views)

Assuming 115200 baud rate and 10 bytes per data point, you should be getting ~1152 points/second.  And since there are no waits in your LabVIEW code, your limitation is in the Arduino.  I have almost 0 experience with an Arduino, so I cannot help any more than that.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 6
(1,542 Views)