I hope this is not seen as 'advertising' and gets bounced, but the best way to explain the task is with a video. I will attempt to link it and if you look
here
at about 3 minutes in, you will see the communication that I want to use Python/direct access to the pins for.
The process is this:
The pendant has an unlimited number of 'CELs' that contain any CNC command, text, G-code fragment, Macro, parameters, or whatever the user creates. each CEL content is assigned a unique number and kept in a disk file on the CNC computer.
the process, over simplified, is this
1) the user touches a cel on screen, and the pendant loads the item number into a Modbus register and then sends a 'trip' to the CNC via a modbus coil. At this point the CNC also displays an message on the CNC screen stating that a remote command has come in
2) the CNC gets the trip, then reads the item number out of the Modbus register
3) the CNC places this item number on a different modbus register and sends an 'acknowledge' signal (bit) to the pendant on a coil
4) the pendant detects the ack and reads out the item number sent by the CNC and reads the returned item number from the Modbus reg.
5) the pendant compares the item number sent to the item number returned and only if they match it sends an 'OK to proceed' (bit) back to the CNC on yet another coil.
6) the CNC looks up the data for that item number on a disk file and sends the contents to the CNC for execution (or whatever action is indicated).
7) when successfully completed, the CNC sends a last acknowledge to the pendant, again via Modbus

the pendant the displays the status (successful, error, or whatever) in text and echos that message number over a Modbus register back to the CNC for display on the CNC screen.
Notice that step 8 is the only one that woud use the GUI. All of the rest are 'invisible' communications between the pendant processor and the Python program via Modbus.
There are some other tasks that require processing (exponential curves for rotary control knobs on the pendant, etc) that require some calculations (including conditional statements) before being sent on to the CNC and that would be a lot to try to stuff into an 'action'. tripped by the GUI pin.
- Steve