LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS485 to RS232 VISA Serial

I am trying to get a Vi to function that is running off a EVAL - CN0359 unit. The unit measures conductivity and temperature and is RS485. 

I have an RS485 to USB converter, and when I prompt the EVAL with the correct command in tera term, I get a full response. 

- The baud rate is set correctly with the EVAL - 115200

-  I am using 8N2 for the rest of the settings, I believe the stop bits for this unit are 2 but I'm not entirely sure. I've been having a hard time finding that information. 

- The vi runs through everything but then gets to VISA READ and gives me the error- it looks like the program is looking for a response but is getting nothing back, so it times out.  

- I tested it on the VISA test panel, and I can write information with no error, but when I click read, i only get a short snippet of information back, even if I set bytes to read to some ridiculous number like 10000. 

 

Does anyone have any general guidance on what to change from a RS232 serial to get a RS485 serial vi to run properly? I am familiar with RS232 serial coms. 

 

Any input/direction or guidance is appreciated!!! 

0 Kudos
Message 1 of 5
(180 Views)

Why not to post the whole vi? (preferably in a LV version <= 2021) It's difficult to debug pictures. However, a few quick remarks:

- it's unlikely you need to set flow control other than 0 = none; probably your converter does an automatic send/receive management - but please check the device documentation

- if you are using \n as termination character, you don't need to wait between write and read

- I would clear the input buffer before writing

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 5
(131 Views)

Make sure that you are send a correct new line. 

Your current image does not show the correct information. 

 

dkfire_0-1714650142531.png

Make sure that the display code for your string is in the correct format when you enter \n or \r

Message 3 of 5
(124 Views)

Most serial communication issues can be solved by watching this video: VIWeek 2020/Proper way to communicate over serial

========================
=== Engineer Ambiguously ===
========================
Message 4 of 5
(90 Views)
Go for 8N1.
If the sensor is using 8N2 you are on the safe side.
If, on the contrary, it actually uses only 1 stop bit and you are set for 8N2, you'll always get a framing error.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
21st November 1905: E=mc² → and Physics would never be the same again...
0 Kudos
Message 5 of 5
(61 Views)