Translations of this page:

User Tools

Site Tools


Sidebar

MyCNC Shop

MyCNC website

myCNC Price List

mycnc:popup_messages

Popup messages

This is an expanded manual that serves to introduce the user to the concept of popup messages beyond the basics described in the MyCNC Configuration Dialogs manual.

The following settings are available:

  • Popup Message Number
  • Position (X&Y) on the screen
  • Size of the popup window (in pixels)
  • Header (title) of the popup message
  • Header size and font size
  • Message (body) of the popup window which allows to present additional information to the user
  • Message size and font size
  • Footer of the popup message
  • Footer size and font size
  • Button image (specify the file location)
  • Button size
  • Button action to run a specific macro when the button is clicked
  • Timeout to hide the popup window (in seconds)
  • Variable number to display (usually in footer, through [%d]) - useful to display a changing variable, like time in seconds, etc.
  • 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:

gvarset(9160,1);

or by using a G-code command (for example, within a macro) such as

G10 L80 P9160 Q1

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 “Manual Tool Change” message, then waits in a loop till tool changed. There can be a software flag (global variable register) indicating tool changed or 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:

main()
{
  gvarset(1999,1); //set flag
  
  timer=0;
  flag=1;
  do{
    timer++;
    if ((timer&0xff)==0) //check every 0.25 sec
    {
      gvarset(9160,1); //show the Manual Tool Change Message #60
      flag=gvarget(1999); //check the flag, if flag<=0, then tool changed and a job should be resumed
    };
 
  }while(flag>0);

  gvarset(9160,0); //clear the Message
  exit(99);
};

Setup for message #60 in Settings > Config > Screen > Popup Messages:

Resulting popup message:

M604

#include pins.h
main()
{
  //clamp new tool
  portclr(OUTPUT_TOOL_CLAMP);

  timer=300;do{timer--;}while(timer>0);

  timer=2000;
  do
  {
    timer--;
    t=portget(INPUT_TOOL_CLAMPED);// 5
    if (t!=0)
    {
      exit(99);
    };
  }while(timer>0);

  gvarset(9124,1);
  timer=20;do{timer--;}while(timer>0);

  message=PLCCMD_MOTION_BREAK;
  timer=20;do{timer--;}while(timer>0);


  exit(99);
};
mycnc/popup_messages.txt · Last modified: 2020/05/28 12:26 by ivan