Recover Method
Description
Recover moves the robot back to the position is was in when the safeguard was open.
Syntax
Function Recover () As Boolean
Remarks
The Recover method can be used after the safeguard is closed to turn on the robot motors and slowly move the robot back to the position it was in when the safeguard was open. After Recover has completed successfully, you can execute the Cont method to continue the cycle. If Recover was completed successfully, it will return True. Recover will return False if a pause, abort, or safeguard open occurred during recover motion.
Return Value
True if the recover motion was completed, False if not.
See Also
Continue Method, Pause Method
Recover Example
VB Examples:
This example executes a recover, then continue
Sub btnCont_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnCont.Click
Dim sts As Boolean
Dim answer As Integer
sts = m_spel.Recover()
If sts = False Then
Exit Sub
End If
answer = MsgBox("Ready to continue?", vbYesNo)
If answer = vbYes Then
m_spel.Continue()
EndIF
End sub
In the example below, the cycle continues after recover is run. This example shows how the recover action is run as long as the button is held down. If the button is released during the recover motion, a pause is issued and recover is aborted. If the button is held down until recover has completed, then a message is displayed.
Sub btnRecover_MouseDown( _
ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles btnRecover.MouseDown
Dim sts As Boolean
sts = m_spel.Recover()
If sts = True Then
MsgBox("Recover complete")
EndIf
End Sub
Sub btnRecover_MouseUp( _
ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles btnRecover.MouseUp
m_spel.Pause()
End Sub
C# Example:
This example executes a recover, then continue
void btnCont_Click(object sender, EventArgs e)
{
bool sts;
DialogResult answer;
sts = m_spel.Recover();
if (sts == true){
answer = MessageBox.Show("Continue?", "",
MessageBoxButtons.YesNo);
If (answer == DialogResult.Yes)
m_spel.Continue();
}
}
In the example below, the cycle continues after recover is run. This example shows how the recover action is run as long as the button is held down. If the button is released during the recover motion, a pause is issued and recover is aborted. If the button is held down until recover has completed, then a message is displayed.
void btnCont_Click(object sender, EventArgs e)
{
bool sts;
sts = m_spel.Recover();
if (sts == true)
MessageBox.Show("Recover complete");
}
void btnRecover_MouseUp(oject sender, EventArgs e)
{
m_spel.Pause();
}