Using system EStop events

You can catch the system EStop events in the EventReceived handler in your Visual Basic application.

Imports RCAPINet.Spel  
  
Private Sub m_spel_EventReceived(ByVal sender As Object, ByVal e As SpelEventArgs) Handles m_spel.EventReceived  
    Select Case e.Event  
        Case RCAPINet.SpelEvens.EstopOn  
            MsgBox "E-Stop detected"  
            gEStop = True  
            lblEStop.BackColor = Color.Red  
            lblEStop.Text = "EStop ON"  
        Case RCAPINet.SpelEvents.EstopOff  
            gEStop = False  
            lblEStop.BackColor = Color.Green  
            lblEStop.Text = "EStop OFF"  
    End Select  
End Sub  

You can catch the system EStop events in the EventReceived handler in your C# application.

private void m_spel_EventReceived(object sender, SpelEventArgs e)  
{  
switch(e.Event)  
       {  
        case SpelEvents.EstopOn:  
            MessageBox.Show("E-Stop detected");  
            gEStop = true;  
            lblEStop.BackColor = Color.Red;  
            lblEStop.Text = "EStop ON";  
        case SpelEvents.EstopOff:  
            gEStop = false;  
            lblEStop.BackColor = Color.Green;  
            lblEStop.Text = "EStop OFF";  
        }  
}