LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Fast Continue Analog Read...port

Solved!
Go to solution

Gents
just I question, I need to acquire data fast possible (near 500 Hz) from Arduino not for only one pin but at least 3 pin. With last one LIFA version (1.6)  I used Analog Port, building array and plot on graph... using
"Continuous Sampling" on LIFA 2.0 is it possible make it? acquire from analog port at rate 500 Hz

thank you
roberto

0 Kudos
Message 1 of 5
(5,032 Views)
Solution
Accepted by topic author eischifa

Hey Roberto,

I tested a single channel up to around 5KHZ with continuous sampling. That being said that is set up for a single channel. You should be able to get around 5K/number of channels. This will require changes to both the sketch and the LabVIEW code. Since we are not at the size limit of the Arduino packet I would suggest making a new command from the same framework that just sends 3 data points (one from each channel) back at a time instead of 1.

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 2 of 5
(2,846 Views)

Gents

I am still working to fast analog read without progress! Let me explain:

Like wrote previously, my task is acquire data as fast possible from at least 3 channel (i use arduino 1).

For make this, whit Kevin's advices try to modify both sketch and labview code, with poor result.

In particular i modify sketch in order to add new variable called

"unsigned char contAcqPin1;"

and in LabviewInterface.pde

under

// Variables

unsigned int retVal1;

under

case 0x2A:  // Continuous Aquisition Mode On

contAcqPin1=command[9];

also modify labview code

Continuos aquisitionON.vi (here adding a new pin controller) and

Continuos aquisition sample.vi (adding join number and replace arry subset)...

Someone could help me?

thank you

roberto

0 Kudos
Message 3 of 5
(2,846 Views)

Have you tried Finite sampling in 2.0?  Portread is slow when you want to read multiple samples (faster when you want to take single readings of multiple pins' high/low states)

Try setting up successive finite sampling at 5khz, say 100 samples, then switch to the other pin.  I like to median filter these samples to smooth out the data.

Also, if you are doing comparisons between the analog pins you're sampling, you may instead connect the voltage sources that you would've connected to those analog pins to an instrument or different amplifier and connect the output from that instr. amp into the arduino (limits the pins you need to read from).  You will have to decide if this will work for your application.  Good luck.

0 Kudos
Message 4 of 5
(2,846 Views)

Hello

I'm coming back in this older post because still I can't fix this problem.

Unfortunately the solution previously proposed didn't work.

Somebody know exactly how modify arduino sketch and labview code in order to acquire continuous sampling at least  at minimum 3 analog pins?

I try to change both, but really I don't know where is key point.

Kevin_F, could you help me?

thank you

roberto

0 Kudos
Message 5 of 5
(2,846 Views)