If the paper is original articles, reprint please indicate the original source This article blog: blog.csdn.net/qq21497936/…

Development technology set (including Qt practical technology, raspberry PI, 3D, OpenCV, OpenGL, FFMPEG, OSG, SCM, soft and hard combination, etc.) continue to update… (Click on the portal)

Others (programming related)

Last: “Delta PLC development notes (a) : Delta PLC connection introduction, respectively using 485, network port and delta PLC connection” next: please look forward to…


preface

Previously, 485 and network port were used to successfully establish communication with Delta. However, 485 was used in ASICC mode. In most cases, RTU mode was used to improve communication efficiency.


Download and install Delta ISPSoft

Official website download address:Downloadcenter.delta-china.com.cn/DownloadCen…The configuration is performed using a network cable and HWCONFIG software:(Install the previous CommGR communication management software first) Download, as shown below:After installation, the picture is as follows:


Test before configuration

Test the ASCII communication mode using 485

  

Test the RTU communication mode using 485

(The default port is ASCII, RTU will return a fixed length of fixed data, should be error detection)

Use ISPSoft to configure delta PLC 485 from ASCII to RTU

Step 1: Open the software

  

Step 2: Create the project

     

Step 3: Enable HWCONFIG

     

Step 4: Configure parameters such as COM1 (ASCII changed to RTU)

  (If the network cable is not used before, there will be a prompt, before the network cable is needed to connect to PLC)Downloading, prompt processing, as shown below:Download timeout, is required to use network port connection.

Step 5: Connect the PLC using network cables

        

Step 6: Download the new configuration again (originally 485 is now network cable IP)

           

Step 7: Download successfully, use 485RTU to test

(Hex, not ACSII, success)


Into the pit

Pit 1: modbus485 with Qt fails to read

The problem

Qt’s modbus all-aspect test reads several values near the corresponding registers of M, D, Y and X are 0.

To solve

Test directly using Modbus RTU

There is no problem, but the Qt return value is still:

Other parts have been tried here, a total of four types, related variables M, D, X, Y have been set similar, all read successfully, but the value of 0 is inconsistent with the actual, like overhead.

Argumentation (added on 25 April 2021)

Test a single coil that can be read using LibmodbusSingle coil tested, still cannot be read using QModbusTest read registers, which can be read using libmodbusTest read registers that can be read using QModbus

conclusion

Qt some things are really weak, there is no need to die.


Last: “Delta PLC development notes (a) : Delta PLC connection introduction, respectively using 485, network port and delta PLC connection” next: please look forward to…