The following pages provide detailed information on the properties and methods of the Latch Class. This class, and its Latch Object instances, provide a means for GPL procedures to receive the results of latch events generated by digital input signals configured as latch inputs. These results allow a robot or belt position to be captured with high accuracy when a digital input value changes.
The Latch Class defines Latch Objects that contain the time when the latch occurred and the robot axis positions at that time. This class also includes methods and properties for accessing the queue of latch results, and for accessing the results themselves.
When a latch occurs, as specified by the Latch Input configuration, a Latch Object is created and placed in a queue. Each robot has an independent queue, kept in order of time, with the oldest objects first. All the axes of a robot are latched simultaneously, so the entire position and orientation of the robot is available.
Belts are a special case of robots and are normally configured as "encoder only" robots. Multiple belts or robots, or any combination of the two, may be latched simultaneously by a single latch input or independently by separate latch inputs. Each belt or robot may be latched by up to 12 different latch inputs.
The Latch Class allows a latch queue to be associated with a system thread event (see Thread Class, method WaitEvent) so that an event is sent to a thread whenever a new latch is placed in the queue. By waiting for events, a GPL thread may efficiently wait for latches to occur.
For a general discussion of Latches, please see the Controller Software > Introduction To The Software > Communications > Digital Inputs and Outputs > Latch Inputs section of the PreciseFlex™ PreciseFlex Library.
The table below summarizes the methods and properties that are described in greater detail in the following sections.
Member | Type | Description |
---|---|---|
Property |
Returns the latched value of the specified axis angle. Avoids creating a Location object. |
|
Shared Property |
Returns the number of latch results pending for a robot or conveyor belt. |
|
Property |
Returns the error code from a latch object. 0 means no error. |
|
Shared Method |
Flushes all latch results pending for a robot or conveyor belt. |
|
Method |
Returns a Location object containing the latched position, as a Cartesian value or a set of angles. |
|
Shared Method |
Removes the next latch result from the queue for a robot or belt and returns it as a Latch object. Returns Nothing if the queue is empty. Throws an exception if a result was lost due to an overflow. |
|
Property |
Returns the number of the digital input signal that generated the latch. |
|
Shared Property |
Associates a thread event with a robot or belt. The thread event gets set if the latch queue contains latch results or when new latch results are added. |
|
latch_object.Timestamp |
Property |
Returns the timestamp when the latch occurred as a Double value, consistent with the Controller.Timer property. |