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.