Skip to content

Function Blocks

FB_Component_XPU

(FINAL, extends FB_ComponentBase, implements I_XTS_Xpu)

Wrapper component for XPU TcCOM object and all of the children TcCOMs beneath.

Serves as a central point of management for movers and their assignment to I_XTS_InfoStation and the corresponding I_XTS_ApplicationStation.

Basic mover management functions are handled within and exposed via public methods.

Hardware diagnostic data is automatically collected and made available by property.

Retention of mover station assignments is optionally available via Persistent data or NOVRAM (if equipped). Automatic restoration of retained assignments on cold start is provided.

Example Reference Stations

See example reference stations for example station types which extend this function block.

Info

See I_XTS_Xpu for more information.

Properties

Property Type Access Description
MoverAssignmentStorageLocation E_MoverAssignmentRecoverySource RW Get/Set the location, if any, for retention of mover station assignments
PartCoEData ARRAY[1..TcIoXtsEnvironmentParameterList.MaxXtsPartsPerXpu] OF ARRAY[1..TcIoXtsEnvironmentParameterList.MaxModulesPerPart] OF ST_AT2xxxAllCoEData R Get diagnostic data from XPU/Hardware
State E_XTSState R Get the current state of the XPU
Stations ARRAY[0..TcIoXtsEnvironmentParameterList.MaxXtsInfoServer * TcIoXtsEnvironmentParameterList.MaxXtsInfoStation] OF I_XTS_ApplicationStation RW Get/Set interface pointers to assign application stations to InfoStations

Zero-based arrays

For internal purposes, many arrays in this library are zero-based. However, index 0 is never to be used. Always start at index 1.

Methods

Method Return Type Access Description
ClearMoverAssignments BOOL PUBLIC Returns TRUE if the Set() has been called on index i
Disable BOOL PUBLIC Returns TRUE when the entire tracking register has been cleared
Enable BOOL PUBLIC Clears the tracking register on index i and returns TRUE
Reset BOOL PUBLIC Sets the tracking register on index i and returns TRUE

ClearMoverAssignments

METHOD PUBLIC ClearMoverAssignments : BOOL

If enabled, mover station assignments are constantly being collected and persisted internally within the XPU component. This method allows you to clear these assignments.

Upon the next execution of Reset() the XPU component will automatically assign all movers to the next station in the positive direction whose configuration has the IsAQueueStation flag set.

Disable

METHOD PUBLIC Disable : BOOL

Disables all mover axes and dissolved the collision avoidance group.

Enable

METHOD PUBLIC Enable : BOOL

Enables all mover axes and adds them to the collision avoidance group. Enables the collision avoidance group.

Reset

METHOD PUBLIC Reset : BOOL

Disables all movers, clears any group/mover faults. If the mover station assignment recovery process has not yet been performed, or ClearMoverAssignments() was previously called, the XPU component will automatically assign all movers to the next station in the positive direction whose configuration has the IsAQueueStation flag set.

FB_MoverQueue

Helper function block that holds a buffer of I_XTS_Mover for use by applications stations. Assignment of movers from one station to the next happens internal to the XPU. Application stations should use the properties listed below to gain access to specific movers for motion commands.

Properties

Property Type Access Description
Count UDINT R Returns the number of I_XTS_Mover currently in the buffer
FirstMover I_XTS_Mover R Returns an interface pointer to the first mover in the buffer
LastMover I_XTS_Mover R Returns an interface pointer to the last mover in the buffer
MoverIDs ARRAY[1..TcIoXtsEnvironmentParameterList.MaxXtsMoversPerXpu] OF UDINT R Returns the mover IDs of all mover currently in the buffer
Queue ARRAY[0..TcIoXtsEnvironmentParameterList.MaxXtsMoversPerXpu] OF I_XTS_Mover R Returns an array of interface pointers representing all movers in the buffer

Methods

Method Return Type Access Description
Clear BOOL PUBLIC Clears all movers from the buffer
Dequeue null PUBLIC Returns TRUE when the first mover in the buffer has been removed
Enqueue BOOL PUBLIC Returns TRUE when a mover has been added to the buffer (FIFO)

These methods are used internally!

The methods listed above are called internally by the XPU and should never need to be called by application stations!

FB_TrackingRegister_Movers

Helper function block used to track different operations performed on movers.

Why would I want this?

The calling pattern for motion methods on movers is "returns TRUE when the command has been accepted". This is not the same as "command complete".

Take for example a collection of movers you want to move to a position on the track. Calling MoveAbsoluteCA() on all of them simultaneously will return TRUE right away (assuming they were all ready to move) but they won't finish at the same time. So we need some mechanism to call the command on all of the movers until it is accepted by all and then wait for the movement to be complete in a separate state. This function block serves that purpose.

Properties

Property Type Access Description
NumberCompleted UDINT R Returns the number of movers that Set() has been called for

Methods

Method Return Type Access Description
Check BOOL PUBLIC Returns TRUE if the Set() has been called on index i
Clear BOOL PUBLIC Returns TRUE when the entire tracking register has been cleared
Reset BOOL PUBLIC Clears the tracking register on index i and returns TRUE
Set BOOL PUBLIC Sets the tracking register on index i and returns TRUE

FB_XTS_StationBase

(abstract, extends FB_PackML_BaseModule, implements I_XTS_ApplicationStation)

Provides a basic implementation of I_XTS_ApplicationStation. Being ABSTRACT, this function block must be extended and cannot be instantiated directly. The default behavior can be overridden by its descendants.

Example Reference Stations

See example reference stations for example station types which extend this function block.

Properties

Property Type Access Description
NumberOfAssignedMovers UDINT R Returns the number of movers currently assigned to this station
NumberOfStops UDINT R Returns the number stop positions for this station
StopPositions REFERENCE TO ARRAY[1..TcIoXtsEnvironmentParameterList.MaxXtsStopPositionsPerStation] OF LREAL R Returns all stop position locations

Stop Positions cannot be commanded as-is!

Stop Positions as defined by the XTS Configurator are relative to the Start Position of the station. This Start Position is relative to the datum of the assigned Part. Move commands require positions that are relative to the Track that the mover is assigned to.

🤯

In order to tranform a station Stop Position into a usable Track position use GetStopPosition().

1
2
3
4
5
6
7
//Get the track position of the first stop position
StopPosition := GetStopPosition(StopPositions[1]);

//Send the last mover in line there
IF MoverQueue.LastMover.MoveAbsoluteCA(StopPosition, TRUE, FALSE) THEN
    //Do stuff
END_IF

Methods

Method Return Type Access Description
GetMovers BOOL PROTECTED Requests movers from upstream neighbor and commands each to its respective Stop Position. Returns TRUE when NumberOfAssignedMovers = NumberOfStops and all movers are in position
GetStopPosition LREAL PROTECTED Returns the corresponding Track position for a given stop position

Default Behavior

The descendants of this function block are meant to be registered as Equipment Modules with a Machine Module and thus implement the PackML state machine. Not all PackML states are required for basic station operation. The states where custom logic was implemented are described below.

PackML

See SPT_Base_Types for more information.

Resetting

Determines if any movers have already been assigned to this station and commands them to move to their respective stop position. When all movers have arrived at their stop positions, the state is complete.

Stopping

Waits for all assigned movers to be stopped, after which the state is complete. This state does not command a stop. Rather, it allows any in-progress move commands to complete.

Execute

Descendants of this base function block should implement their own logic in Execute(). No logic is provided in this base function block.