LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

combine Arduino and sound card in Labview

Hi,

I have a project that needs me to acquire signals by Arduino Uno and PC sound card. I have tested them and both of them work well separately. But when I want to put the two programs into one program, an error happens. It shows 

1.png

 

I don't know what's wrong and can't solve it. Can anybody help me?

Here is my file.

0 Kudos
Message 1 of 5
(2,269 Views)

LIFA has long since been deprecated and replaced with LINX

 

Since I do not have LIFA (or LINX) installed in LV2018 I disabled that part of your code and the ran the sound card capture section of your code by itself, and it runs fine for me.

 

Try replacing your LIFA code with LINX and see if it makes a difference.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 5
(2,242 Views)

Thank you for your advice, but my supervisor asked me to use LIFA instead of LINX. So I have to do it only using LIFA.

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

Try separating the Arduino code and the audio code into two separate loops. You mentioned both bits of code work on their own, so my best guess is that the sound card isn't being read fast enough, probably because the Arduino portion of code is running too slowly for the sound input read VI.

 

You could also try increasing the number of samples/ch when setting up the sound device (say 10k, 50k, or 100k), but I'd start with the separate loops first.




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 4 of 5
(2,217 Views)

Thank you for your advice! I have tried your method and found only if using the sampling frequency for both Arduino and sound card can work.

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