LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i send data from labview to arduino via VISA

Hello Everyone, 

 

I'm reading data(RS485) from a mass flow controller(by AALBORG Instruments) in labview via VISA. The data i'm reading is the mass flow. I want to send the received data .i.e mass flow from labView to Arduino board for displaying the data on an LCD. 

I'm attaching the VI in which i have used VISA Write to send the data( mass flow) to Arduino board. 

I'm unable to receive any data in my arduino. 

I'm receiving an error message on the serial monitor of the arduino( with respect to the arduino sketch i have written).

I'm also attaching the arduino sketch.

Any help would be really appreciated.

Thanks in advance

KB

Download All
0 Kudos
Message 1 of 5
(1,470 Views)

What is the protocol for reading the mass flow from your device?  From what I can gather from your VI, you really should NOT be using the Bytes At Port.  But we need to protocol to verify that.

 

On your Arduino side, you are only reading 1 byte at a time.  So that could cause issues.  Maybe you should use Serial.readStringUntil() to read a line at a time.  The other issue you have is your Arduino will easily read through all of the bytes before more comes in and that is when you are getting your "errors".  Instead of showing an error, add a wait.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(1,455 Views)

Hi,

 

The flow controller has an RS485 output which i'm using to set the set point and read the flow in labview. 

I want to send the received data in labview to the arduino where i will interface an LCD and display the same reading. 

I have tried using the Serial.readStringuntil() earlier and it still does not work. What is there that i can do? do i have to make any changes in the VI?

 

Thanks

KB

 

0 Kudos
Message 3 of 5
(1,402 Views)

"RS-485" only defines the hardware of the bus.  We need to know the format of the data being sent over the bus.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 5
(1,393 Views)

What hardware is talking to the flow controller? What hardware is talking to the arduino? Why is the arduino or the computer in the loop? The flow controller manual probably specifies the comm method required to send and pull your data/values.

 

Sounds like if the purpose is to read and write to the flow controller and display its value to an LCD then you only need one in the loop: the arduino or the PC running labview with the correct io module .... arduino sounds like the cheaper solution but really depends on the conditions/use cases/how reliable this system needs to be/how long this needs to be deployed for/etc... if you really want this system, id say check comm method for flow controller and arduino and match it... arduino has uart, spi, i2c, analog in, pwm out, digital io depending on which model.

0 Kudos
Message 5 of 5
(1,375 Views)