PymateIO-HMI-numeric-input: Difference between revisions

From pymate.io wiki
Jump to navigation Jump to search
Line 20: Line 20:
[[File:02-01.png]]
[[File:02-01.png]]


Just press the field to encode a new value
With the following field definition
 
[[File:02-03.png]]
 
Just press the field on the HMI Display to encode the new value


[[File:02-edit-value.jpg|800px]]
[[File:02-edit-value.jpg|800px]]

Revision as of 18:45, 14 June 2026


Abstract

After our first example with the HMI Display and PymateIO it is time to look for some advanced feature.

02-edit-value.jpg

This example will show how Pymate script will grab the integer value sent by the HMI display.

HMI Example Project

The demonstration script is still based on the "HMI_PyMateIO_Modbus_MASTER.skm" project introduced in HMI Display and PymateIO tutorial.

Attentive reader would have noticed a slightly difference between the numeric fields:

  • The 4x1 field is a "Numeric display" only
  • The 4x0 field is a "Numeric Input" field where the user can encode some value.

02-01.png

With the following field definition

File:02-03.png

Just press the field on the HMI Display to encode the new value

02-edit-value.jpg

Entering a value will issue a function 6 ModBus request.

Modbus: HREGS READ <Request fct=3 qty=2 addr=0 data=None>
Modbus: COILS READ <Request fct=1 qty=8 addr=0 data=None>
Modbus: HREGS WRITE <Request fct=6 qty=None addr=0 data=bytearray(b'\x01,')>
Modbus: HREGS READ <Request fct=3 qty=2 addr=0 data=None>


PymateIO all right reserved © 2026 - Written by MCHobby for PymateIO