Temperature control software is a kind of industrial control software, which has strict requirements for temperature data acquisition. In order to accurately realize the acquisition and representation of temperature data, the main characteristics of temperature control data are summarized, and the Modbus protocol and address specification are introduced. On this basis, the communication mode between LabVIEW and temperature control hardware equipment based on Modbus protocol is studied, and some possible problems in the communication process are analyzed and solved. Finally, the programming experiment is done on the UP35A temperature controller of the motor. The experimental results show that this communication mode can better meet the requirements of temperature control data acquisition. Temperature control system software is a common type of industrial control software, widely used in textile printing and dyeing, lithium battery manufacturing, household appliances production and other fields. Because of the high requirement of acquisition, processing and display of temperature control data, the acquisition and processing of temperature control data has been basically automated. LabVTEW is a program development environment developed by NI. It uses graphical editing language to write programs.
It is the core of NI design platform and has great advantages in developing industrial control system. At present, many temperature control devices are based on Modbus protocol communication. These devices can not only achieve accurate, real-time, multi-channel acquisition of temperature control data, but also configure them in wireless network environment, which expands the scope of use of the equipment. Therefore, in the development of temperature control software system, LabVIEW is more and more used as temperature control data display interface and Modbus device to realize temperature control data acquisition mode. In this paper, the communication principle, process and common problems of LabVIEW and Modbus based protocol devices are studied.
Large amount of data. Because the temperature control software is generally in a long running state, the data acquisition interval of the temperature control data is short, and basically the multi-channel parallel acquisition, so the amount of data generated is very large. For example, a temperature control software for lithium battery manufacturing usually runs between a few days and a dozen days. During this period, data is collected every 0.2 seconds. The data is divided into several groups, each group collects up to four channels at the same time.
Data volume is measured by GB or even TB. The process is complex. Temperature control software generally follows the relevant industry standards for data processing. In addition to data itself, it also needs to integrate the calculation of software running time threshold, acquisition frequency, data status and so on to get the temperature trend for decision-making. Real-time. Because temperature control software belongs to industrial control software, real-time performance is one of its important indicators.
For example, in the manufacture of lithium batteries, if the temperature value exceeds a certain threshold, the maximum time set by users can not be reached continuously, otherwise, scrap may occur. Because of the above characteristics of temperature control data, special attention should be paid to the accuracy and synchronization of data. This is also one of the main purposes of using LabVTEW to collect, display and monitor temperature control data. Modbus is the world’s first real bus protocol for industrial sites, invented by Modicon in 1979.
There are two main communication modes between LabVIEW and PLC: Modbus and NI OPC Server. The former requires PLC to install Modbus module, while the latter requires support for specific PLC devices to ensure normal connection. In terms of implementation, there are two physical interfaces of Modbus: Ethernet and serial port. In recent years, many devices supporting Modbus protocol have been able to configure and connect in wireless network environment, so they are more flexible and convenient. For example, the UP35A device of the electric motor can provide two connection modes of wired and wireless simultaneously. Typically, a Modbus address is a six-character value containing data types and offsets. The first two characters specify the data type, and the last four characters give the ordinal number of the data type. The Modbus addresses of devices developed by different companies are different [5]. For example, 40001-4XXXX is the Modbus address used by PLC of Modicon and GE Company in the United States. It is based on the address of 1 (that is, the first address of similar components is 1). The second bit from the left of this address is used to represent the component type, such as the Modbus address of i0.0 is 010001. And the PLC Modbus address is based on 0, such as i0.0’s Modbus address is actually 000000, i2.0’s Modbus address is 000016 instead of 010017 and so on. Note when configuring Modbus addresses. Sometimes the last four bits of the Modbus address may be marked as biased. At this point, we need to add 0 between the two bits of the address, so that the address can be changed from 5 bits to 6 bits. For example, if a Modbus address 40001 indicated in the device manual is used for communication between registers, programmers should configure the address to 400001. LabVIEW and Modbus devices must be set up before communication, and DSC module must be installed. When installing, it should be noted that the DSC version must be the same as the LabVIEW version. If LabVIEW is version 213, the DSC should also be version 213, otherwise it will not be installed. Specific configuration work can be divided into Modbus I/O Server configuration, constraint variable creation and Modbus I/O Slave configuration. First, build a new project in the integrated development environment, and then build a new I/O Server in the project, as shown in Figure 1. Then select “Modbus” in the interface of Figure 2 to establish Modbus Server, and select the mode of Ethernet or wireless network in “Model”, and input the IP address of Modbus device. Since the port number in DSC is 502 by default, the Modbus port does not need to be set any more, just configure the IP address. The above is the most basic Modbus I/O Server configuration. Users can further configure the library according to the “Modbus libraries for LabVIEW” given by NI and the actual work needs. Constraint variable creation is also called Modbus register address creation. In the constraint variable creation interface shown in Figure 3, select “Add Range” and add the required number of constraints variable items, then the corresponding Modbus address will appear in I/O Server. If the device’s Modbus address is 5 bits, you need to add “0” between two bits to make the address reach 6 bits.
Then drag the constraint variables directly into the VI interface generated by LabVIEW. Modbus I/O Slave configuration is not necessary, but can be used to simulate some running environment. The configuration steps of Modbus I/O Slave are roughly the same as that of Modbus Server, but the address must be set to be the same as that of Server, otherwise it cannot be communicated. Modbus Server creates constrained variables in the same way as “Modbus Server”. The experiment is based on the UP35A equipment of Henghe electric motor, and the upper development environment is Windows 7, LabVIEW2013 and DSC2013. UP35A is a new temperature control regulator for the temperature control software system of the motor. The size is 1/4DIN, and it can set up four program modes.
It can monitor two PV events, thermostatic element four time events and two alarms at the same time, and supports Modbus protocol and wireless LAN connection. In the experiment, UP35A was set to simulate the occurrence of PV values, and sent in the form of sinusoidal signals. The VI interface created by LabVIEW was responsible for collecting and displaying the PV values. In the experimental environment, the IP address of UP35A can be set to 192.168.X.X. By looking up the configuration XML table of UP35A, we can see that the PV register Modbus address of UP35A is 433, which changes to 40203 after adding “0” between the first and second bits.
Follow the steps in the previous section to complete the configuration and run the program. Data acquisition frequency is 10 times per second. From Figure 4, we can see that the data acquisition of Modbus device by LabVIEW can be accurate and synchronized when the program runs. It is very convenient and efficient to use LabVIEW to communicate with Modbus devices in temperature control software. Some problems that may be encountered in the process of implementation are studied and solutions are given. Practical programming proves that this method is effective.
In the future, we can improve the diversity and flexibility of data acquisition.