LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FFT the signal which read from analog pin through Arduino

Solved!
Go to solution

I don't know.  I'm talking about whatever code is actually running on the Arduino that reads the pin and transmits the data to LabVIEW.  That is the code that determines at what rate the analog signal is being read.  If it isn't acquiring data at 1 kHz, then that would explain your problem.

0 Kudos
Message 21 of 36
(2,284 Views)

@holucbme wrote:

Arduino code??? You mean the LIFA_Base? I only process the signal in Labview, sir. Where can I find it in the firmware of arduino?


Post your all of LabVIEW code including the part that is using LIFA or LINX with the Arduino.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 22 of 36
(2,281 Views)

Here is the code I use the LIFA,

 

Attached is the .txt file, please read it and help me to figure out my problem. 

 

Thank you in advance, two knights.12.JPG

0 Kudos
Message 23 of 36
(2,265 Views)

Do you know how long it takes for the two serial writes to occur?

 

If you delay for 1000 microseconds, but the the actual time to write to the Arduino's serial port is longer than zero, then the actual loop iteration time is going to be the sum of the delaytime, the time to do the serial writes, and also any other loop overhead time.

0 Kudos
Message 24 of 36
(2,259 Views)

I dont know, where can I find it?

 

The code in firmware is original, I have not fixed it. As you said, Should I delete that code line (no delay 1000 us) or change the delay time? 

0 Kudos
Message 25 of 36
(2,245 Views)

I haven't used an Arduino, so I don't know what programming options are available to you.  I can assume they have something that can measure the time before and after some lines of code, kind of like the "tick count" function in LabVIEW.  Perhaps there is a "wait until" function that will allow the code to wait at until a certain timer value has occurred.

 

I think you will need to look around for more Arduino examples for code that is designed for repeated timing of doing something like reading a pin rather than the essentially software timing you are doing now.

0 Kudos
Message 26 of 36
(2,243 Views)

Thank you so much, RavensFan. 

0 Kudos
Message 27 of 36
(2,245 Views)

@holucbme wrote:

Here is the code I use the LIFA,

 

Attached is the .txt file, please read it and help me to figure out my problem. 

 

Thank you in advance, two knights.12.JPG


That is LIFA? Looks like Arduino code to me...

 

You really need to forget LIFA and use LINX.

 

Using LINX the code on the Arduino basically turns it into a USB DAQ simmilar to a NI USB-6009. 

 

Then it's all LabVIEW with a LINX pallette for the Arduino.

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 28 of 36
(2,234 Views)

Sorry sir, I dont have the DAQ devices. I know if using that devices, The spectrum is perfect (no need to use the ADC function)

 

But I will try to change LIFA to LINX. Thanks all.

0 Kudos
Message 29 of 36
(2,216 Views)
Solution
Accepted by topic author lucbk

@holucbme wrote:

Sorry sir, I dont have the DAQ devices. I know if using that devices, The spectrum is perfect (no need to use the ADC function)

 

But I will try to change LIFA to LINX. Thanks all.


I am sorry I do not know what you are talking about. I only mentioned the USN-6009 as an example of a device that has similar functionality to an Ardunio programmed with LINX. 

 

The point I was trying to make is using LINX you do NOT program any Arduino code into the Arduino.

 

You load the LINX "firmware" onto the Arduino and nothing else.

 

Once you have the Arduino programmed with LINX 'firmware" you write all your code in LabVIEW and the Arduino basically becomes a USB DAQ device in a sense because now the Arduino can not run stand alone, it must be connected to a computer running LabVIEW or a LabVIEW compiled executable.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 30 of 36
(2,208 Views)