Project Overview
Broad Concept
The core concept driving the project structure is that it is useful to address movers contextually as opposed to directly.
To illustrate, consider a scenario of recovering from an E-Stop where a robot is positioned directly in the path of the movers. In this instance, a first step might be to command any movers downstream of the robot to move further downstream, and movers upstream of the robot should be commanded further upstream in order to create some space for the arm to reset.
As a programmer, one wouldn't seek to specifically command Mover #4 and Mover #5 to carry out those instructions because during the next occurrence it may be an entirely different pair of movers in this situation. Instead, the commands are issued to whichever movers are closest to the robot right now.
In this sense, we take a list of all movers on the track system, and apply filters to help select only the movers we care to command. These filters are applied via a family of objects called Objectives.
Objectives
Objective is an umbrella term used by the project, that includes the following objects:
- Stations
- Zones
- SpeedTriggers
- PositionTriggers
- MoverLists
Each Objective defines a set criteria that a Mover can either fulfill or not at any given point. As an example, a Mover fulfills the criteria of a Station when it is parked at the Station's configured track position.
When a Mover satisfies the requirements of the Objective, the Objective provides a Reference to the Mover through which new Mover commands can be issued.
.CurrentMover
CurrentMover is the Reference output through which Movers can be addressed contextually via an Objective. Let's look at a simple example:
1 2 |
|
And as a Reference, this CurrentMover output accepts any Method call instructions that a base Mover object could. E.g.:
1 2 |
|
Common Methods
The objects listed above all share some common methods, which are implemented in the parent Objective base class.
RegisterMover
RegisterMover( NewMover : Mover )
Adds a Mover to the list of Tracked Movers that the objective is currently monitoring. If the input Mover has already been added to the Tracked Movers list, the method call is ignored.
1 2 |
|
The code above is similar in functionality to:
1 |
|
Stations include some unique features regarding mover registration. See Station Object for more details.
UnregisterMover
RegisterMover( ExistingMover : Mover )
Removes a Mover from the list of Tracked Movers that the objective is currently monitoring. If the input Mover is not already tracked by the objective, the method call is ignored.
1 2 |
|
Because the Mover would not be registered with the Station when it arrives, the Station would not report that the Mover is InPosition. The code above is functionally identical to:
1 |
|
UnregisterCurrent
UnregisterCurrent( )
Automatically unregisters whatever mover is listed as CurrentMover for the Objective
Here the MoverInPosition status output changes. The mover is still physically located at the Station position, but since it is no longer registered, it cannot report MoverInPosition.
1 2 3 |
|
1 2 3 4 |
|
---6
UnregisterAll
UnregisterAll()
Automatically unregisters every mover from the Tracked Movers list
1 2 3 4 |
|
Method Chaining
Most methods in the project return the current object itself, allowing for additional method calls on the same line of code. This approach is often referred to as a fluent interface. For example:
1 2 |
|
In some cases, the order of the methods calls must be carefully considered. In the following example, the CurrentMover of Station#0 is commanded to move to Station#1. At this point, it is no longer considered the CurrentMover of Station#0. As a result, the SetVelocity method does not apply to the intended Mover object.
1 2 3 4 |
|
However, the following example will work as intended:
1 2 3 4 |
|