WaitSw Method

Description
Waits for input bit status to change.

Syntax
Sub WaitSw (BitNumber As Integer, Condition As Boolean, Timeout As Single)
Sub WaitSw (Label As String, Condition As Boolean, Timeoutl As Single)

Parameters

  • BitNumber
    An integer expression indicating the input bit number.
  • Label
    A character string indicating the input bit label.
  • Condition
    A Boolean expression indicating the input bit state.
  • Timeout
    Maximum wait time (s)

Remarks
You should always check if a time out occurred by using the TW method. See the example below.

See Also
WaitMem Method

WaitSw Example
VB Example:

Const PartPresent = 1  
m_spel.WaitSw(PartPresent, True, 5)  
If m_spel.TW() Then  
    MsgBox "Part present time out occurred"  
End If  

C# Example:

const int PartPresent = 1;  
m_spel.WaitSw(PartPresent, True, 5);  
if (m_spel.TW())  
    MessageBox.Show("Part Present time out occurred”);