Hi, I think I am progressing, but not completely.Enclosed my new M100 and subroutine files.The purpose is to assign to a macrobutton in QtDragon an o-word script with a MDI-COMMAND that would allow me to toggle on and off a laser. (I have a 10W from Creality), besides my spindle that will of course be switched off.The laser is connected to an output pin (hal_pi_gpio.pin-10-out) and this pin is connected to a signal (laser-on). In the subroutine, I want to check what the status of this output pin is and then switching OFF if it is ON or switching ON if it is OFF.Since the hal-pi-gpio is connected to a signal, I cannot use getp and are using gets. But since subroutines do not accept halcmd gets commandes, I made a macro (M100) to fetch the status of the hal-pi-gpio. So far so good.Now when pushing the button, M100 does his job and stores the status of the hal-pi-gpio in a variable (
File Attachment:
File Name:
M100.zip
File Size:450 B