Bruno HÉNON - Automation & Control Engineer Freelance Services in factory automation, designing, programming, installing and subcontracting worldwide

Virtual serial port communication over Ethernet.

Virtual serial ports
 

  Automation > Resource > Technology > Communication > Virtual serial port  

  Hart modem technology basics

Computer vision networks  

VIRTUAL SERIAL PORT TECHNOLOGY BASICS

A driver to emulate physical interface , Exchanges of data with a remote serial port, Virtual serial port client, Virtual serial port server, Devices with virtual serial port server, Virtual port client drivers for Microsoft systems, Virtual port client under Linux, Virtual port client within a virtual machine.

A Software Driver To Emulate And To Redirect Serial Port

A « virtual serial port » is a software function ( a driver indeed ) emulating a hardware serial port, and used to exchange data in the respect of some serial communication protocol, in order to redirect these data towards a terminal using another data transmission technology. According to the automation field, this functionality can be useful when the virtual serial port redirects the data through an Ethernet port.


A virtual serial port can be used as a communication interface when :

Exchanging Data With A Remote Serial Connection Over Ethernet
Diagnostic software running into a PC with a RS 232 HART modem to interface locally an Optiflex 1300c HART sensor.

To illustrate this, let's take as an example a software used to diagnose a measurement device, which can connect by using a RS232 line only in order to access data into a « time domain reflectometry » ( TDR ) radar level sensor, such as the « Optiflex 1300C » HART sensor from the « Krohne » company ( what imposes to install a HART modem as a communication interface with the sensor ).

Maintenance PC in Sweden communicating with HART sensor in New Zealand with RS 232 remote connection and with virtual serial port over Ethernet.

Let's take as an hypothesis you are operating at a client's office in Sweden ( Hallå, hallå ! ), and that you wish to establish the diagnostic of a remote sensor located on a site of our friends Maori ( Kia ora, kia ora ! ) in New Zealand, near Auckland.

It is not reasonable to want to interconnect the devices by installing a RS 232 line or an USB line of about 20 000 kms length.


Virtual serial port client and virtual serial port server over IP between a diagnostic software and a remote sensor, with HART modem, level sensor and ADSL modem.

One available solution can be using the services of virtual serial ports :

Each station contains an ADSL modem, a GPRS modem, a satellite communication modem or any other Ethernet compliant modem. The data will be transmitted over an Ethernet network, and in this case probably via Internet.


One of the benefits we can get from the usage of virtual serial port over Ethernet is that since the communication is entirely digital, it is very stable and very robust according to the electromagnetic perturbations.

Virtual Serial Port CLIENT Over IP
Virtual serial port client over Ethernet.

This virtual port is client according to the data, that is it will initiate requests and it will send commands ( reading requests, writing requests or sending orders for instance ).

Configuration

Operating description

Virtual Serial Port SERVER Over IP
Virtual serial port server over Ethernet connected to a HART modem and to a HART sensor.

This virtual serial port is server according to the data, that is it will serve the data answering the requests initiated by the client.

Configuration.

Operating description

Devices Providing Virtual Serial Port SERVER Services
ADSL modem or Ethernet switch including a virtual serial port server connected to a RS232 port.

Whether none automation application is required ( no more than any other programmed application ), a cheaper solution to install a «virtual serial port server» is to get an Ethernet switch, an Ethernet router or an Ethernet compliant modem ( ADSL, satellite etc ) providing this service and including a hardware serial port ( RS 232 or USB for instance ).

In this case, the device drives the data from the external Ethernet port towards the internal Ethernet port Nr 'm' ( the Ethernet interface of the virtual serial port ) when the Ethernet port Nr 'm' is the required destination, and it drives the data out through a local port whether the required address is not the 'm' port.

Reciprocally, when the virtual serial port receives data on its serial interface, it drives the data through the Ethernet 'm' port, and then to the external Ethernet port.


About the commercial programmable controllers, the eWon PLC provides the virtual serial port server capabilities in association with hardware RS232 port, for instance.


About the open source programmable controllers operating under Linux like « Proview », or any other device using this OS, it is enough to operate a only software solution by using the different tools provided by the operating system.

With Linux, different techniques can be used to implement a virtual serial port server : by using various flow redirecting commands, terminal configuration commands, piped commands, or / and programming in 'C' language, according to what is needed.

Virtual Serial Port CLIENT Drivers For Microsoft Systems

Below is a list of some free drivers operating well when virtualizing serial ports for Microsoft operating systems. You will find very few solutions completely free into the market : most of these solutions offer at last one serial port operating without getting a licence, which could increase considerably the costs for a large installation.



Fortunately, there is at least one economical solution with great performance to implement virtual serial ports as clients for any proprietary operating system, without any limitations nor any over cost.

Virtual Serial Port CLIENT Under Linux

The Linux operating system offers many way in order to manage the data of virtual serial ports, freely, without any limitations and safely, by using robust methods. Here, you will find at least two one's, very quickly.


Redirection of the Ethernet data flow towards / forwards serial data flow by using the redirection and « pipe » Linux commands ( '|' ) between each communication port.


Call of the extremely powerful and high performing « socat » command.

« socat » is a Linux utility software which creates two bidirectional data flows and transfers the data between each other ( under Linux, data flow means data transfer to / from a communication port, a file or any other component ).

Thus, this command allows to communicate with remote devices whatever the data flows taken in consideration.

Last but not least, by using this command, it is easy to manage all that through a virtual private network ( VPN ) and SSH.

http://www.dest-unreach.org/socat/

Virtual Serial Port CLIENT With A Virtual Machine
The socat command manages the virtual client serial port over a Linux machine ( acting as an interface between Ethernet IP and RS 232), the Linux virtual serial port is linked to a RS 232 port of a virtual machine hosting a proprietary system which operates a diagnostic software.

To avoid the limitations and the costs due to the usage of software ( diagnostics, data treatment or any else ) operating under a proprietary system, one potential solution is to implement the virtual serial ports under a Linux machine where a virtual machine ( Virtual Box, VMware etc … ) has been installed in. This virtual machine will host the proprietary operating system and the associated software.

So, the amount of client serial ports will only be limited by the capabilities of the operating system hosted in the virtual machine, and by the features of the software used to treat the data.

If you opt to use a VPN for security and for safety reasons, you will get a completely virtual system, with a virtual private network, virtual serial ports and virtual machines !


Share this page :

 


© www.bh-automation.fr