1. Field of the Invention
The present invention generally relates to a virtual COM port for remote I/O controller, and more particularly to a virtual COM port for remote I/O controller comprising a virtual COM port capable of receiving and converting commands or data transmitted from the host end or the remote I/O controller into the acceptable format for the remote I/O controller or the host end and then transmitting it to the remote I/O controller or the host end for processing.
2. Description of the Related Art
The Internet has changed the peoples' life style, the operation and development of business. The great demand of the Internet for commercial purpose advantageously reduces wiring costs because one network cable may be used to connect hundreds of thousands or millions electronic elements (components) and thereby replace the conventional transmission method of connecting few hundreds of transmission wires side by side. Thus, overall costs on wiring and the space occupation for wiring can be reduced. Furthermore, even the elements for connecting to the network are taken as the objects would increase or deleted by the software. When the elements break down, the control end receives a message through the network displayed on the monitor. Therefore, the commercial network is the very essential tool for today's economy.
However, the general control system uses a host end to connect one or plural remote I/O controllers through the network, thus the programmer may program and use the host end to issue commands to the element connected to the remote I/O controller in order to control the element or to transmit data. The remote I/O controller provides an environmental interface as the communication standard with the host end so that when the programmer develops an appliance program, the command of the environmental interface may be used to design a program to control the remote I/O controller to enable the remote I/O controller to execute the command transmitted from the host end. However, the environmental interface provided by the general remote I/O controller mostly are technical and systematic, for example, the elements of the dynamic link library (DLL) and the ActiveX, the new technology, programmed by Microsoft, enable the software to be developed in any language operable with each other. These two environment interfaces require the programmer with good knowledge about the system for programming purposes, which provides substantial inconvenience to the programmer.
Furthermore, the programmer has to be very careful while using the DLL as the program can be overloaded for execution only when needed. In other words, when the program is not running, the system source must be released; the programmer also has to understand the detail description and the command procedure of each application program interface (API). Nevertheless, practically, the system source is often being wasted due to the ignorance of the programmer and this may also render system unstable.
The programmer need not execute loading and releasing for using ActiveX elements but need to install and register the element before using it, and it is not significantly different from the DLL.
Therefore, to enable the programmer to easily use the environmental interface of the remote I/O controller to design the program is an important issue for the manufacturers in the field.
Accordingly, in the view of the foregoing, the present inventor makes a detailed study of related art to evaluate and consider, and uses years of accumulated experience in this field, and through several experiments, to create a virtual COM port for remote I/O controller.
According to an aspect of the present invention, the virtual COM port receives the command or data from the host end or the remote I/O controller, and converts the received command or data into an acceptable format for the remote I/O controller or the host end and then is transmitted to the remote I/O controller or the host end for processing. Thus, time of designing is reduced and the system stability is increased, and the overall cost is reduced as well.
According to an embodiment of the present invention, the virtual COM port for remote I/O controller comprises a host end with an operating system, a user program and a virtual COM port. The operating system comprises a COM port interface. The virtual COM port is adopted for connecting to a remote I/O controller interface of a remote I/O controller through a network, and the virtual COM port is adopted for receiving command or data from the host end or the remote I/O controller, and for converting received command or data into the acceptable format for the remote I/O controller or the host end and then transmitting to the remote I/O controller and the host end for processing an thereby enabling the programmer or the user to use a conventional COM port interface to avoid error occurred due to programmer or user not being familiar with the remote I/O controller interface. Thus, the time of designing is reduced and the system stability is increased, and also the overall cost is reduced.
For a more complete understanding of the present invention, reference will now be made to the following detailed description of preferred embodiments taken in conjunction with the following accompanying drawings.
Referring to
The operating system 111 comprises a COM port interface 111.
The user program 12 comprises software and related programs designed according to the user's requirement to accept command and control methods of the COM port interface 111.
The virtual COM port 13 is not a physical COM port and is a port built by the programmer to execute the command of the COM port interface 111. The virtual COM port 13 is connected to the remote I/O controller interface 31 of a remote I/O controller 3 through a network 2.
When the user executes the user program 12 designed by the programmer, the user program 12 transmits the command of the COM port interface 111 to the remote I/O controller interface 31 of the remote I/O controller 3 through the virtual COM port 13 and the network 2. During the transmission, the virtual COM port 13 converts the command into an acceptable format for the remote I/O controller interface 31 upon receiving the command and then transmits it to the remote I/O controller interface 31 for processing through the network 2. Furthermore, if the remote I/O controller 3 transmits the processing result back to the host end 1, the remote I/O controller 3 transmits data or command through the remote I/O controller interface 31 and the network 2 to the virtual COM port 13 of the host end 1. The virtual COM port 13 further converts the received command or data into the acceptable format for the COM port interface 111, and then transmits it to the COM port interface 111 for processing.
According to the above description, the command and the control methods of the COM port interface 111 may be used by the programmer to design or to amend the user program 12. Thus, the difficulty of designing and using the remote I/O controller interface 31 of the remote I/O controller 3 that the programmer or the user is unfamiliar with can be resolved and error due to such problems that would render the system unstable can be effectively reduced.
The COM port interface 111 is an essential component of operating system 11, and the host end 1 and the most of the peripheral elements connected to the host end 1 use the COM port interface 111. Therefore, most of the programmers and users are quite familiar with the operation of the COM port interface 111. Thus, by converting the command or data using the virtual COM port 13, it is possible to use the familiar COM port interface 111 to serve as a communication interface between the remote I/O controller 3 and the host end 1 so that error due to programmer or user is not being familiar with the COM port interface 111 may be effectively reduced. The programming time can be effectively reduced and the system stability can be effectively increased. Thus, the overall cost can be effectively reduced.
The operating system 11 may be comprised of Windows or Linux, and the COM port interface 111 in Linux is called TTY interface. Although the name is different from the COM port interface 111, but the commands, the control methods and the functions are all identical. Therefore, the COM port interface 111 and the TTY interface are both included within the scope of the present invention.
Additionally, the network 2 may be comprised of TCP/IP, Ethernet or Wireless LAN. The remote I/O controller 3 may be comprised of electronic switch or the analog sensor. The host end 1 may be a personal computer or an industrial computer.
As shown in
According to the important aspect of the present invention, the command or data is converted into an acceptable format for the COM port interface 111 in the host end 1 or the remote I/O controller interface 31 connected to the network 2 so that the COM port interface 111 may effectively serve as a communication interface between the host end 1 and the remote I/O controller 3.
While the invention has been described in conjunction with a specific best mode, it is to be understood that many alternatives, modifications, and variations will be apparent to those skilled in the art in light of the foregoing description. Accordingly, it is intended to embrace all such alternatives, modifications, and variations in which fall within the spirit and scope of the included claims. All matters set forth herein or shown in the accompanying drawings are to be interpreted in an illustrative and non-limiting sense.