Hollysys LM series PLC and Flash storage devices for data communications solutions -

by:Coolmay     2020-06-27
1, introduction

hollysys LM series PLC is hangzhou hollysys company independent research and development of integration of small PLC products. LM series PLC has high reliability, rich instruction, communication ability, etc. Its support for six kinds of programming languages, including LD, IL, FBD, SFC, ST, CFC, able to adapt to a variety of PLC programming basis. Some big control system has a lot of field devices, some of the field devices may not support the standard communication protocol, but also need to control equipment for data communication with a third party, any one vendor PLC may not support all field device data communication protocol. How real PLC and non standard protocol of third party equipment interconnected, LM series PLC controller launched a free port communication methods 'title =' communication ', 'communication' title = 'communication', 'communication' title = 'communication', 'communication, can realize the interconnection agreement with any third party equipment. LM series PLC are introduced in this paper through a free port and Flash storage devices for data communication.

2, LM series PLC communication methods

LM series PLC controller to support a variety of communication methods, such as Profibus DP, Ethernet, free port communication. LM series PLC of the CPU module ontology incorporates a RS232 communication port and a RS485 communication port, RS232 and RS485 standard Modbus RTU, LM proprietary protocols and free port communication protocol. The user can use the program set the communication protocol, communication rate, data bits, calibration, data sending and receiving data. And PLC free port related function block is illustrated below instructions.

figure 1 set free port communication rate, data bits, calibration instructions; Figure 2 to restore the Modbus RTU and LM proprietary protocol's instructions, at the same time also can set up the communication rate, data bits and validation; Figure 3 for data sending instructions; Figure 4 receive instructions for the data. At the same time the software has the function of the CRC check, instruction can be data validation. Can also through the ST language convenient write check program. TO calculate the CRC check code, for example, here is a variable declaration section:

FUNCTION_BLOCK Generate_CRC

VAR_INPUT

pData: POINTER

TO BYTE;

byteCounter:文字;

END_VAR VAR_OUTPUT

CRC_Code:词;

完成:BOOL: = FALSE;

END_VAR

VAR

Reg16:词;

j: BYTE;

我:词;

mval:文字;

temp_byte: BYTE;

flg:文字;

END_VAR

the following part is ST language program code:

Reg16: = 16 # FFFF;

mval: = 16 # A001; 我的

: byteCounter - = 0 1×1

temp_byte: = pData︿;

pData: = pData + 1;

Reg16: = ( Reg16 XOR temp_byte) ;

j: = 0 - 7 1做flg:

= 0;

flg: = ( Reg16和16 # 0001) ;

Reg16: =月( Reg16,1) ;

如果( flg = 1)

Reg16: = Reg16 XOR mval;

END_IF;

END_FOR;

END_FOR;

CRC_Code: = Reg16;

完成:= TRUE;

3, the design of the data storage system

the PLC control system is applied in fuel-efficient cars, through the PLC control of the hydraulic circuit is to reduce the car fuel consumption for the purpose of, in the car's trial stage, need to put some process data are recorded in the process of operation. Three design scheme was put forward, the first solution is to modify the PLC, increase a FLASH chip internally, modify the bottom layer of PLC program and realize data storage; The second solution is through the GPRS transceiver data uploaded to the remote PC; The third way is through free port to communicate with the U disk read and write module, the data real-time write usb drive. We had a site visit to the running environment and repeatedly research, in terms of reliability, stability and convenience have done a lot of work, weigh the pros and cons, ultimately chose three scheme implementation.

Flash storage devices must first configuration parameters, including the rate of interface mode, function setting, communication, etc. , as shown in figure 5:

figure 5 module configuration

PLC for some parameters such as pressure, flow, speed of acquisition, and put the data into the real-time ASII code in the form of storage. Then through free mouth send instruction to the U disk read/write module, U disk read/write module responds to send commands, and complete the corresponding U disk to read and write operations. System requirements for time behind each set of data records, so PLC every time at the same time, the time to write data in a file, program flow chart shown in figure 6:

the procedure flow charts of figure 6

4, conclusion

after a long application proved that the stability of the data storage system is very good, this way of the realization of the data storage greatly save the cost of the system, and more convenient to implement and can be promoted. Visible, LM series PLC free rise up quite flexible application, can be convenient and to communicate with the third party equipment.


Shenzhen Coolmay Technology Co., Ltd. has created its reputation on a commitment to manufacturing high-quality products and services while satisfy the needs of customers.
The best for plc controller price is one that works best for your needs and what you can support in your home. Among Shenzhen Coolmay Technology Co., Ltd. 's diversified list of products at different price ranges, you will surely find your one with high quality. make your choice at Coolmay PLC!
If something seems too good to be true, then it can be a , which provides programmable control systems value over its cost.
Custom message
Chat Online 编辑模式下无法使用
Chat Online inputting...