beautypg.com

Opticon ECB 1000 User Manual

Page 12

background image

12

-

Opticon Ethernet Converter

2.4

Establishing a (virtual) RS232 connection over Ethernet

Using two Ethernet Converter boxes it is possible to establish a virtual RS232 connection over Ethernet to
transmit and receive serial data to and from a remote location as if it's connected to a very long serial cable.
Below it will be explained how it works and how it can be used.

2.4.1

Supported protocols

To transmit data over the Ethernet 2 different protocols can be used: UDP (port and TCP. They both have
advantages and disadvantages depending on reliability and maximum throughput.

When using UDP, no handshaking is used so data can be lost due to lost packages on the network. It is
possible to add an extra protocol like Xmodem, NetO or a simple handshaking mechanism to fix that problem.

When using TCP, handshaking is used, which makes the maximum throughput low, therefor data can be lost
due to buffer overflows since the serial throughput is faster than the TCP throughput over the Ethernet.

UDP

TCP

Maximum throughput (at 115200)

streaming (at 115200 BPS)

< 400 byte blocks with intervals

Handshaking

No

Yes

This means that if you use the virtual RS232 connection for:
§ Transmitting / receiving of small data packages (i.e. barcodes) TCP is more reliable.
§ Transmitting / receiving large quantities of data UDP is more reliable

Notes:
§ Serial over TCP uses port 31313, serial over UDP uses port 31314

2.4.2

Finding remote Ethernet Converters

To find other Ethernet Converter boxes the following AT-command is available

AT+DISCOVERY

Returns IP and MAC addresses of all Ethernet boxes that are connected to
the local Ethernet.

Example of the search result:

Searching...
192.168.0.2 00-12-6A-00-12-34 OSE_ETHERNETBOX
192.168.0.14 00-12-6A-00-00-12 OSE_ETHERNETBOX2
Done

2.4.3

Connecting to remote Ethernet Converters

To establish a virtual RS232 connection the following AT-commands are available:

UDP

ATDudp://xxx.xxx.xxx.xxxx
or
ATDudp://yy-yy-yy-yy-yy-yy

Where xxx.xxx.xxx.xxx is the IP address of the remote Ethernet box
or
Where yy-yy-yy-yy-yy-yy is the MAC address of the Ethernet box

TCP

ATDtcp://xxx.xxx.xxx.xxxx

or

ATDtcp://yy-yy-yy-yy-yy-yy

Where xxx.xxx.xxx.xxx is the IP address of the remote Ethernet box

or

Where yy-yy-yy-yy-yy-yy is the MAC address of the Ethernet box

If the connection was established the Ethernet box will respond with:

CONNECT xxx.xxx.xxx.xxx (where xxx is the IP-address)

Note:
§ Disconnect a connection by sending '+++' with a 1-second pause before and after the command.