Page 1 of 1

I need a Popup window

PostPosted: Sun Feb 24, 2019 6:23 pm
by PillyWilly
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

Re: I need a Popup window

PostPosted: Sun Feb 24, 2019 6:28 pm
by Robertspark
When the message appears on screen what do you want it to do?

Just appear or to stop motion

Re: I need a Popup window

PostPosted: Sun Feb 24, 2019 6:32 pm
by PillyWilly
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.

Re: I need a Popup window

PostPosted: Sun Feb 24, 2019 8:59 pm
by Robertspark
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.

Re: I need a Popup window

PostPosted: Sun Feb 24, 2019 9:29 pm
by PillyWilly
I'm using the I/O trigger to do it.
I havent written a macro, just calling function 512 as I recall it.