User Tools

Site Tools


plc:plc_show_custom_message_box

This is an old revision of the document!


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 001-open-create-window.jpg

2. Name your new window and press the Confirm button 002-custom-box-name.jpg

3. Click Save and Build All 003-custom-box-save-build-all.jpg

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:

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 different tasks
};

}while(1);

};

5. In order to edit the newly created window, we can open CNC Settings > Screen > Popup Messages, and then press Create New 004-custom-box-save-popup-window-new.jpg

6. Fill in the information regarding your new popup window and press the Save button. The Hide Timeout field is in seconds. 005-custom-box-popup-window-info.jpg

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. 006-custom-box-popup-window-success.jpg

Deprecated version

plc/plc_show_custom_message_box.1558106410.txt.gz · Last modified: 2019/05/17 11:20 by ivan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki