How to use Modbus protocol on touch screen?

freeFree Technical Resource

This content is free to read, suitable for basic learning and search traffic.

How to use Modbus protocol on touch screen?缩略图

The jumping symbol touch screen supports the jumping symbol configuration protocol Modbus RTU、XGUS、FX2N、 Free serial port protocol (supports LUA script for serial port screens), compatible with only one protocol. This series mainly introduces the application of Modbus protocol, similar to other protocols such as XGUS and FX2N, for reference only

1.1 Transmission Format Description

The default data format for transmission is:

  • Starting bit: 1 bit
  • Data bit: 8-bit
  • Checkpoint: None
  • Stop bit: 1-bit
  • Serial Port Baud Rate: RS232 Electrical Interface: Supports 1200-921600bps, Typical Baud Rate: 115200bps sRS485 Electrical Interface: Supports 1200-11220bps, Typical Baud Rate: 9600bps

1.2 Protocol Description

Develop a MODBUS project, compile it through VisualTFT, and generate a downloaded resource package. The compilation process will convert Modbus configuration information into a project file for the serial port screen; The serial port screen will run according to the project file and automatically generate instruction formats that comply with the MODBUS protocol. Therefore, users do not need to consider how the screen generates Modbus messages or how to parse Modbus messages. When the screen is used as the host, it periodically sends these instructions to the slave through the serial port, receives the commands from the slave and parses them, updates the bound controls or executes pre configured actions

Attention: When users receive a new screen for development, the default protocol is the jumping symbol protocol, which can be connected, debugged, downloaded, etc. through the VisualTFT upper computer serial port. When the user enables the Modbus protocol (or other non hop symbol protocols), compiles it, and downloads it to the physical screen through the serial port, it can no longer be operated online. This phenomenon is normal because the upper computer software is connected through the jumping symbol protocol for communication, and users need to upgrade and update with an SD card at this time!!!

1.3 Debugging Tools

Due to the inconsistency between the Modbus protocol message and the jump symbol instruction message, it is not possible to debug through the "Configuration/Basic Instructions" in the instruction assistant of the upper computer software. Therefore, specialized third-party software is required for debugging, as shown below

  1. Virtual serial port: used for Modbus Slave (Modbus Poll) and virtual screen communication debugging.Click to download
  2. Modbus Slave: When the screen serves as the host, it communicates with virtual or physical screens.Click to download
  3. Modbus Poll: When the screen is a slave, it can be debugged with virtual or physical screens.Click to download

This chapter does not elaborate on the installation and use of Modbus Slave and Modbus Poll. Detailed information can be found online. For creating a virtual serial port, please refer to Quick Start - "6.1 Installing Virtual Serial Port Software"

1.4 Script Description

The development of protocols such as Modbus RTU, XGUS, FX2N, and related logic linkage involves the following methods for implementation:

  1. Logical processing: It can be achieved through logical processing in the 【 Tools 】 - 【 Protocol and Variables... 】 menu bar
  2. Minic Script: You can use the [Tools] - [Minic Script Programming...] option in the menu bar. Note: The Minic script must be based on enabling the above protocol to take effect
  3. Lua script: LUA script is suitable for any protocol and can implement more complex logic. It is recommended to use LUA script when developing Modbus protocol. If the screen supports LUA script, it is strongly recommended to use LUA script to implement complex logic
Related Tags
Put this resource to use in a real project?

Go to the Tool Center for message parsing, CRC verification and device debugging, or submit your requirements for selection and integration advice.

Engineer Membership

Turn this article into actionable debugging resources

After activation, you can use advanced message parsing, resource pack downloads, code examples, engineering cases and priority technical support, suitable for real project delivery.

Unlimited Advanced Tools
Resource & Code Packs
Complete Engineering Case Library
Priority Technical Support

Leave a Reply

Your email address will not be published. Required fields are marked *.