summary
Researchers Liu Hui and Li Duoshan from Hefei Lianxin Power Supply Co., Ltd. published an article in the 9th issue of "Electrical Technology" magazine in 2018, mainly introducing industrial human-machine interface (HMI) touch screens and their methods for implementing emergency power supply monitoring. The article details how to achieve data transmission between the industrial HMI touch screen and emergency power supply via the Modbus protocol, as well as the design method for the emergency power supply monitor interface using configuration software.
Centralized battery-powered emergency power supplies are used in many important situations. These supplies employ inverter technology to convert the DC power from the batteries into AC power, which is then supplied to AC emergency loads such as emergency lighting, evacuation indicator lights, and fire pumps.
A centralized battery-powered emergency power supply consists of a power monitor, an emergency power unit, a power distribution system, charger battery packs, and fire alarm linkage devices. The power monitor comprises a display, control board, and communication components. Early displays typically used LED digital tubes or LCD screens, requiring the design of corresponding control circuits, and were simple in function with limited display content.
As the cost of LCD screens and touchscreens continues to decrease, they are gradually being used in industrial monitoring displays. However, the relatively complex drivers for these screens limit their application in the emergency power supply industry to some extent.
1. Introduction to Industrial Human Machine Interface (HMI) Touchscreens
Industrial human-machine interface (HMI) touch screens are mainly used in the field of PLC industrial control, such as metallurgy, textile, advanced manufacturing systems and equipment control [2]. Touch screens integrate CPU units, input/output units, displays, memory and other module units. They are open and high-quality human-machine interface products, and generally provide standard serial interfaces to connect with other devices.
Industrial Human-Machine Interface (HMI) touchscreens utilize general-purpose industrial automation configuration editing software for interface programming and design. This type of software is used to quickly construct and generate embedded computer monitoring systems, creating graphical interfaces in window units. Users can easily construct their own configurations using this industrial automation configuration editing software, freeing them from tedious programming tasks.
2 Emergency Power Supply Monitor Based on Industrial Human-Machine Interface (HMI) Touch Screen
To realize the application of industrial human-machine interface (HMI) touch screens in emergency power supplies, two main design aspects are involved: ① realizing data transmission between the industrial human-machine interface (HMI) touch screen and the emergency power supply; ② using configuration software to complete the human-machine interface design of the (HMI) touch screen.
2.1 Data transmission between industrial human-machine interface (HMI) touch screen and emergency power supply
Only by realizing the data transmission between the industrial human-machine interface (HMI) touch screen and the emergency power supply can the industrial human-machine interface (HMI) touch screen display the emergency power supply information in real time. The communication method of the industrial human-machine interface (HMI) touch screen is mainly serial communication, which supports communication with the mainstream PLCs on the market today, such as Mitsubishi, Siemens, OMRON, Modicon, Modbus, etc. When designing, the Modbus protocol is selected as the communication protocol between the industrial human-machine interface (HMI) touch screen and the emergency power supply[5].
The Modbus protocol is a universal language used in electronic controllers. It has become a common industry standard, defining a common format for message structure and content. The protocol content includes the process of a controller requesting access to other devices, how to respond to requests from other devices, and how to detect and log errors.
The Modbus protocol establishes a format for master device queries: device (or broadcast) address, function code, all data to be sent, and an error detection field [3]. Slave device response messages are also composed of Modbus protocol, including a field confirming the action to be taken, any data to be returned, and an error detection field. Modbus protocol RTU mode mostly uses CRC check. There are various methods for software implementation of RTU CRC check. The most commonly used methods are table lookup and calculation, but both have certain running speed and occupy program time.
The emergency power supply control system uses TMS320LF2407 chip and SVPWM modulation technology for inverter control. The algorithm is relatively complex, involving nonlinear calculations, solving matrix equations, etc. Therefore, the real-time y calculation requirements are very high. Since the CRC check algorithm in the Modbus protocol is relatively complex and the chip does not contain a built-in CRC algorithm module [6], if a complex CRC check algorithm is added to the serial communication of the emergency power supply control chip, it will affect the real-time performance of the SVPWM modulation control technology. Therefore, in the data transmission method between the industrial human-machine interface (HMI) touch screen and the emergency power supply, a communication conversion board is added as a communication relay.
The design uses STC15W series microcontrollers and utilizes its two USART interfaces to design dual RS485 serial ports. RS485-1 communicates with the RS485 port of TMS320LF2407 chip for normal and verification communication, and RS485-2 communicates with the touch screen using the ModbusRTU protocol [4].
In the communication conversion board between the touchscreen and the emergency power supply, the Master end is the monitoring touchscreen, and the Slave end is the communication board of the emergency power supply. The Master end sends a data request message, and after the Slave end receives the correct message, it can send data to the Master end in response to the request.
In the Modbus communication protocol, there are many function codes [1]. In the design, function code 03 is used to realize the analog quantity of the Master to obtain the Slave. Function code 01 is used to realize the switch quantity of the Master to obtain the Slave. The Master receives the data from the Slave. The touch screen displays the parameters of the emergency power supply according to the data definition through the monitoring touch screen.
The parameter transmission is defined as follows.
1) Monitor the touchscreen to send commands: [Communication board address][Command number 03][Starting register address (high 8 bits)][Low 8 bits]][Number of registers to read (high 8 bits)][Low 8 bits]][Low 8 bits of CRC checksum][High 8 bits of CRC checksum]
For example: [01][03][00][00][00][04][CRC low][CRC high]
2) Emergency power supply communication board parameter return: [Communication board address][Command number 03][Number of returned bytes][Data 1][Data 2]...[Data n][Lower 8 bits of CRC checksum][Higher 8 bits of CRC checksum]
For example:
[01][03][08][02][2B][00][00][00][64][02][2B][CRC Low][CRC High]
The meaning is as follows.
(1) Number of bytes returned: This indicates the number of bytes of data, which is the value of n in data 1, 2, ..., n. In the example, 4 analog values are returned. Since one analog value requires 2 bytes, the total number of bytes is 8.
(2) Data1,…,n: where [Data1] and [Data2] are the high 8 bits and low 8 bits of the first analog quantity, respectively, and [Data3] and [Data4] are the high 8 bits and low 8 bits of the second analog quantity, and so on.
In the example, [Data 1][Data 2] are defined as: DC voltage; [Data 3][Data 4] as: AC mains voltage; [Data 5][Data 6] as: emergency voltage; and [Data 7][Data 8] as: output current.
3) Monitor the touch screen to send commands: [Communication board address][Command number 01][Start register address high 8 bits][Low 8 bits][Number of registers read high 8 bits][Low 8 bits][Low 8 bits of CRC check][High 8 bits of CRC check].
For example: [01][01][00][00][00][08][CRC low][CRC high]
4) Emergency power supply communication board parameter return: [Communication board address][Command number 01][Number of returned bytes][Data 1][Data 2]...[Data n][Lower 8 bits of CRC checksum][Higher 8 bits of CRC checksum]
For example: [01][01][01][08][CRC low][CRC high]
The meaning is as follows:
(1) [01] The number of bytes returned: indicates the number of bytes of data, that is, the value of n in data 1, 2, ..., n.
(2) [08]: Data
1st bit: Overcurrent; 2nd bit: Battery undervoltage; 3rd bit: Battery overvoltage; 4th bit: Module fault; 5th bit: Forced state; 6th bit: Charger fault; 7th bit: Output state; 8th bit: Emergency state.
2.2 Touchscreen Human-Machine Interface Design
1) Functions of configuration software
The touchscreen display development system uses configuration software. The functions of configuration software generally include: title bar, menu bar, toolbar buttons, project manager, status bar, etc., as shown in Figure 1. In the visual touchscreen display, text belongs to the configuration software's text function, function keys belong to the configuration software's button function, data display belongs to the configuration software's data display function, and the background belongs to the configuration software's static image function.
Figure 1 Functional blocks of the configuration software
2) Data display and alarms
The display of emergency power supply parameters on the touchscreen is achieved through the data display function of the configuration software, as shown in Figure 2. The monitoring address points to the communication board address, command number 03, and data location in the communication protocol. Data type, display type, shape, color, etc., can be set through simple, visual, and modular operations to complete the data display function.
Figure 2 shows the data display function diagram.
In the touchscreen, the alarm information for the emergency power supply is displayed through the alarm display function in the configuration software. The alarm display function diagram is shown in Figure 3. The address input points to the communication board address of the communication protocol, command number 01, and data location. Different controlled bits correspond to different alarm signals.
Figure 3. Functional diagram of the alarm display
Communication parameters are configured in the communication port settings dialog box within the development system's configuration software. These parameters include the communication port name, communication method, connection port, and communication protocol. The communication baud rate, data length, stop bits, and parity can all be set in the communication parameter settings. The addresses and communication times for the visual touchscreen and the host communication board can also be configured. The communication port parameter settings are shown in Figures 4 and 5, respectively.
Figure 4. Communication port attribute settings diagram
Figure 5 Communication port parameter settings diagram
3) Interface parameter design
The configuration software employs object-oriented programming techniques. When editing the touchscreen monitoring interface, it allows for easy creation of graphical interfaces for the screen. During layout, the system-provided graphical objects can be used to generate the screen, much like building blocks. It also supports copying graphical objects between screens, allowing for the reuse of previous development results. The edited emergency power supply monitoring interface is shown in Figure 6.
Figure 6 Emergency Power Supply Monitoring Interface
in conclusion
Emergency power supply monitors based on industrial human-machine interface (HMI) touchscreens have been successfully implemented in products, offering significant performance improvements compared to previous emergency power supply monitors. The method for designing emergency power supply communication software according to a universal serial communication protocol to achieve data communication between the industrial HMI touchscreen and the emergency power supply can be applied to industrial HMI touchscreens of different brands that support universal serial communication protocols.
Directly applying highly integrated industrial human-machine interface (HMI) touchscreens as emergency power supply monitoring displays reduces the design complexity of emergency power supply products' software and hardware, lowers design costs, and improves the level of monitoring automation.