Track Object
The track object contains functionality used for track management (switching movers between different tracks). In includes functionality for:
- Attaching a track hardware ID number to this object
- Assigning a user-friendly numerical TrackID for use in code
- Finding and addressing all movers on a track
Use
Tracks are a software defined group of motor modules that can be grouped together independently of the physical machine layout. Tracks allow you to switch movers between different groups of otherwise disconnected motor modules. A common use case is an oval system layout with a reject spur. Movers typically travel around the oval during normal production, but stop at a track "switch" which moves between the oval and a separate reject spur.
The track object is only necessary when using track management. For most applications that utilize a single, closed loop track the Track object does not need to be addressed directly. Movers, zones, stations and position triggers all reference a track internally but are set with defaults of TrackID 1 which is generated automatically by the configuration tool.
Setup
It is recommended, but not required, to declare Tracks as an array. Starting at the zero index is also recommended.
1 2 |
|
OTCID is found in System > TcCOM Objects > XTS Processing Unit 1 > Track # and is labeled Object ID on the Object tab. Note that the value displayed uses the "0x" hex notation, but needs to be entered using "16#" hex notation in the code.
For simplicity the ID should match the array index. This application already includes code that assigns the ID to match the array index of the track.
1 2 3 4 |
|
Use
Tracks are used in three ways in software:
- Parameters to other objects
- Managing movers on a track
- Properties of a mover
Tracks as parameters
When configuring a Station, Zone or Position trigger a TrackID can be attached to each. If you are not using track management, a default TrackID is assigned to these objects that will allow them to work without explicitly assigning a TrackID.
Stations, Zones and Position Triggers will only return or act on movers that are assigned to the same track as the object's TrackId
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Tracks managing movers
Tracks maintain a MoverList that can be used to track and query the movers on the track. See the MoverList object for complete details. Some common use cases are shown below
1 2 3 4 5 6 7 8 9 |
|
Properties of a mover
Every mover is assigned to a track. Movers can only move to stations and positions on the track they are currently assigned to.
See the property Mover for additional information.
Mover Direction Considerations
When using tracks where some are closed loops (ovals) and others are not (spurs), it is important to pay attention to the direction mode of the mover with Mover.SetDirection()
. By default this is set to mcDirectionPositive
which works well for ovals and will automatically wrap positions (modulo) as the mover reaches the rollover point.
When a non-closed section of track is used (such as a rework spur), the mover commands Mover.MoveToPosition
and Mover.MoveToStation
as well as the related commands in a MoverList
do not work with the default direction. When a mover is switched to a non-closed track, Mover.SetDirection(mcDirectionNonModulo)
should also be called to set the mover's positioning to absolute along this portion of the track. Then when transitioning back to a closed section of track Mover.SetDirection(mcDirectionPositive)
should be called to revert to the default modulo operation.
Methods
The methods listed below are used internally within the base code and should not be called directly by the user. They are shown for completeness.
RegisterMover
RegisterMover( NewMover : REFERENCE TO Mover )
This is used internally by Mover.TrackCyclic()
UnregisterAll
UnregisterAll( )
This is used internally by the Track Object
UnregisterMover
unRegisterMover( RemovingMover : REFERENCE TO Mover)
This is used internally by Mover.TrackCyclic()
Properties
CurrentMoverList
MoverList (Read Only)
Provides a MoverList object reference, containing all Movers that are currently assigned to this track. As a MoverList, methods are provided to command all movers as a group. See MoverList for more information
CurrentMoverCount
DINT (Read Only)
Returns the count of movers currently assigned to this track
Id
DINT
Stores the user-friendly numeric track identifier.
This property is read/write, but should only be written once during initialization and should not change during execution. It is provided for querying and comparing TrackIds between objects.
OTCID
OTCID
Stores the hardware id of the track object found in XTSProcessingUnit 1
This property is read/write, but should only be written once during initialization and should not change during execution. It is used internally by Mover.ActivateTrack()