Call custom Mcode from Gui Button

More
27 Nov 2024 18:55 - 27 Nov 2024 19:21 #315401 by csurimilan
Hello,
I have a question about coolant.
Im using costume made M-codes to controll the relays for my collant. (Air,flood,Mist => M100,M101,M102 and M105 turn off all)
I would like to know how can i address in the HAL file that if i press a button in the gui (qtDragon) that is turning on/off my coolant and of course i would like its working autoatically when the cnc is working. (Im using costume M-codes because im controlling more outputs)

net  coolant-flood  <= iocontrol.0.coolant-flood          //here i dont know how can i add the M101

thank you :)
 
Last edit: 27 Nov 2024 19:21 by Aciera. Reason: Moved over here from Remora thread.

Please Log in or Create an account to join the conversation.

More
27 Nov 2024 19:26 #315402 by Aciera
- Create a new HAL_COMMAND entry in the [HALUI] section of your ini file:
MDI_COMMAND = M101

- Make sure the [HAL] section of your ini file contains this entry:
HALUI = halui

Then connect the MDI_COMMAND in your hal file:
net coolant-flood => halui.mdi-command-00

Note that this will not work when a program is executing as this requires the controller to execute an MDI command.
The following user(s) said Thank You: csurimilan

Please Log in or Create an account to join the conversation.

More
27 Nov 2024 19:37 #315406 by csurimilan
Its working. :)

how can i turn off.
Beacuse if i press the button its turning green and the output is true. But if i press the button again its not turning off.

Please Log in or Create an account to join the conversation.

More
28 Nov 2024 09:43 #315445 by Aciera
- Create a new HAL_COMMAND entry in the [HALUI] section of your ini file (below the one you created for M101):
MDI_COMMAND = M105

Then connect the MDI_COMMAND in your hal file:
loadrt not
addf not.0
net coolant-flood => not.0.in
net not-coolant-flood <= not.0.out => halui.mdi-command-01
The following user(s) said Thank You: csurimilan

Please Log in or Create an account to join the conversation.

More
28 Nov 2024 20:26 #315489 by csurimilan
Thank you so much.

i just needed to add one little thing "addf not.0 base-thread" and with that adjustment its woking. :)

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.096 seconds
Powered by Kunena Forum