Gauges, sliders, and progress bar controls (Modbus Configuration Controls Tutorial 4)

freeFree Technical Resource

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

Gauges, sliders, and progress bar controls (Modbus Configuration Controls Tutorial 4)

1.4 Gauge, Slider, and Progress Bar Controls

This section primarily introduces the common applications of gauge controls, slider controls, and progress bar controls in the Modbus protocol. Simple controls can be bound to variables, which can be associated on the configuration page or bound to variables in [Tools - Protocols and Variables - Logic Processing]

In this section, the screen acts as the master station, reading and writing slave instructions. If the screen acts as the slave station, the application of gauge, slider, and progress bar controls is the same, and reference can be made. This section creates two save registers and two input registers to illustrate the application of gauge controls, slider controls, and progress bars, as shown below

Gauges, sliders, and progress bar controls (Modbus Configuration Controls Tutorial 4)插图

Scope of Application: Full Series

Example Download Link:Modbus Tutorial 3 - Gauge, Slider, and Progress Bar Controls V1.0(Click to Jump)

Protocol Enablement and Variable-Related Descriptions, Reference Link: "Modbus Basic Parameter Description"

1.4.1 Gauge Controls

The [Instrument Controls] screen primarily provides demonstrations on the use of instrument controls. These controls reflect data changes on the user's host device and cater to the user's needs for an instrument interface

Screen/Logic Configuration

Method 1: Logic Processing Binding

Add a gauge control (Control ID: 1) to the screen to display the voltage value of the slave device. Open "Tools - Protocols and Variables" and add one logic processing

For the purpose of [control binding], fill in the corresponding screen ID1 and gauge control ID1. The bound variable is [voltage], as shown below

Gauges, sliders, and progress bar controls (Modbus Configuration Controls Tutorial 4)插图1
Method 2: Configure screen binding

Add a gauge control (Control ID: 2) to the screen to display the current of the slave device. And bind the "Current" variable in its property bar window, as shown below

Gauges, sliders, and progress bar controls (Modbus Configuration Controls Tutorial 4)插图2

Run preview

At this point, compile the project and run the virtual serial port screen, connect it with the Modbus Slave software, and the gauge control will display the changes in voltage (Control ID: 1) and current (Control ID: 2) in real time

Gauges, sliders, and progress bar controls (Modbus Configuration Controls Tutorial 4)插图3

1.4.2 Slider and Progress Bar Controls

[Progress Bar and Slider Controls] On the screen, the progress bar control and slider control are used together. The notification of the progress bar is associated with the slider, mainly used to display the bound variable value. By dragging the cursor of the slider control, the variable value can be changed

Screen/Logic Configuration

Method 1: Logic Processing Binding

Add a progress bar control (control ID: 1) and a slider control (control ID: 2) to the screen. Add one logic processing in [Protocol and Variable Settings]

For use in [control binding], fill in the corresponding screen ID2 and gauge control ID2. The bound variable is [set temperature], as shown below

Gauges, sliders, and progress bar controls (Modbus Configuration Controls Tutorial 4)插图4
Method 2: Configure software binding

Add a progress bar control (control ID: 3) and a slider control (control ID: 4) to the screen. The slider control is directly bound to "Set Humidity", with the configuration shown below

Gauges, sliders, and progress bar controls (Modbus Configuration Controls Tutorial 4)插图5

Run Preview

At this point, compile the project and run the virtual serial port screen, connecting it to the Modbus Slave software. When the value of the variable changes, the status displayed by the slider control and progress bar will be updated accordingly; by clicking and dragging the slider control with the mouse, the value of the variable will also change and update accordingly

Gauges, sliders, and progress bar controls (Modbus Configuration Controls Tutorial 4)插图6
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 *.