Share this

Design of VB-based computer-to-Mitsubishi inverter communication and monitoring software

2026-04-06 08:39:56 · · #1
Abstract: This paper introduces a software design method for communication between a computer and a Mitsubishi inverter based on the Mscomm control in VB. This method enables computer communication and monitoring of the inverter, including operation control, status monitoring, parameter setting, and verification. Keywords: VB, Mitsubishi inverter, monitoring software 1. Overview Inverters are widely used in various industrial applications. When using inverters, it is necessary to set their operating parameters reasonably so that the entire variable frequency speed control system can meet the working requirements and operate in the best possible condition. Inverters have numerous parameters, and many parameters are interrelated. In some complex operating situations, parameter setting requires comprehensive analysis and consideration based on the system's working requirements and the inverter's functions. Mitsubishi inverter parameter settings can be performed through the inverter's operating panel. However, due to the very compact structure of the operating panel, which only has a keypad and a few LED displays, parameter setting and reading are inconvenient and the operation is cumbersome. To facilitate convenient and intuitive parameter setting and operational status monitoring of the frequency converter, a computer can be used to control the frequency converter via a serial port (requiring the frequency converter to have a communication interface), or a PLC + HMI approach can be used. The PLC can control the frequency converter through digital, analog, or communication interfaces. In this system, the Mitsubishi frequency converter is controlled through the computer's serial port and interface conversion circuit, as shown in Figure 1. The system's monitoring software is developed using Visual Basic, allowing for convenient parameter setting and verification of the frequency converter, as well as intuitive control and monitoring of its operation. [align=center] Figure 1 Connection between Computer and Mitsubishi Frequency Converter[/align] 2 Interface Conversion Design General computers typically only have RS-232 interfaces, while industrial control equipment mostly uses RS-485 interfaces. The Mitsubishi FR-E500 inverter used in this system has an RS-485 communication interface, specifically a less common full-duplex RS-485 interface (with four data lines, one for receiving and one for transmitting). External connections use an RJ45 interface, and the connecting cable should be a 10BASE-T cable conforming to the EIA568 standard. To enable communication between the general-purpose computer and the Mitsubishi inverter, we designed a dedicated interface conversion circuit, the schematic of which is shown in Figure 2. [align=center] Figure 2 Schematic diagram of the interface conversion circuit[/align] The interface conversion circuit utilizes two MAXIM interface conversion chips (MAX202 and MAX491) to convert between RS232 and RS485 signals, as shown in Figure 2. MAX202 can convert between RS232 and TTL signals, while MAX491 can convert between full-duplex RS485 and TTL signals. The circuit also incorporates a DC-DC converter and an optocoupler 6N137 to isolate the signals from the 232 and 485 sides, thereby improving the circuit's anti-interference capability. 3. Design of Communication and Monitoring Software This software can control the operation of the frequency converter, monitor its operating status, set the frequency converter parameters according to functional classification and mutual constraints, and verify the set parameters according to certain rules before downloading them to the frequency converter. The overall structure of the software is shown in Figure 3. [align=center] Figure 3 Overall Structure of Communication and Monitoring Software[/align] 3.1 Human-Machine Interface The main interface is shown in Figure 4. In the main interface, basic operation of the frequency converter can be performed directly, and the current values ​​of frequency and current are displayed in real time. The settings of system communication parameters and frequency converter operating parameters are mainly completed in the communication menu and monitoring menu. [align=center] Figure 4 Main Interface of Monitoring Software[/align] The communication menu is used to operate the computer serial port, including four sub-menu items: open serial port, close serial port, serial port initialization, and current serial port status display. The monitoring menu is used to group and set inverter parameters, including five sub-menu items: frequency limit, acceleration/deceleration operation, jogging operation, DC braking, and alarm reason display. Inverter parameters are not only numerous but also interconnected, requiring consistent settings. This software categorizes inverter parameters according to function and interrelationships, listing them as sub-menus under the monitoring menu. Clicking a sub-menu will bring up a corresponding dialog box, allowing you to set a series of parameters related to that sub-menu's function. For example, clicking frequency limit will bring up the frequency limit parameter setting dialog box as shown in Figure 5. The software can validate the set parameters according to certain rules. When user-set parameters contradict each other, the software can issue a warning message; when user-set parameters exceed the commonly used inverter parameter setting range, the software can also issue a prompt message requiring user confirmation. For example, if the set lower frequency limit is lower than the starting frequency, a dialog box as shown in Figure 6 will warn the user. [align=center]Figure 5 Frequency Limit Setting Dialog Box Figure 6 Warning Dialog Box[/align] 3.2 Data Processing To enable correct data exchange between the computer and the inverter, a data processing process is necessary to convert the data and instructions in the human-machine interface (HMI) into data conforming to the inverter's communication protocol format. Data processing includes two aspects: first, converting the commands or input data on the HMI into a data format that the inverter can recognize; and second, analyzing the data returned by the inverter, converting it into actual values, and displaying it on the HMI. The data communication execution process between the computer and the inverter is shown in Figure 7. [align=center]Figure 7 Data Communication Execution Process between Computer and Inverter[/align] The specific data formats for the three types of data in Figure 7 are as follows: [Note] ENQ, ACK, NAK, STX, and ETX are control codes, representing communication request, no data error found, data error found, start of data, and end of data, respectively. They all correspond to specific ASCII codes. Taking frequency writing as an example, define the array to be sent according to the format of the communication request data, and send ENQ, inverter station number, instruction code for setting the frequency to be written, frequency value to be written, and total checksum in sequence. The total checksum does not include ENQ. Note that data is transmitted between the computer and the inverter using ASCII code. 3.3 Communication Program Before the Mitsubishi inverter communicates with the PC, the communication specifications must be set in the inverter's initialization and the inverter must be reset; otherwise, communication cannot proceed. The communication specifications that need to be set include inverter station number, communication rate, byte length, stop bit length, checksum method, and waiting time. The communication specifications can be set by writing the corresponding parameters. This software uses the Mscomm control in VB to complete the operation of the computer's serial port. The Mscomm control is an ActiveX control in VB used for sending and receiving data via the serial port, which can be used to easily access the serial port. The Mscomm control has many important properties; Table 1 lists several properties used in this programming. [align=center]Table 1 Common Properties of the MsComm Control[/align] The flowchart of the communication program is shown in Figure 8. Since the main interface of the software in this article needs to display the frequency and current in real time, it needs to send commands to read the frequency and current to the inverter at regular intervals. Therefore, when sending other control commands such as forward rotation and stop, the commands to read the frequency and current should be stopped first, and then the commands to read the current and frequency should be resent after completion. This is because sending several commands to the serial port at the same time will cause errors. The commands to read the frequency and current should not be sent at the same time, but should be sent alternately. In addition, it is important to take out the return code in the input buffer in time after sending a command to the inverter to avoid affecting the correctness of the next reading of the input buffer. [align=center] Figure 8 Flowchart of the communication program[/align] Part of the source code of the communication program is as follows: ⑴ The program to initialize the serial port is: MSComm1.CommPort = 2 'Open Com2 MSComm1.Settings = "9600, n, 8, 1" 'Set the baud rate to 9600Kbps, no parity, 8 data bits, 1 stop bit. MSComm1.PortOpen = True 'Open serial port (2) to write parameters, such as setting the frequency (taking 30Hz as an example). The program for writing is: Dim outfrq(10) As Byte 'Define the array to be sent outfrq(0) = 5 'Send ENQ outfrq(1) = 48 outfrq(2) = 49 'Send the inverter station number outfrq(3) = 69 outfrq(4) = 69 'Send the instruction code for writing the set frequency outfrq(5) = 48 outfrq(6) = 66 outfrq(7) = 66 outfrq(8) = 56 'Send the frequency value to be written 30Hz outfrq(9) = 68 outfrq(10) = 55 'Send the total checksum MSComm1.Output = outfrq 'Send the communication data to serial port (3) to read parameters, such as the program for reading the current frequency of the inverter. Dim outf(6) As Byte 'Define the array to be sent outf(0) = 5 'Send ENQ outf(1) = 48 outf(2) = 49 'Send the inverter station number outf(3) = 54 outf(4) = 70 'Send the instruction code to read the frequency outf(5) = 68 outf(6) = 68 'Send the total checksum MSComm1.Output = outf 'Send to the serial port Dim inf As Variant inf = MSComm1.Input 'Read the input buffer and retrieve the returned data Note: After sending the command to read the frequency, wait for a period of time before reading the data from the input buffer, otherwise an error will occur. This period of time is the sum of the waiting time and the data verification time. 4 Conclusion This article introduces a software design method that controls the inverter through the computer's serial port and interface conversion circuit. By using VB to develop monitoring software, the operation of the inverter can be conveniently and intuitively controlled, the operating status of the inverter can be monitored, the parameters of the inverter can be set and verified. Based on this, we can also summarize the rules for setting inverter parameters, and automatically set the inverter's working parameters according to the system's functional requirements to achieve "intelligent" inverter application. References: [1] Mitsubishi FR-E500 Variable Frequency Drive User Manual. [2] Lü Limin. Introduction and Techniques of Visual Basic 5.0. Beijing: People's Posts and Telecommunications Press, 1998. [3] Wu Kuanming. Practical Handbook of Microcontroller Peripheral Devices. Beijing: Beijing University of Aeronautics and Astronautics Press, 1998. Design of Computer Communication and Monitoring Software Based on VB and Mitsubishi Inverter
Read next

Enhanced Application Design of Capacitive Touch Sensors

It seems that suddenly, capacitive sensors are everywhere. They're installed in car seats to control airbag configur...

Articles 2026-02-22