PymateIO-HMI-numeric-input: Difference between revisions

From pymate.io wiki
Jump to navigation Jump to search
(Created page with "{{PYMATE-HEADER}} == Abstract == After our first example with the HMI Display and PymateIO it is time to look for some advanced feature. File:02-edit-value.jpg This example will show how Pymate script will grab the integer value sent by the HMI display. == HMI Project == HMI Display and PymateIO {{PYMATE-TRAILER}}")
 
Line 9: Line 9:
This example will show how Pymate script will grab the integer value sent by the HMI display.
This example will show how Pymate script will grab the integer value sent by the HMI display.


== HMI Project ==
== HMI Example Project ==


[[PymateIO-HMI|HMI Display and PymateIO]]
The demonstration script is still based on the "HMI_PyMateIO_Modbus_MASTER.skm" project introduced in [[PymateIO-HMI|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.
 
[[File:02-01.png]]
 
Just press the field to encode a new value
 
[[File:02-edit-value.png|800px]]
 
Entering a value will issue a function 6 ModBus request.
 
<nowiki>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>
</nowiki>


{{PYMATE-TRAILER}}
{{PYMATE-TRAILER}}

Revision as of 18:41, 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

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