McePosTableUpdateIndex

0.2.0

Update the PosTable Index.

This function must be called after finishing the current motion.

It also must be called before the first motion. In that case the FirstMove parameter must be True.

Version history

0.2.0

  Rioual

Changes

Changed:
  • Replace posTableMode by allowQueuing
Removed:
  • Input stopRequest
show full history

0.1.0-beta

  Rioual

Changes

Added:
  • initial version

Overview

kindnametypedefaultcomment
inputallowQueuingBOOLallow queuing the next motions
inputfirstMoveBOOLcalc first move after system was reset
inputstopAfterLastEntryBOOLcontinue to the start of PosTable when searching for the next Index and LoadIndex
in_outposTableMcePosTableDatatrajectory to be processed by PosTable
in_outQAINTallowed Queueing Amount; number of motions to queue (for smooth motion)
in_outlastEntryBOOLlast entry in process
in_outstopEntryBOOLentry with robot standstill (Action > 0) in process
in_outindexINTPosTable index for current motion

Details

allowQueuing

BOOL

Allow queuing the next motions.

valueexplanation
0QA is decreased at the end of each motion until 0
1QA is updated depending on the number of remaining entries until standstill

firstMove

BOOL

Must be True when calculating the first motion of the PosTable.

False otherwise.

stopAfterLastEntry

BOOL

Continue to the start of PosTable when searching for the next Index and LoadIndex if False.

Trajectory to be processed by PosTable.

QA

INT

The Queueing Amount is the number of motions allowed to be queued.

Queueing motion in advance is necessary for smooth motion.

lastEntry

BOOL

True if the last valid entry of the PosTable is in process.

stopEntry

BOOL

True if the current entry of the PosTable ends in a standstill. This means that an ActionID will be performed at the end of motion.

index

INT

The PosTable index is updated by this function.

Source code

Declarations

(*Update the PosTable Index*)
FUNCTION McePosTableUpdateIndex

(*
 * -----------------------------------------------------------------------------
 * Name               : McePosTableUpdateIndex
 * Version            : 0.2.0
 * Date               : 2024-02-29
 * Author             : Rioual
 * Family             : YaskawaMce
 * Organisation       : github.com/YaskawaEurope/mlx-examples
 * 
 * -----------------------------------------------------------------------------
 * Update the PosTable Index
 * -----------------------------------------------------------------------------
 *)

VAR_INPUT
  allowQueuing : BOOL; (*allow queuing the next motions*)
  firstMove : BOOL; (*calc first move after system was reset*)
  stopAfterLastEntry : BOOL; (*continue to the start of PosTable when searching for the next Index and LoadIndex*)
END_VAR

VAR_IN_OUT
  posTable : McePosTableData; (*trajectory to be processed by PosTable*)
  QA : INT; (*allowed Queueing Amount; number of motions to queue (for smooth motion)*)
  lastEntry : BOOL; (*last entry in process*)
  stopEntry : BOOL; (*entry with robot standstill (Action > 0) in process*)
  index : INT; (*PosTable index for current motion*)
END_VAR

VAR
  nPosTableSize : INT; (*number of entries*)
  nEntriesRemaining : INT; (*number of entries remaining*)
END_VAR

Logic

nPosTableSize := UINT_TO_INT(SIZEOF(posTable) / SIZEOF(posTable.stEntry[0]));


// -----------------------------------------------------------------------------
// update index
// -----------------------------------------------------------------------------
// update index to the next valid PosTableEntry
IF firstMove THEN
  // just validate the current index on the first move
  index := McePosTableFindEntry(index, 0, nPosTableSize, TRUE, posTable);
ELSE
  // increase the index
  index := McePosTableFindEntry(index, 1, nPosTableSize, TRUE, posTable);
END_IF;

// -----------------------------------------------------------------------------
// calculate Queueing Amount (allowed number of motions to be queued)
// -----------------------------------------------------------------------------
McePosTableRecalcQA(allowQueuing := allowQueuing,
                    firstMove := firstMove,
                    stopAfterLastEntry := stopAfterLastEntry,
                    posTable := posTable,
                    QA := QA,
                    lastEntry := lastEntry,
                    stopEntry := stopEntry,
                    index := index
                    );

Implementation

Snippet of the function call:
McePosTableUpdateIndex(
  allowQueuing := , 
  firstMove := , 
  stopAfterLastEntry := , 
  posTable := , 
  QA := , 
  lastEntry := , 
  stopEntry := , 
  index := );

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