FC_UpdateCmdTableListElementSimpleOne - General Information

Overview

Type:

Function

Available as of:

V1.1.0.0

Support for:

PacDrive pilot template architecture

Task

Function for updating the command table list.

Description

This function updates the pointer of a table within a list of tables. A command table is an ordered list of commands used to direct the actions of individual axis or groups of axes.

The function searches in the list i_pstListOfCmdTables from 1 to i_udiNumberOfCmdTables for the i_diCmd and updates the pointer pstCmdTable in the list with i_pstCmdTable.

This update must be performed if an online change takes place. If the input i_xOnlineChange is set TRUE it is recognized by the function block. As default, the output of the FB_DetectOnlineChange function block should be connected to the i_xOnlineChange input.

Interface

Input

Data type

Description

i_xOnlineChange

BOOL

The command table list is updated when TRUE

i_udiNumberOfCmdTables

UDINT

Specifies the quantity of command tables

i_pstListOfCmdTables

POINTER TO ST_CmdTable

Specifies a pointer to the command table list

Output

Data type

Description

q_etDiag

GD.ET_Diag

General, library-independent statement on the diagnostic.

A value unequal to GD.ET_Diag.Ok corresponds to a diagnostic message.

q_etDiagExt

ET_DiagExt

POU-specific output on the diagnostic.

q_etDiag = GD.ET_Diag.Ok -> status message

q_etDiag <> GD.ET_Diag.Ok -> diagnostic message

Input/Output

Data type

Description

iq_stCmdTable

ST_CmdTableTpi

Specifies a command table to add/update.

Return Value

Data type

Description

BOOL

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

InputParameterInvalid

CmdRange

35

A command is outside the valid range.

InputParameterInvalid

NumberOfCmdTablesRange

34

The number of command tables is outside the valid range.

InputParameterInvalid

PointerCmdTableInvalid

36

The pointer onto CmdTable is invalid.

InputParameterInvalid

PointerListOfCmdTablesInvalid

33

The pointer onto ListOfCmdTables is invalid.

CmdRange

Enumeration name:

CmdRange

Enumeration value:

35

Description:

A command is outside the valid range.

Issue

Cause

Solution

-

A value <= 0 was applied at the i_diCmd input.

Make certain that a positive value is transferred according to the command of the table to be updated at the i_diCmd input.

NumberOfCmdTablesRange

Enumeration name:

NumberOfCmdTablesRange

Enumeration value:

34

Description:

The number of command tables is outside the valid range.

Issue

Cause

Solution

-

At the i_udiNumberOfCmdTables input a value <= 0 has been applied.

Make certain that at the i_udiNumberOfCmdTables input a positive value according to the number of command tables is transferred in the list at the i_pstListOfCmdTables input.

PointerCmdTableInvalid

Enumeration name:

PointerCmdTableInvalid

Enumeration value:

36

Description:

The pointer onto CmdTable is invalid.

Issue

Cause

Solution

-

An uninitialized pointer (0) was transferred at the i_pstCmdTable input.

Make certain that at the i_pstCmdTable input a value greater than 0 is transferred which corresponds to the address of the command table with which the list is to be updated.

PointerListOfCmdTablesInvalid

Enumeration name:

PointerListOfCmdTablesInvalid

Enumeration value:

33

Description:

The pointer onto ListOfCmdTables is invalid.

Issue

Cause

Solution

-

An uninitialized pointer (0) was transferred at the i_pstListofCMDTables input.

Make certain that at the i_pstListofCMDTables input a value greater than 0 is transferred which corresponds to the address of the list of command tables that is to be updated.