OK Ihave partialy sucess:
In the ini file :
OPEN_FILE = /home/cnc/emc2/nc_files/EMC.ngc
......................
#
Connect buttons of screen
HALUI =halui
[HALUI]
MDI_COMMAND = G0 X1 Y1 Z1
MDI_COMMAND = G0 X2 Y2 Z2
MDI_COMMAND = G0 X3 Y3 Z3
MDI_COMMAND = o<Tools/square> call
In the postgui / pyvyp.hal :
net cmd00 pyvcp.cmd00 halui.mdi-command-00
net cmd01 pyvcp.cmd01 halui.mdi-command-01
net cmd02 pyvcp.cmd02 halui.mdi-command-02
net cmd03 pyvcp.cmd03 halui.mdi-command-03
In my ncfiles I have a subdirectoty called tools and as examle herin the file square.ngc:
o<tools/square> sub
G0 Z1
G0 x0 y0
F 120
G1 x0 y0 z0
G1 x0 y10 z0
G1 x10 y10 z0
G1 x10 y0 z0
G1 x0 y0 z0
o<tools/square> endsub
M2
%
As soon as I press the button, all commands in the file are processed correctly.
That way I can predefine some G-code programms, runned without request.
I'll experiment with M1 and message to get additional information and safety on screen
Maybe I'l find also something for .py and jpg. ;-()
Mike