IO data for the McePosTable function.
Version history
0.3.1
Changes
- state machine step list
show full history
0.3.0
Changes
- Input
aConditions - Output
bWaitForStep
0.2.0
Changes
- Input
nAbortingMode
- Rename
nPosTableModetonMode - Variable type of
nSmPosTablefromUINTtoINT
- Input
bReset
0.1.0-beta
Changes
- first version
Overview
| name | type | default | comment |
|---|---|---|---|
| nRobotNumber | USINT | 0 | input: motion device targeted by this function [0 to 3] |
| bSystemReady | BOOL | 0 | input: system ready for running motion commands |
| bRun | BOOL | input: run PosTable. Reset PosTable when False | |
| bStep | BOOL | input: trigger next step | |
| bRecalcQA | BOOL | input: recalculate QA (queueing amount) | |
| nAbortingMode | SINT | 0 | input: select aborting mode [0=controlled stop, 1=immediate reset of PosTable] |
| nMode | SINT | 0 | input: PosTable operation mode [0=with blending, 1=not blending, 2=single motion (wait for step after each motion)] |
| nNrOfCycles | INT | 1 | input: for setting the number of cycles for the PosTable [0=repeat forever, 1=single cycle, >1=n cycles] |
| aConditions | ARRAY [0..GVL.CONDITIONS_UBOUND] OF BOOL | input: conditions state | |
| bCustomActionDone | BOOL | input: custom action at standstill done | |
| bActionStart | BOOL | output: start action at standstill | |
| nActionID | INT | output: action with standstill [0=none, 1-19=built-in action, >19=custom action] | |
| aMissingConditions | ARRAY [0..GVL.CONDITIONS_UBOUND] OF BOOL | output: conditions preventing the trajectory to continue | |
| nPercentComplete | SINT | output: Percentage of motion that is completed (for active motion command) | |
| nStateTime | DINT | output: elapsed time in current state [ms] | |
| bIdle | BOOL | output: state machine: idle | |
| bBusy | BOOL | output: state machine: busy | |
| bWaitForStep | BOOL | output: Wait for user bStep trigger | |
| bDone | BOOL | output: PosTable has completed the specified number of cycles | |
| bError | BOOL | output: state machine: error | |
| nErrorCode | UDINT | 0 | output: state machine error code |
| nSmPosTable | INT | 0 | in/out: state machine 1: PosTable |
| nIndex | INT | in/out: PosTable index for current motion | |
| nLoadIndex | INT | in/out: PosTable index for loading next motion(s) | |
| nCycleNr | INT | in/out: number of cycles ran by PosTable |
Details
nRobotNumber
USINTUsed as input
Specifies the motion device targeted by this function.
| value | explanation |
|---|---|
| 0-3 | Robot number (use MLxRobotGetProperties to see the mapping). |
bSystemReady
BOOLUsed as input
System ready for running motion commands.
This signal is produced by
MceStartStop
.
bRun
BOOLUsed as input
Run the PosTable trajectory.
In a normal scenario, bRun needs to stay True until PosTable has
completed (bDone).
Setting bRun to False will reset the PosTable:
nIndexandnLoadIndexare set to0nCycleNris resetbErroris reset
If bRun is set to False while the PosTable hasn’t finished yet,
it will abort PosTable and then reset.
The abort behavior is defined by
nAbortingMode
.
bStep
BOOLTrigger next step. This is typically required when running PosTable step-by-step.
The user is informed by the
bWaitForStep
output.
bRecalcQA
BOOLUsed as input
Manual trigger to recalculate the “queueing amount” (QA).
A use case is if an ActionID was removed while PosTable is running.
By executing a RecalcQA it will prevent a short standstill of the robot at
the entry where the action was removed.
nAbortingMode
SINTUsed as input
Select how the PosTable will be aborted when
bRun
becomes False while PosTable was still running.
| value | explanation |
|---|---|
| 0 | Controlled stop until standstill. It gently waits until the already buffered motions have finished. This is the prefered way. |
| 1 | Immediately reset PosTable. This breaks the active motion commands and can result in dangling commands in the MotoLogix command buffer. It would require an MLxReset to clean up things afterwards. |
nMode
SINTUsed as input
Specifies the PosTable operation mode.
A PosTable trajectory would normally be executed using motion blending, resulting in a fast and smooth trajectory. But sometimes (e.g. for testing purposes) you might want to run it without blending or even step-by-step. That is possible by setting the corresponding mode.
Changing mode from blending to another mode will first finish the
already buffered motions before the new mode is visible.
This effect can be seen as synchronizing nIndex to nLoadIndex.
| value | explanation |
|---|---|
| 0 | With blending (nLoadIndex will be ahead of nIndex) |
| 1 | Not blending (nLoadIndex = nIndex) |
| 2 | Single motion (wait for step after each motion) |
nNrOfCycles
INTUsed as input
Specifies number of cycles for the PosTable.
A PosTable trajectory would normally be executed just once. But sometimes you might want to run it a specific number of cycles, or even endless.
| value | explanation |
|---|---|
| 0 | Repeat forever |
| 1 | Single cycle |
| >1 | n cycles |
aConditions
ARRAY [0..GVL.CONDITIONS_UBOUND] OF BOOLEach aCondition bit can reflect the state of a sensor or the result of
a more complex boolean operation.
If one or several aStartCondition are used in a entry of PosTable,
the corresponding aCondition bit will be used to authorize the motion.
bCustomActionDone
BOOLUsed as input
If you are using custom actions then this is the handshake signal to tell PosTable that your custom action has finished. After this signal, PosTable will continue the trajectory.
bActionStart
BOOLUsed as output
State that the robot is in standstill and an ActionID is in process.
If you are using custom actions then this is the trigger to start your action.
nActionID
INTUsed as output
Current ActionID number, used as interface for running custom actions
which you program yourself outside of McePosTable.
| value | explanation |
|---|---|
| 0 | no active action |
| 1-19 | active default (built-in) action number |
| >=20 | active custom action number |
aMissingConditions
ARRAY [0..GVL.CONDITIONS_UBOUND] OF BOOLConditions preventing the trajectory to continue.
Check the corresponding aConditions to know which input has paused the
trajectory.
If all conditions are satisfied or if no conditions are used, all bits are set to
False.
nPercentComplete
SINTUsed as output
Percentage of the current motion that is completed.
nStateTime
DINTUsed as output
Elapsed time in current state.
Value is in ms.
bIdle
BOOLbBusy
BOOLUsed as output
State machine in busy state.
bWaitForStep
BOOLUsed as output
System is waiting for a user
bstep
trigger.
bDone
BOOLUsed as output
PosTable has completed the specified number of cycles.
Stays True until PosTable is reset by switching
bRun
to False.
bError
BOOLUsed as output
State machine in error state. For details see
nErrorCode
.
nErrorCode
UDINTUsed as output
Details on the state machine error.
Format aa.bbb
| value | explanation |
|---|---|
| a | number of the state machine (1=first, 2=second etc.) |
| b | state where the error occured |
nSmPosTable
INTState machine 1: Run the trajectory of PosTable
| value | explanation |
|---|---|
| 0 | idle, not ready for start |
| 1 | idle, ready for start |
| 5 | wait for conditions |
| 10-29 | handle motion commands |
| 30 | waiting before performing action at standstill |
| 31 | perform action at standstill |
| 32 | waiting after performing action |
| 40 | cycle completed |
| 50 | waiting at end of cycle |
| 60 | reset cycle |
| 99 | state machine error |
nIndex
INTPosTable index for current motion.
State which entry is currently moving the robot.
nLoadIndex
INTPosTable index of the last loaded motion.
Useful to track the number of motions loaded in advance.
nCycleNr
INTNumber of cycles ran by PosTable.
Source code
Declarations
(*IO data for the McePosTable function*)
TYPE McePosTableIO :
(*
* -----------------------------------------------------------------------------
* Name : McePosTableIO
* Version : 0.3.1
* Date : 2025-06-03
* Author : Rioual
* Family : YaskawaMce
* Organisation : github.com/YaskawaEurope/mlx-examples
*
* -----------------------------------------------------------------------------
* IO data for the McePosTable function
* -----------------------------------------------------------------------------
*)
STRUCT
nRobotNumber : USINT := 0; (*input: motion device targeted by this function [0 to 3]*)
bSystemReady : BOOL := 0; (*input: system ready for running motion commands*)
bRun : BOOL; (*input: run PosTable. Reset PosTable when False*)
bStep : BOOL; (*input: trigger next step*)
bRecalcQA : BOOL; (*input: recalculate QA (queueing amount)*)
nAbortingMode : SINT := 0; (*input: select aborting mode [0=controlled stop, 1=immediate reset of PosTable]*)
nMode : SINT := 0; (*input: PosTable operation mode [0=with blending, 1=not blending, 2=single motion (wait for step after each motion)]*)
nNrOfCycles : INT := 1; (*input: for setting the number of cycles for the PosTable [0=repeat forever, 1=single cycle, >1=n cycles]*)
aConditions : ARRAY [0..GVL.CONDITIONS_UBOUND] OF BOOL; (*input: conditions state*)
bCustomActionDone : BOOL; (*input: custom action at standstill done*)
bActionStart : BOOL; (*output: start action at standstill*)
nActionID : INT; (*output: action with standstill [0=none, 1-19=built-in action, >19=custom action]*)
aMissingConditions : ARRAY [0..GVL.CONDITIONS_UBOUND] OF BOOL; (*output: conditions preventing the trajectory to continue*)
nPercentComplete : SINT; (*output: Percentage of motion that is completed (for active motion command)*)
nStateTime : DINT; (*output: elapsed time in current state [ms]*)
bIdle : BOOL; (*output: state machine: idle*)
bBusy : BOOL; (*output: state machine: busy*)
bWaitForStep : BOOL; (*output: Wait for user bStep trigger*)
bDone : BOOL; (*output: PosTable has completed the specified number of cycles*)
bError : BOOL; (*output: state machine: error*)
nErrorCode : UDINT := 0; (*output: state machine error code*)
nSmPosTable : INT := 0; (*in/out: state machine 1: PosTable*)
nIndex : INT; (*in/out: PosTable index for current motion*)
nLoadIndex : INT; (*in/out: PosTable index for loading next motion(s)*)
nCycleNr : INT; (*in/out: number of cycles ran by PosTable*)
END_STRUCT
END_TYPE