Read-only property. Returns the numeric error code associated with the latch object.
…latch_object.ErrorCode
Prerequisites
Requires that the Encoder Latching or Advanced Controls or Conveyor Tracking License be installed on the controller.
Parameters
None
Remarks
This property returns the number of any error associated with a latch object. A value of 0 indicates no error. A value < 0 indicates that an error occurred during latching. This read-only property is only meaningful if the optional no_exception parameter was set to True when the Latch.Result method was called to return the latch object. If no_exception was set to False, the returned object will always have a zero ErrorCode value. For a full listing of the defined ErrorCode values, please see the "System Error Codes" section of the PreciseFlex Library. For specific information on the most likely error codes, please see the documentation on Latch.Result.
Examples
Dim lat1 As Latch
lat1 = Latch.Result(1, True) ' Get latch event
If lat1.ErrorCode < 0 Then
Console.WriteLine("Latch error: " & CStr(lat1.ErrorCode))
End If
See Also