1. Field of Invention
The invention relates to a fieldbus gateway and the data transmission method thereof. In particular, the invention relates to a fieldbus gateway using a virtual serial fieldbus port and the data transmission method thereof.
2. Related Art
During the development of fieldbus, the industrial Ethernet-based fieldbus protocols, such as ProfiNet, Modbus TCP, and Ethernet/IP, are later than the serial-based fieldbus protocols, such as Profibus and Modbus RTU/ASCII. Moreover, the architecture of the industrial Ethernet-based fieldbus protocols is more complicated. Therefore, most of current supervisory control and data acquisition (SCADA) systems or human machine interfaces (HMI) only support serial-based fieldbus instead of Ethernet-based fieldbus. Or one has to pay extra fees in order to obtain the Ethernet-based fieldbus support. Users of the SCADA system and HMI can only use the serial fieldbus port to communicate with the controlled device. However, since most of current factory automation requires that the remote control center and factory operators could control the controlled device at the same time, the controlled device should be able to receive the controls of a remote SCADA system and a local HMI concurrently. However, the system only uses serial fieldbus communication is difficult to provide this function. Due to its physical properties, the serial fieldbus cannot transmit data over a long distance directly. Repeaters are always required for extending the transmission distance, but they also increase the cost of wiring.
To avoid the cost increasing on wiring, some factories use a fieldbus gateway at both the remote and local ends, respectively. The two fieldbus gateways communicate via an Ethernet. Although this reduces the cost on long-distance wiring, at least two fieldbus gateways are needed. To reduce the number of required gateways, some factories use a device server for the system only requires RS-232/RS-422/RS-485 based serial fieldbus communication. The COM port redirection technique used on a device server provides a low cost long distance transmission. As shown in FIG. 1, the remote SCADA system 101a uses the COM port redirection driver to generate a mapped virtual COM port, the COM port is mapped to a physical serial port on the local device server 700. That is, all operations on the mapped virtual COM port on the SCADA system would be transmitted via the network to the device server 700. Then the device server 700 does the same operations on the physical serial port. This makes the mapped virtual COM port works as a mapped interface of the physical serial port on the device server 700. For example, as the SCADA server 101a sets the RTS pin of the mapped COM port to output active signals, the RTS pin on the physical serial port of the device server 700 would output active signals. Then the CTS pin of the physical serial port of a programmable logic controller 301a (controlled device) connected with the physical serial port of the device server 700 receives the active signals. On the other hand, if the programmable logic controller 301a transmits data via its serial port to the physical serial port of the device server 700, then the device server 700 would forward the received data to the mapped COM port of the SCADA system 101a via the network. So the SCADA system 101a can concurrently receive the data from the programmable logic controller 301a (controlled device). Through this serial tunnel technology, the physical serial port of the local device server 700 is just like the real COM port of the remote SCADA system 101a, thereby connecting with the programmable logic controller 301a. 
Although the COM port redirection technique only needs one additional device server to extend the serial communication distance, the COM port redirection establish a dedicated tunnel between the physical serial port of the device server 700 and the mapped virtual COM port (interface) of the SCADA system 101a. Therefore, when using the COM port redirection technique, the physical serial port of the device server 700 could only be occupied by the established tunnel. The physical serial port of the device server only allows one SCADA system 101a (mapped virtual COM port) to communicate with and/or control over a programmable logic controller at a time. It can't work on the system requires the programmable logic controller 301a to be controlled by multiple remote/local control ends concurrently.
In summary, the prior art always has the problem that it is impossible for more than two remote devices to control the same controlled device via serial fieldbus at the same time. It is therefore imperative to provide a solution.