LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

myRIO UART

Solved!
Go to solution

Hey guys,

 

I have a RS232 interface from the Sensirion AFS1430 sensor. Now I try to communicate with it with the following code:

UART.png

 

The problem is, that I don't get any response at all. Bytes at port is always = 0. One Warning I get in the while loop:

VISA:  (Hex 0x3FFF0006) The number of bytes transferred is equal to the requested input count. More data might be available.

 

I also tried changing "line feed" to "carriage return" still the same result.

Using an oscilloscope, I can see that what I am writing is sent via TX but nothing is happening on the port during the while loop (TX is high all the time).

 

I am getting a little bit frustrated...

 

kind regards

 

Slev1n

 

 

0 Kudos
Message 1 of 4
(4,866 Views)

Hi Slevin

 

when you use a TermChar you should NEVER use BytesAtPort!

On LF vs CR: The manual of your device should state which TermChar is to be used…

 

The number of bytes transferred is equal to the requested input count.

You request to read zero bytes and you get zero bytes…

 

After googling a datasheet of the AFS1400 I guess you should read page 9 and try a different baud rate…

(It seems both LF and CR are accepted as TermChar.)

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(4,861 Views)
Solution
Accepted by topic author Slev1n

More importantly - do you have a line driver/transceiver connected to your myRIO? The UART pins on the myRIO are not at RS-232 levels - they are 3.3V (5V tolerant). If your flowmeter is RS-232 - it's signal levels could be anything up to +/-15V - you're risking damaging the pins on your myRIO - you need to put a line transceiver to convert the RS-232 level signals down to 3.3V.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 3 of 4
(4,813 Views)

I am not totally sure, but you are right, the signals are not +-15V but still out of the range of the myRIO digital Rx Tx ports. I will add a line transceiver and try it again.

 

Thanks in advance 🙂

0 Kudos
Message 4 of 4
(4,791 Views)