Table of Contents
Show Custom Message Box from PLC
In order to create a custom popup window in myCNC software for an event like an emergency button press, a software PLC procedure can be added to the myCNC software for the user's specific needs and requirements. In order to do so, go to CNC Settings > PLC > Software PLC, then create a new popup window following the instructions below:
1. Press the Create New button in the Software PLC window
2. Name your new window and press the Confirm button
At this point, the popup window's code must be edited to appear when a specific event occurs.
4. Copy and paste the following code into the window instead of the window's current contents, then click Save and Build All again in order to trigger the PLC disk image reflashing process:
main() { do { if (portget(3)!=0) //Port 3 is used here. Use the actual port number for your particular setup { gvarset(9101,1); //Brings up window 01. Windows 01 through 63 can be assigned to a different trigger action such as a port set/clear, etc }; }while(1); };
5. In order to insert information into this popup window, we can open CNC Settings > Screen > Popup Messages, and then press Create New
6. Fill in the information regarding your new popup window and press the Save button. The Hide Timeout field is in seconds (specifies the amount of time that the message box will be present on the screen for).
At this point, whenever the selected port will send a message to a controller (for example, when a button is pressed), the software should bring up a popup window that will go away after the number of seconds specified in the Hide Timeout field.