I need a Popup window

Post anything you want to discuss with others about the software.

I need a Popup window

Postby PillyWilly » Sun Feb 24, 2019 6:23 pm

Hi

I have fitted a SMC vacuum switch to my CNC, it triggers the reset button at a defined vacuum limit. All works just fine.

I would love to have a message appear on the screen telling me that it is a vacuum related "emergency" and not a simple limit, or reset button stop.

Is this possible? the switch triggers pin 10 on port 3.

Regards
Jan
PillyWilly
 
Posts: 76
Joined: Wed Oct 25, 2017 6:29 pm

Re: I need a Popup window

Postby Robertspark » Sun Feb 24, 2019 6:28 pm

When the message appears on screen what do you want it to do?

Just appear or to stop motion
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: I need a Popup window

Postby PillyWilly » Sun Feb 24, 2019 6:32 pm

Robertspark wrote:When the message appears on screen what do you want it to do?

Just appear or to stop motion


The motion is stopped (triggered by the switch) so I just need the message, with an "OK" button to make it disappear.
PillyWilly
 
Posts: 76
Joined: Wed Oct 25, 2017 6:29 pm

Re: I need a Popup window

Postby Robertspark » Sun Feb 24, 2019 8:59 pm

PillyWilly wrote:The motion is stopped (triggered by the switch) so I just need the message, with an "OK" button to make it disappear.


HOW??

A) Do you have a macropump monitoring that pin?

Or

B) Are you using the IO Trigger to trigger a Function (M-code) to stop motion?

If (A), change your macropump to the following >>
Code: Select all
bool flagset = false;

while(loop)
{
   if (AS3.GetLED(95) && !flagset) // OutputPT3PN10
   {
   MessageBox.Show("VACCUM TRIP, \nmotion stopped!!! \n\nClear MessageBox via OK and then Clear Reset", "Warning!!!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
   
   flagset = true;
   
   exec.Stop();
   return;
   }
   if (!AS3.GetLED(95) && flagset) // OutputPT3PN10
   {
   flagset = false;
   return;
   }
}


Note: you may have to change
AS3.GetLED(95) && !flagset >> !AS3.GetLED(95) && !flagset
AND
!AS3.GetLED(95) && flagset >> AS3.GetLED(95) && flagset
this depends if your setting for port3/pin10 is active high or low.

If (B), change your macro to the following >>
Code: Select all
MessageBox.Show("VACCUM TRIP, \nmotion stopped!!! \n\nClear MessageBox via OK and then Clear Reset", "Warning!!!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);

exec.Stop();
return;


The problem is, if you are triggering a RESET / E-STOP then no macros will run after that .... so the macroloop needs to trigger the message on screen FIRST and then trigger the stop() method.

This is more important with RESET than it is with STOP but again as you were not clear if you were using RESET (e-stop) or STOP(), I've gone with the worst case scenario.... the sequence is right and it works on my test rig.
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: I need a Popup window

Postby PillyWilly » Sun Feb 24, 2019 9:29 pm

I'm using the I/O trigger to do it.
I havent written a macro, just calling function 512 as I recall it.
PillyWilly
 
Posts: 76
Joined: Wed Oct 25, 2017 6:29 pm


Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: No registered users and 14 guests