LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample Rate of Analogue Read?

Hey, I am just looking for how I determine the sample rate of the analogue read VI and is there a way to change it?

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

If you are sampling an analog pin with the Analog Read Pin VI then you will be constrained by the speed of the serial communication and the speed of your loop in LabVIEW.  What sort of sample rate do you need?  Have you tried using the Continuous Sample VIs?

0 Kudos
Message 2 of 6
(3,422 Views)

I am sure the baud rate is set at 115'200. There is no timing within the while loop of the program. No I have not tried anything else. I just want to make sure of the sampling rate. I dont have a pre determined rate in mind, I just need to understand the sampling rate with the program built like this.

0 Kudos
Message 3 of 6
(3,422 Views)

For something basic, you could include the "time elapsed" express VI immediately after the Analog Read Pin VI (wire the error through both in-line so that the time elapsed is always calculated after the Arduino VI.

0 Kudos
Message 4 of 6
(3,422 Views)

Hi Nathan,

 

How can you set the sample rate by doing this? Or figure out the sample rate for that matter?

 

Regards,

 

Kristian

0 Kudos
Message 5 of 6
(3,256 Views)

The sample rate will be relatively slow and unreliable (unless you need it to be slow and you don't have many calls to the Arduino).  In general, you can control the timing of a loop with "Wait".  How fast do you need to sample the signal?

 

Also, LINX will be faster when reading simple signals like this and LIFA was replaced by LINX several years ago so I'd recommend you use that.

0 Kudos
Message 6 of 6
(3,242 Views)