LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Arduino Interface

Hello eveyone.

 

For a project Iam using an Arduino Mega and the Labview Interface for the Arduino.

I added a flowsensor to my project and added the Arduino code into the LIFA_BASE. 

 

The flow sensor is written with serial.print... Now Iam wondering how I can get this value into Labview.

It seems like there is no easy Serial.Read function...

 

Thanks for any help,

 

best regards,

 

Michael

 

 

0 Kudos
Message 1 of 4
(3,107 Views)

If you just need to read the data coming from the arduinos serial port to labview use the visa functions.  Visa read for your specefic needs.



-Matt
0 Kudos
Message 2 of 4
(3,100 Views)

Hi Michael,

 

As Matt said, if you look at the LIFA Examples [C:\Program Files (x86)\National Instruments\LabVIEW 20xx\vi.lib\LabVIEW Interface for Arduino\Utility] you'll see that within the subVI's it is just VISA Read being used.

 

There's quite a few other questions that are similar to this on the forums that might be useful to you.

 

I'd recommend looking at the Serial/RS-232 examples under Help>Find Examples to get an idea of how you use the VISA serial blocks. You'll have to configure the serial port to match the baud rate and termination character (if any).

 

Best regards,

 

Leah

 

0 Kudos
Message 3 of 4
(3,056 Views)

LIFA has long since been replaced by LINX

 

 https://www.labviewmakerhub.com/doku.php?id=libraries:linx:start

 

LabVIEW Maker Hub has lots of support dedicated just to LINX

 

But regardless reading serial data from an Arduino is no different than reading serial data from any other instrument. In fact it is easier because YOU get to decide what the serial protocol the Arduino will be using and how the data will be formatted, etc...

 

For best results make sure you program the Arduino to send a termination character and enable the termination character in the LabVIEW Configure Port vi and set VISA Reads to read more bytes than you expect to receive.

 

DON'T USE BYTES AT PORT! (ever)

 

Using VISA Read with Termination Character enabled will make VISA Read read until it receives a Term Char or times out. No need for bytes at port.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 4
(3,046 Views)