BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about Ethernet-RS232 adapters

Hey, hello Everyone, I hope all of You are fine in these days! 🙂

 

Just a quick question, might someone has experience with such device. Actually not a LV question, but a hardware one (the recent app is a C# one used).

So we used a USB-RS232 adapter for a couple of years to connect a PIC microcontroller to a Windows PC. Everything is fine, the following settings are used:

Spoiler
BaudRate = 921600,
Parity = Parity.None,
StopBits = StopBits.One,
DataBits = 8,
Handshake = Handshake.None,
ReadTimeout = 3000,
WriteTimeout = 3000,
ReadBufferSize = 128000

However, a request came that we need to replace the USB/RS232 adapter with a Ethernet/Rs232 one: Moxa nport 5110a

 

So far we could not get a reliable connection with this device. It works occasionally, but then randomly drops the RS232 connection between the PIC and the PC. Sometimes we get like "Character-buffer overrun error"s, but not always (actually we get this error rarely even with the USB adapter, but our error handling takes care of it).

 

Anyone knows any tricks or can give me hint how to setup this Moxa in order to make it work properly? 🙂

Thanks very much guys!

Have nice weekend! 🙂

0 Kudos
Message 1 of 8
(7,486 Views)

I have not worked with a Moxa one.  But the one I did use was a major PITA to get it to work properly.  Connections randomly dropped and therefore I lost the serial ports.  I am not a fan of Ethernet/RS-232 adapters after that experience.  I, personally, prefer using commercial grade USB adapters from StarTech.


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 8
(7,471 Views)

Thanks.

The problem is that we need a distance between the pic and the PC too large for serial cable. Also, we need to use the existing Ethernet network.

(we cannot put the used PC next to the PIC)

0 Kudos
Message 3 of 8
(7,466 Views)

In the past I've used a Lantronix device.

 

https://www.lantronix.com/products/uds1100-uds1100-poe/

 

You load up the software on Windows saying the IP address of the device, and then it becomes a virtual COM port you can talk to.  Works pretty well but I only ever used it for slow low speed environmental chamber control.  If there was a data loss I probably wouldn't know it.  I've also seen a few places where people made bridge like devices out of Raspberry Pis.  It ended up acting like a wireless serial port.

0 Kudos
Message 4 of 8
(7,441 Views)

Actually I realized that I try to use a screw driver as a hammer: instead of using the Moxa in "Real COM mode", I set it to "TCP server mode", and I create at my PC side a TCP Client. I only need to send a single "Start" command then I purely need to receive raw byte stream from the PIC with 1 MBaud. 

I hope this approach will bypass the Ethernet-->Virtual COM port software layer, and result in better stability and higher speed...

Lets see...

0 Kudos
Message 5 of 8
(7,433 Views)

It just works with the most simple TCP Client 🙂

0 Kudos
Message 6 of 8
(7,411 Views)

@Blokk wrote:

I hope this approach will bypass the Ethernet-->Virtual COM port software layer, and result in better stability and higher speed...

Lets see...


That's how I used Moxa's. Mainly because I want to allow my drivers to run on RT as well.

 

Another reason not to use "Bytes at port": apart from that function, it's usually a matter of changing the VISA resource. So drivers work transparently for RS232 and TCP\IP over a converter.

0 Kudos
Message 7 of 8
(7,287 Views)

I have not used the nPort at such a high baud rate (max 115200), but as others have mentioned here the virtual port driver is not optimal, so we mostly use it in TCP server mode...(The default timers in the virtual port setup are generally rubbish though, so there are some possibilities there as well (Originally we used TCP because the virtual driver was unable to recover from network failures).

If you do not have to use the network, and the main goal is to extend the range, you could perhaps convert the RS232 to RS485 instead though.

0 Kudos
Message 8 of 8
(7,094 Views)