The most popular PLC Remote Communication System B

2022-07-24
  • Detail

Design of PLC Remote Communication System Based on modem and VB

Abstract: taking a typical remote communication project as an example, this paper introduces the design of remote communication system based on line and the details of software and hardware

Keywords: remote communication modem PLC vb6.0

abstract::this paper takes a typical remote communication project as an example, and introduces the realization of the software and hardware in the remote communication system based on telephone line in detail,

key words: remote communication modem PLC vb6.0

1 introduction

with the development of computer and communication technology, Remote communication is widely needed in industrial measurement and control. Remote PLC and other subordinate computers do production control, and the local computer needs to monitor or participate in the control of production site parameters in real time. A simple way to realize the above requirements is to use the public with wide coverage, so that the PLC and other lower computers can use the modem to connect and communicate with the computer's modem to complete the hardware connection. As shown in Figure 1. In the aspect of software, it consists of two parts: remote lower computer software control and remote monitoring station software. Considering that the local monitoring station software is only used for data monitoring or a little control such as 0 °, 90 ° or 45 ° and the programming is relatively simple, the programming software of the local monitoring station can directly use high-level language

2 system overview

taking a practical sluice gate program control project of a small hydropower station as an example, this paper focuses on the implementation details of remote communication between Yonghong PLC and PC. The lower computer of the system has good reliability. FBS series PLC of Yonghong company is used to detect and control the opening of the reservoir sluice gate. The interface programming of the monitoring station is written in VB6.0

hardware configuration: remote fbs-cb25+ fbs-10mau + eCom external modem + pws1711

local PC (including ordinary built-in modem)

the main control requirements of the system are to detect the position of the gate through fbs-10ma external rotary encoder, and then control the forward and reverse rotation of the motor of the traction gate according to the site man-machine interface or the set position of the PC end (5km downstream), so as to make the gate rise or fall to the specified position. The communication port 2 (RS485) extended by fbs-cb25 is used for the communication of pws1711, and the communication port 1 (RS232) is used to connect the modem. In addition, the USB port on the host is used to connect the notebook computer for debugging

Figure 1 system composition

3 modem working mode and setting

3.1 modem working principle

modem is divided into two modes, command mode and online mode. When the modem is not connected to other devices, it is in command mode. At this time, the command given to the modem is used for setting or action of the modem itself. When the modem is connected to other devices, the modem is in the online mode, and all messages sent by the computer to the modem will be transmitted to other devices via the line

the specific instruction set used to control the modem is called "at instruction set". Through this instruction set, from the most basic volume control to the change of built-in parameter settings, VB can issue control instructions to the modem through the serial port. At command set is the industry standard for modem communication interface. All at commands begin with the character at as a prefix. The prefix at is used to attract the attention of the modem, detect the signal rate sent by the computer serial communication port, and identify the character format, including the character length and parity setting

after the modem dials, wait for the carrier signal sent by the other modem. If no carrier is detected within a given time, the modem will automatically release the line and send back the result code nocarrier. If a carrier signal is detected, the modem will send the result code connect + baud rate and enter the online state to communicate with the remote system

3.2 principle of PLC connecting modem and its settings

in this system, PC, as the master station, must control the modem to dial actively. In addition, after confirming that the modem and PLC modem are connected successfully, control it to enter the online mode and start accessing PLC data. See the following section for details of dial-up connection of master station control modem. Here, the setting method of PLC terminal to modem is described in detail

the modem must be initialized after the PLC at the PLC end is powered on and set to the status of automatic answering incoming calls. Here, the at instruction combination of PLC initializing modem is called "mode m driver to meet them". Yonghong PLC controls the modem through port1, and calls this software interface the special interface for modems. As shown in Figure 2, setting or setting the upper eight bits of the special register r4149 to 55h can set port1 as the special interface for modems. Under this interface, the PLC will enable the "modem driver". At this time, although the CPU still uses Yonghong's "standard communication driver" to manage the communication of port1, it must be connected through the modem. Before the communication, the por T1 master control is handed over to the "modem driver" to manage, No access action can be made to the PLC at this time. The "modem driver" sets the modem to the receiving mode and waits for the remote modem to dial in. Once the modems of the sending and receiving sides are online successfully, the PLC will immediately leave the receiving mode and enter the online state. The control of port1 is handed over to Yonghong's "standard communication driver". At this time, the remote modem can access or control the PLC host at will

Figure 2 local modem settings

modem settings are shown in Figure 2. When PLC is online, select "PLC" → "Settings" → "port1 settings" in the menu to develop to figure 2 after years of development. Select the second item in the radio box "remote cpuu link through modem". As soon as the PLC is powered on, it sets port1 as the special interface for modem through its own "modem driver". In addition, the communication format is set to the same N, 8, 1 as the modem. In order to improve the communication efficiency, the communication rate can be set to 38400bps or higher (up to 115200bps)

4

Copyright © 2011 JIN SHI