02-09-2017 04:38 PM - edited 02-09-2017 04:48 PM
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
02-09-2017 04:50 PM
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.
02-10-2017 08:13 AM
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
02-10-2017 10:20 AM - edited 02-10-2017 10:28 AM
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.