PymateIO-HMI-numeric-input

From pymate.io wiki
Jump to navigation Jump to search


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

Just press the field to encode a new value

File:02-edit-value.png

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