McePosTableIO

0.2.0

IO data for the McePosTable function.

Version history

0.2.0

  Rioual

Changes

Added:
  • Input nAbortingMode
Changed:
  • Rename nPosTableMode to nMode
  • Variable type of nSmPosTable from UINT to INT
Removed:
  • Input bReset
show full history

0.1.0-beta

  Rioual

Changes

Added:
  • first version

Overview

nametypedefaultcomment
nRobotNumberUSINT0input: motion device targeted by this function [0 to 3]
bSystemReadyBOOL0input: system ready for running motion commands
bRunBOOLinput: run PosTable. Reset PosTable when False
bStepBOOLinput: trigger next step
bRecalcQABOOLinput: recalculate QA (queueing amount)
nAbortingModeSINT0input: select aborting mode [0=controlled stop, 1=immediate reset of PosTable]
nModeSINT0input: PosTable operation mode [0=with blending, 1=not blending, 2=single motion (wait for step after each motion)]
nNrOfCyclesINT1input: for setting the number of cycles for the PosTable [0=repeat forever, 1=single cycle, >1=n cycles]
bCustomActionDoneBOOLinput: custom action at standstill done
bActionStartBOOLoutput: start action at standstill
nActionIDINToutput: action with standstill [0=none, 1-19=built-in action, >19=custom action]
nPercentCompleteSINToutput: Percentage of motion that is completed (for active motion command)
nStateTimeDINToutput: elapsed time in current state [ms]
bIdleBOOLoutput: state machine: idle
bBusyBOOLoutput: state machine: busy
bWaitForStepBOOLoutput: Wait for user bStep trigger
bDoneBOOLoutput: PosTable has completed the specified number of cycles
bErrorBOOLoutput: state machine: error
nErrorCodeUDINT0output: state machine error code
nSmPosTableINT0in/out: state machine 1: PosTable
nIndexINTin/out: PosTable index for current motion
nLoadIndexINTin/out: PosTable index for loading next motion(s)
nCycleNrINTin/out: number of cycles ran by PosTable

Details

nRobotNumber

USINT
(default: 0)

Used as input

Specifies the motion device targeted by this function.

valueexplanation
0-3Robot number (use MLxRobotGetProperties to see the mapping).

bSystemReady

BOOL
(default: 0)

Used as input

System ready for running motion commands. This signal is produced by MceStartStop .

bRun

BOOL

Used 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:

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

BOOL

Trigger next step. This is typically required when running PosTable step-by-step.

The user is informed by the bWaitForStep output.

bRecalcQA

BOOL

Used 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

SINT
(default: 0)

Used as input

Select how the PosTable will be aborted when bRun becomes False while PosTable was still running.

valueexplanation
0Controlled stop until standstill. It gently waits until the already buffered motions have finished. This is the prefered way.
1Immediately 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

SINT
(default: 0)

Used 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.

valueexplanation
0With blending (nLoadIndex will be ahead of nIndex)
1Not blending (nLoadIndex = nIndex)
2Single motion (wait for step after each motion)

nNrOfCycles

INT
(default: 1)

Used 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.

valueexplanation
0Repeat forever
1Single cycle
>1n cycles

bCustomActionDone

BOOL

Used 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

BOOL

Used 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

INT

Used as output

Current ActionID number, used as interface for running custom actions which you program yourself outside of McePosTable.

valueexplanation
0no active action
1-19active default (built-in) action number
>=20active custom action number

nPercentComplete

SINT

Used as output

Percentage of the current motion that is completed.

nStateTime

DINT

Used as output

Elapsed time in current state.

Value is in ms.

bIdle

BOOL

Used as output

State machine is in idle state.

Enable bRun to run PosTable.

bBusy

BOOL

Used as output

State machine in busy state.

bWaitForStep

BOOL

Used as output

System is waiting for a user bstep trigger.

bDone

BOOL

Used as output

PosTable has completed the specified number of cycles.

Stays True until PosTable is reset by switching bRun to False.

bError

BOOL

Used as output

State machine in error state. For details see nErrorCode .

nErrorCode

UDINT
(default: 0)

Used as output

Details on the state machine error.

Format aa.bbb

valueexplanation
anumber of the state machine (1=first, 2=second etc.)
bstate where the error occured

nSmPosTable

INT
(default: 0)

State machine 1: Run the trajectory of PosTable

valueexplanation
0idle, not ready for start
1idle, ready for start
10-29handle motion commands
30waiting before performing action at standstill
31perform action at standstill
40cycle completed
50waiting at end of cycle
60reset cycle
99state machine error

nIndex

INT

PosTable index for current motion.

State which entry is currently moving the robot.

nLoadIndex

INT

PosTable index of the last loaded motion.

Useful to track the number of motions loaded in advance.

nCycleNr

INT

Number of cycles ran by PosTable.

Source code

Declarations

(*IO data for the McePosTable function*)
TYPE McePosTableIO : 

(*
 * -----------------------------------------------------------------------------
 * Name               : McePosTableIO
 * Version            : 0.2.0
 * Date               : 2024-03-01
 * 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]*)
  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]*)
  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

Pages built with Hugo - 23 Apr 2024 11:54 CEST