mycnc:popup_messages
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
mycnc:popup_messages [2020/05/19 14:10] – ivan | mycnc:popup_messages [2020/05/25 11:13] – ivan | ||
---|---|---|---|
Line 25: | Line 25: | ||
* Coefficient K to multiply the variable by. Useful to convert tiny incremental changes (such as fractions of a second) or large rapidly changing numbers into numbers that can be easily read by the user. | * Coefficient K to multiply the variable by. Useful to convert tiny incremental changes (such as fractions of a second) or large rapidly changing numbers into numbers that can be easily read by the user. | ||
+ | Popup messages are controlled by writing a **1** or a **0** into global variables #9100-9163 (1 to bring up the popup, 0 to close it). Therefore, the user can set up to 64 possible popup messages within the myCNC software by going into Settings > Config > Screen > Popup Messages and assigning the necessary messages there. Afterwards, the message can be brought up either through a PLC procedure, like so: | ||
+ | |||
+ | < | ||
+ | |||
+ | or by using a G-code command (for example, within a macro) such as | ||
+ | |||
+ | < | ||
+ | |||
+ | which will write a 1 in the global variable #9160. | ||
+ | |||
+ | ====Examples of popup messages implementation==== | ||
+ | |||
+ | ===M660=== | ||
+ | |||
+ | M660 PLC procedure is supposed to be a handler for manual tool change. It shows a " | ||
+ | the procedure can wait till a hardware button (connected to the controller input) is pressed. Below is an example of a manual tool change handler M660.plc: | ||
+ | |||
+ | < | ||
+ | { | ||
+ | gvarset(1999, | ||
+ | | ||
+ | timer=0; | ||
+ | flag=1; | ||
+ | do{ | ||
+ | timer++; | ||
+ | if ((timer& | ||
+ | { | ||
+ | gvarset(9160, | ||
+ | flag=gvarget(1999); | ||
+ | }; | ||
+ | |||
+ | }while(flag> | ||
+ | |||
+ | gvarset(9160, | ||
+ | exit(99); | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | Setup for message #60 in Settings > Config > Screen > Popup Messages: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Resulting popup message: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ===M604=== | ||
+ | |||
+ | < | ||
+ | main() | ||
+ | { | ||
+ | //clamp new tool | ||
+ | portclr(OUTPUT_TOOL_CLAMP); | ||
+ | |||
+ | timer=300; | ||
+ | |||
+ | timer=2000; | ||
+ | do | ||
+ | { | ||
+ | timer--; | ||
+ | t=portget(INPUT_TOOL_CLAMPED);// | ||
+ | if (t!=0) | ||
+ | { | ||
+ | exit(99); | ||
+ | }; | ||
+ | }while(timer> | ||
+ | |||
+ | gvarset(9124, | ||
+ | timer=20; | ||
+ | |||
+ | message=PLCCMD_MOTION_BREAK; | ||
+ | timer=20; | ||
+ | |||
+ | |||
+ | exit(99); | ||
+ | };</ |
mycnc/popup_messages.txt · Last modified: 2020/11/19 11:59 by ivan