Подключаем последовательные интерфейсы по IP
Последовательные интерфейсы RS-232/422/485 до сих пор очень популярны в промышленности: по ним подключаются диагностические порты, датчики, сканеры штрих-кодов и RFID меток и т.д. Однако последовательные интерфейсы имеют свои ограничения. Иногда возникает необходимость получить доступ к такому интерфейсу по IP-сети, или, например, иметь доступ к одному устройству с RS-232 с нескольких удаленных компьютеров одновременно, или объединить несколько удаленных объектов в одну шину RS-485.
Сервер последовательных интерфейсов конвертирует последовательные физические протоколы в IP-пакеты, и позволяет программно управлять ими — подключать удаленный виртуальный COM-порт к компьютеру по сети так, будто он подключен физически, и прозрачно соединять несколько устройств в режиме P2P, без использования компьютеров.
В статье мы разберем сервер последовательных интерфейсов Advantech EKI-1524, имеющий четыре последовательный порта, каждый из которых поддерживает протоколы RS-232/422/485, и два LAN-порта.
Сервер последовательных интерфейсов EKI-1524 имеет четыре порта DB9 и два LAN-порта.
- Виртуальный COM-порт — позволяет программно эмулировать виртуальный COM-порт удаленного устройства на системе Linux.
- Одновременное подключение нескольких клиентов — в режиме сервера дает возможность использовать один последовательный порт для нескольких устройств одновременно.
- Работа в режиме P2P — одновременная работа в режиме клиента и сервера позволяет объединить несколько EKI-1524 напрямую, без использования серверов и компьютеров.
Характеристики
Дополнительно представлены модели с повышенным уровнем защищенности, для работы в экстремальных условиях, и гальванической развязкой портов, для защиты от высоких напряжений: EKI-1522I, EKI-1524I, и другие.
Все модели поддерживают подключение двух источников питания. Переключение между источниками питания происходит без перезагрузки устройства. Реле индикации обрыва питания замыкается в случае, если на одной из линий отсутствует напряжение.
Виртуальный COM-порт
Сервер последовательных интерфейсов позволяет по TCP/IP получить доступ к удаленным устройствам таким образом, что для прикладного ПО это будет выглядеть так, будто устройства подключены к физическому COM-порту.
Принцип работы виртуального COM-порта по сети Ethernet
Для этого на стороне клиента используется модуль ядра Linux и программа для обмена данными с сервером последовательных интерфейсов. В итоге для пользователя такое подключение выглядит как физический порт (устройство /dev/ttyADV0).
На данный момент Advantech выпускает драйвера виртуального COM-порта только для ОС Linux. Инструкция по сборке модуля ядра VCOM 2.0 на Ubuntu.
Также существуют бинарные пакеты драйвера под разные дистрибутивы: Linux Pseudo TTY
В веб-интерфейсе можно настроить параметры работы в данном режиме:
Дополнительные настройки. Можно вручную задать таймауты и т.д:
Настройки параметров последовательного интерфейса. В этом меню также можно изменить основной протокол (RS-232/422/485), для каждого порта.
Режим RFC 2217
Также доступен открытый протокол перенаправления COM-порта RFC 2217, представляющий собой расширенные команды для протокола Telnet. В этом режиме устройство принимает входящие подключения по TCP, в настройках можно указать порт для входящий соединений.
Режим P2P
Для сложных случаев, когда несколько устройств нельзя соединить напрямую, можно использовать два терминальных сервера в режиме прозрачного моста. Таким образом можно подключить удаленные устройства, используя в качестве транспорта TCP/IP.
Подключение двух удаленных устройств по последовательному протоколу через TCP/IP-транспорт
Таким образом можно программно переключать устройства между собой, соединять удаленные шины по RS-485 и делать много другое, используя все преимущества IP-сетей, включая радиомосты, виртуальные частные сети (VPN) и т.д. Передаваемые данные между двумя серверами можно дополнительно защитить от перехвата, используя шифрование на транспортном уровне.
Уведомления о событиях
Устройство позволяет настроить уведомления о событиях с помощью Email и SNMP Trap. MIB-файл для настройки SNMP-сервера доступен для каждого устройства.
События для уведомлений можно настроить вручную.
Логирование через Syslog
В веб-интерфейсе можно задать адрес удаленного Syslog-сервера для логирования. В лог записываются события подключения клиентов, ошибки аутентификации, статус LAN и последовательных портов и т.д.
Первичная настройка
Первичную конфигурацию сервера последовательных интерфейсов можно выполнить через утилиту EKI Device Configuration Utility. При этом утилита работает через ARP-пакеты и не требует настройки соответствующего IP-адреса на сетевом интерфейсе. Это значит, что можно задать любой IP-адрес устройству, без утраты доступа.
Заключение
Серверы последовательных интерфейсов позволяют обходить ограничения, которые накладывают физические протоколы, и легко масштабировать подключения. Режим P2P позволяет подключать устаревшие устройства, используя интернет в качестве транспорта, при этом обходиться без серверов.
Источник
Advanced Virtual COM Port
Advanced Virtual COM Port is a professional serial communications utility, which combines network and local virtual serial port functions into one.
Windows CE and Windows Mobile vesion available! Read more.
It gives you the ability to:
- Create virtual serial ports and connect them with a virtual null-modem cable over a LAN or the Internet
- Share your real (physical) serial ports over the LAN and Internet
- Create a pairs of local virtual serial ports connected with a virtual null-modem cable
Screenshot
One of the many uses for Advanced Virtual COM Port is to allow software that only supports serial port communications, to join the Internet community and communicate not only with computers that are close by, but also with ones on the other side of the world! This is done by emulating a null-modem cable over a network.
Another use of Advanced Virtual COM Port is to share any of your serial devices, whether it is a bar code scanner, modem, sensor, oscilloscope, laboratory or industrial instrument, etc. over a LAN or the Internet. There is no need to move this equipment here and there, just connect it to a server computer, create a Shared COM Port, and anyone with installed Advanced Virtual COM Port will be able to use this equipment remotely as if it were connected to his/her computer.
And finally, Advanced Virtual COM Port allows you to create pairs of virtual serial ports locally connected using a virtual null-modem cable. There is no need to have real cables or serial ports. This function is designed to speed up developing and debugging of applications. You can debug your software that uses COM ports for communication with hand-held computers, data acquisition equipment, etc. You can even develop your own device emulator and connect it to your software through a pair of virtual COM ports.
Features
- Virtual COM ports appear to the system and applications like real ones
- Virtual COM ports work like real ones
- Hot Virtual COM Port creation and removal, without having to reboot your computer
- Once created, virtual ports persist in the system until you remove them
- Works as a service, the ports will function even when no user is logged in
- No need to have physical serial ports (except for physical ports sharing function)
- Higher data transfer rate than on hardware serial ports
- Up to 255 virtual COM ports can be created
- PnP, WMI support
- VMWare compatible
- Flow control emulation support
- Easy port state monitoring
- Ability to temporarily remove all ports without losing their configuration
System Requirements
Administrator privileges required to install or uninstall Advanced Virtual COM Port.
Источник
Виртуальный COM порт. Шлём из COM1 в COM2 и в проект ISIS
Виртуальный COM порт пригодиться тем, кто хочеть отладить программу на компьютере на котором один или вовсе нет COM портов.
Для создания вам понадобиться Windows (В linux можете просто в файл писать данные, всё ведь файл), терминальная программа и Virtual Serial Port Driver от Etima.
Штука это хорошая но, платная. Предлагают демо версию, которую можно бесплатно использовать аж две недели.
Итак по ссылке выше качем и устанавливаем exe`шник.
По окончании установки запускаем и видим окно, где нам предлагают добавить пару виртуальных портов:
Жмём по кнопке Add pair. На этом настройка окончена. На сайтике где качали драйвер можно сдуть и терминальную програмку: Advanced Serial Port Terminal. Довольно удобная, но тоже платная.
Можно пользоваться стандартной виндовской, но она мне не нравиться.
На этом этапе можно отправить данные из одного COM порта в другой, открыв две терминальные программы и подсоеденившись к добавленной паре портов.
Всё это очень удобно использовать с ещё одной платной программой (какойто сегодоня день такой) – ISIS, которая входит в состав Proteus. Думаю вы с ней уже знакомы.
Схему изобретать мы не будем. Просто добавим COM порт и терминал.
У элемента COMPIM устанавливаем настройки:
Настройки конечноже не обязательно такиеже, просто чтобы совпадали тут и в терминальной программе. Ато будем слать и читать с разной скоростью.
На этом собственно всё. Запускаем симуляцию в ISIS Proteus. И конектимся к парному виртуальному COM порту терминальной программой.
Источник
The Best 7 Virtual Serial Port Emulators for Windows
Nowadays engineers who are developing these serial devices or applications that interact with them require the ability to test and debug their products before releasing them to the public. This can be problematic with current computers as there may not be serial ports available on the machine. Serial port emulation might be just the answer you are looking for if you in this kind of situation.
Best 7 Virtual Serial Port applications
Virtual Serial Port Driver [Eltima Software]
Virtual COM Port Emulator
Virtual Serial Port Driver
Features list:
- An OEM License brings you a Dynamic Link Library with VSPD that enables you to use your own applications to directly control virtual serial ports.
OS supported:
This Virtual Null-modem Software runs on Windows (32-bit and 64-bit): 7/8/10, Windows Server 2012/2016/2019
You can download Virtual Serial Port Emulator for a fully-functional 14-day free trial. The standard version of the software costs $139.95.
Virtual Serial Port Driver PRO — advanced functionality
Virtual COM Port Driver PRO
Virtual Serial Port Driver PRO
Features list:
- The ability to split one physical or virtual serial port into multiple virtual RS232 ports.
OS supported:
Like the standard version of Virtual Serial Port Driver, the Pro edition runs on Windows (32-bit and 64-bit): 7/8/10, Windows Server 2012/2016/2019
The Virtual Serial Port Driver PRO license would cost $199.95.
Virtual Serial Port Kit [FabulaTech]
FabulaTech’s Virtual Serial Port Kit is a software tool that enables you to emulate serial ports. These RS232 virtual ports that are created can be connected with a virtual null-modem cable.
Features list:
- The functionality of the virtual COM interfaces is identical to that of a physical serial port.
Virtual Serial Port Kit is supported by Windows Server 2003, Windows Server 2008 and 2008 R2, Windows Server 2012 and 2012 R2, Windows Vista, Windows 7, Windows 8 and 8.1, Windows 10.
You can get a one year license for $129.95.
Virtual Serial Ports [HHD Software]
The solution offered by HHD — Free Virtual Serial Ports is focused on the emulation of custom plug-and-play serial and I/O ports interfaced by 16550 UART.
- This free virtual null-modem emulator software allows the creation of a virtual copy of hardware null-modem cables with either DB-25 or DE-9 connectors.
OS supported:
This utility supported by Windows Vista, Windows Server 2008 and 2008 R2, Windows 7, Windows Server 2012 and 2012 R2, Windows 8, Windows 8.1, Windows Server 2016, Windows 10.
Virtual Serial Port Emulator [Eterlogic]
The next entry in our list of virtual COM port software is Virtual Serial Ports Emulator which is developed by Eterlogic.
- It is designed for software engineers that need to develop serial applications and allows them to create, test and debug applications and devices that employ serial interfaces.
OS supported:
This program offers support for Windows OS. A free license is available for 32-bit platforms. If you require the 64-bit version you will need to obtain a paid version of the software.
The price of the paid version for Virtual Serial Ports Emulator starts from $24.95.
COM Port Data Emulator
COM Port Data Emulator is a software application that enables users to emulate an entity, such as an Ethernet device or COM port, that transmits data as a serial stream. The program takes the data stream and converts it to data packets using serial protocols like RS232, TCP/IP or UDP. Then it forwards the packets over the network.
This serial port emulator can randomly generate test data or read it from text or binary files. The data can then be sent to test a port as many times as necessary to achieve the desired results. The app can fill the role of a server or client over an IP-based network. It supports full-duplex mode as well as flow control for serial and RS232 ports.
Logging capabilities featured in the COM port emulator make it possible to fully analyze serial data traffic and the ports’ responses to specific data streams. Network administrators can use the tool to identify errors and monitor line status dynamically. COM port simulator provides the ability to control the parameters of serial communication tests by using the baud rates, data bits, parity types, and other options as needed by the programmer.
You can perform serial port emulation with any serial devices that use the RS232/RS485/RS422 protocols. This includes a wide range of industrial controllers and monitoring devices. You can even use z-modem cables and emulate serial data transmission to another computer.
- Universal compatibility. Emulate COM ports as well as TCP/IP, UDP, RS232 and RS485 ports. You will need a converter if working with RS485 interfaces.
This Virtual COM Port freeware tool supports the Windows operating system from Windows 2000 to the current version of Windows 10.
Null-modem emulator [com0com]
This solution is an open-source kernel-mode virtual serial port driver that enables the emulation of serial communication interfaces.
- A COM interface can be created with this program that works with device emulation applications. Essentially, this means that you can connect a device emulation app to one end of a serial port pair while the other end of the pair is occupied by a Windows application that requires communication with the device. An example of this in practice is sharing faxes over an IP network. You simply connect a Windows Fax application to a modem using a pair of virtual serial ports.
More details of these software solutions are available by visiting the developers’ website. There are definitely differences among the options including the fact that some of them are free while others require a financial investment. In certain cases, you may need to expose your source code in order to use them for application development.
This Virtual COM Port freeware is developed for Windows users. But not all of the solutions support the newest Windows OS version which may pose problems for you.
How to create virtual COM port with VSPD?
How to choose the best solution for your needs?
Choosing the handiest and suitable software solution depends on areas and conditions of usage. Here are a few situations where virtual serial ports can be useful.
The absence of a serial port.
Many of the computers that manufactured today are not equipped with any serial ports at all. Some machines take it a step further and do not have ports of any type, relying on wireless connectivity to peripheral devices.
The reduction in reliance on COM ports in machines and devices used for general purposes has not eliminated the requirement for serial connectivity. Many special-purpose devices still make use of serial interfaces to communicate with computers. Some examples are industrial automation monitoring devices, medical monitoring equipment, and specialized laboratory equipment.
Sharing a serial monitoring device.
If you have a serial monitoring device in an industrial production facility, it may be transmitting data used as input for several different applications. Creating virtual serial ports from a single port lets all of your applications receive their data at the same time.
Accessing multiple serial devices.
Network-attached serial devices can be assigned virtual RS232 ports that can then be merged into a single virtual port that can be used by your application.
So on these occasions, the best choice is virtual serial port emulator software. A benefit of a paid solution is that you receive regular program updates and customer support for your money. This can be a determining factor if you are doing serious development and want the most up-to-date null-modem emulator application available.
The preceding comparison of virtual null-modem software tools indicates that Eltima Software’s Virtual Serial Port Driver offers more features than the other solutions. Ease of use, quality customer support, and a focus on data protection are some of the advantages of this product. It also features a user-friendly interface that makes it an easy task to create and delete virtual COM ports.
The extended capabilities of the PRO version make this flexible software application an effective and powerful tool for developers or users who need to work with serial devices.
These are just a few ways that virtual ports can be used. If you work with serial devices or applications, a serial port emulator like Virtual Serial Port Driver can be an essential component of your software toolbox.
Источник