FB_ModuleControllerTpi - General Information

Overview

Type:

Function Block

Available as of:

V1.1.0.0

Support for:

PacDrive pilot template architecture

Task

Encapsulation of the FB_ModuleController POU.

Description

This function block will activate/deactivate the associated axis module function blocks when it is activated/deactivated. It is activated when the machine is activated (iq_stMachineItf.i_xEnable) and the output q_xActive indicates that the function block is activated and processing correctly.

The axes are specified via the i_pstSubModuleInterface input. The structure is passed as a pointer so only the structure’s starting address is passed instead of the whole structure. The AXM.FC_UpdateSubModuleInterfaceEight function is used to update each axis in the SubModuleInterface.

The primary purpose of this function block is to process command tables. A command table is an ordered list of commands used to direct the actions of individual axis or groups of axes.

The function block waits until it sees a change in the default module interface for the machine, specifically, either the diCMD or the diStartStep signals to initiate processing. Typically the iq_diCmd of the machine is changed at the beginning or the end of an operation mode. The StandardModuleInterface for the machine contains the signals for controlling the machine as a whole and is specified with the iq_stMachineItf input/output.

If iq_diCMD becomes unequal zero, then in the list of the command tables is searched for the specified iq_diCMD command table. It will then process the command table as follows:

  • Read the first command in the table, set the output q_xCmdActive and reset the output q_xCmdDone.

  • Send the command to the specified axis or to the axes specified by a group. The axes receive their commands through their iq_diCMD input contained in their sub module interface.

  • Wait until iq_diCMD becomes zero from the selected axes. This indicates the axes are finished processing their command.

  • Read next command in the table

  • Repeat everything until the table is processed completely, then set the output q_xCmdActive to FALSE and q_xCmdDone to TRUE.

Command tables can be created using the TPL.FC_InitCmdTableCmd, TPL.FC_InitCmdTableModule, and TPL.FC_InitCmdTable functions. Groups of axes are defined by the TPL.FC_InitCmdGroup function.

A list that contains the command tables is transferred via the i_pstListOfCmdTables input. The structure is passed as a pointer so only the structure’s starting address is passed instead of the whole structure. Individual command tables are added to the command table list with the TPL.FC_UpdateCmdTableListElementSimpleTen function. A list of all the existing groups is transferred via the i_pstSubModuleGroups input.

The internal status of the function block can be read at the output q_etDiag and the corresponding message at the q_sMsg output. Errors that have been detected are recorded in the global exception list that is written with the iq_stExceptionList input and in the global logging list which is determined with the iq_stLogDataList input.

This is a function block that will require an instance of it to be declared.

Interface

Input

Data type

Description

i_udiNumberOfSubModules

UDINT

Specifies the quantity of sub-modules contained by this module

i_udiNumberOfCmdTables

UDINT

Specifies the quantity of command tables

i_pstSubModulesItf

POINTER TO ST_StandardModuleInterface

Specifies the pointer to the default module interface for the axes

i_pstListofCmdTables

POINTER TO ST_CmdTable

Specifies the pointer to the command table list

i_pudiSubModuleGroups

POINTER TO UDINT

Specifies the pointer to the group list

i_xCancelTable

BOOL

Cancels the execution of a table in the case of a rising edge.

Output

Data type

Description

q_xActive

BOOL

Indicates the function block is enabled and processing correctly

q_xReady

BOOL

The POU is ready to receive jobs.

q_etDiag

GD.ET_Diag

Diagnostic class

q_etDiagExt

ET_DiagExt

Diagnostic message

q_sMsg

STRING[80]

Provides the results corresponding status message

q_xCmdActive

BOOL

Indicates a command is being processed.

q_xCmdDone

BOOL

Indicates the function block is idle or is finished processing a command table

q_diActiveStep

ET_DiagExt

Provides the last step number or the step currently executing

q_diCmdActive

DINT

Provides the last accepted command or the command currently executing.

q_udiActiveSubModule

UDINT

Provides the last module or group that received a command or the module or group currently receiving a command

q_xWaitForStartStep

BOOL

Indicates a paused command table

Input/Output

Data type

Description

iq_stMachineItf

ST_StandardModuleInterface

Specifies the default module interface for the machine

iq_stExceptionList

ST_ExceptionList

Specifies the global error detection list

iq_stLogDataList

ST_LogDataList

Specifies the global logging list

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

DeactivatingSubModules

38

The submodules are being disabled.

OK

ExecuteStep

40

Step is being executed.

OK

WaitAtNegativeStep

41

Waiting at a negative step.

OK

WaitCmdsDone

43

Waiting until commands are processed.

OK

WaitForCmd

39

Waiting for a command.

ExecutionAborted

CmdTimeout

108

A command was not processed within the defined time.

ExecutionAborted

MissingModuleCall

94

A call-up of a module is unavailable.

InputParameterInvalid

CmdOfListOfCmdTablesDuplicate

101

A command of the command table exists twice.

InputParameterInvalid

CmdOfListOfCmdTablesZero

100

A command of the command table is empty/zero.

InputParameterInvalid

CmdTableDublicatePointer

102

A pointer onto a command table exists twice.

InputParameterInvalid

CmdTableNoLastStep

107

The command table has no completion/last step.

InputParameterInvalid

GroupNumberInvalid

109

The number of a group is invalid.

InputParameterInvalid

ListOfCmdTablesInvalid

95

The list of the command table is invalid.

InputParameterInvalid

ModuleIdInvalid

67

The module ID is invalid.

InputParameterInvalid

NumberOfCmdStepsRange

98

The number of steps of a command is outside the valid range.

InputParameterInvalid

NumberOfCmdTablesRange

34

The number of command tables is outside the valid range.

InputParameterInvalid

NumberOfSubModulesRange

66

The number of submodules is outside the specified range

InputParameterInvalid

PointerCmdTableInvalid

36

The pointer onto CmdTable is invalid.

InputParameterInvalid

PointerListOfCmdTablesInvalid

33

The pointer onto ListOfCmdTables is invalid.

InputParameterInvalid

PointerSubModuleGroupsInvalid

104

The pointer onto SubModuleGroups is invalid.

InputParameterInvalid

PointerSubModulesItfInvalid

97

The pointer SubModulesItf is invalid

InputParameterInvalid

SizeOfListOfCmdTablesInvalid

99

Invalid size of the ListOfCmdTables.

InputParameterInvalid

SizeOfSubModuleGroupsInvalid

105

Invalid size of the SubModuleGroups.

InputParameterInvalid

SizeOfSubModulesItfInvalid

96

The size of the submodule interface is invalid

InputParameterInvalid

SubModuleItfNotInitialized

103

An interface of a submodule has not yet been initialized.

CmdOfListOfCmdTablesDuplicate

Enumeration name:

CmdOfListOfCmdTablesDuplicate

Enumeration value:

101

Description:

A command of the command table exists twice.

Issue

Cause

Solution

-

A command table from the list of i_pstListOfCmdTables is entered twice.

Make certain that each command table is unambiguously activated by a command.

Verify the use of the FC_NextCmdTable function when initializing the command tables.

CmdOfListOfCmdTablesZero

Enumeration name:

CmdOfListOfCmdTablesZero

Enumeration value:

100

Description:

A command of the command table is empty/zero.

Issue

Cause

Solution

-

A command table from the list of i_pstListOfCmdTables shall be activated by the command 0.

Verify the use of the FC_NextCmdTable function when initializing the command tables.

CmdTableDublicatePointer

Enumeration name:

CmdTableDublicatePointer

Enumeration value:

102

Description:

A pointer onto a command table exists twice.

Issue

Cause

Solution

-

In the list of the command tables at the i_pstListofCMDTables input, the pointers of two different command tables refer to the same command table.

Verify the initialization of the command tables. Use the FC_FirstCmdTable and FC_NextCmdTable functions to initialize the command tables.

CmdTableNoLastStep

Enumeration name:

CmdTableNoLastStep

Enumeration value:

107

Description:

The command table has no completion/last step.

Issue

Cause

Solution

-

The command table has no completion/last step.

Make certain that all command tables are completed with the FC_LastStep.

CmdTimeout

Enumeration name:

CmdTimeout

Enumeration value:

108

Description:

A command was not processed within the defined time.

Issue

Cause

Solution

-

The execution of a command took longer than specified in timTimeOu of ST_Cmd.

Increase the maximum execution time of the command by choosing a greater value for timTimeOut in the structure of the ST_Cmd command.

Search for the reasons of a long run time when executing the command.

DeactivatingSubModules

Enumeration name:

DeactivatingSubModules

Enumeration value:

38

Description:

The submodules are being disabled.

The submodules are disabled.

ExecuteStep

Enumeration name:

ExecuteStep

Enumeration value:

40

Description:

Step is being executed.

The pending process step is being executed.

GroupNumberInvalid

Enumeration name:

GroupNumberInvalid

Enumeration value:

109

Description:

The number of a group is invalid.

Issue

Cause

Solution

-

At udiModuleName of the ST_Cmd command a group number (udiModuleName - Gc_udiGroupOffset) smaller than 1 or greater than the number of the defined groups was applied.

Verify the group definition.

Verify the command definition.

-

At udiModuleName of the ST_Cmd command a group number (udiModuleName - Gc_udiGroupOffset) was applied. However, no group was defined.

Make certain that no more than Gc_udiGroupOffset submodules are applied under the equipment module.

Verify the command definition.

ListOfCmdTablesInvalid

Enumeration name:

ListOfCmdTablesInvalid

Enumeration value:

95

Description:

The list of the command table is invalid.

Issue

Cause

Solution

-

A command table was defined that does not contain any commands.

Make certain that all command tables contain at least one command.

An "empty" command table can be defined using the FC_FirstLastStepEmptyTable function.

MissingModuleCall

Enumeration name:

MissingModuleCall

Enumeration value:

94

Description:

A call-up of a module is unavailable.

Issue

Cause

Solution

-

A submodule is not called up.

Make certain that all submodules are called up cyclically.

-

A submodule does not update the q_dwModuleType value of the ST_StandardModuleInterface.

Make certain that all submodules announce their type.

ModuleIdInvalid

Enumeration name:

ModuleIdInvalid

Enumeration value:

67

Description:

The module ID is invalid.

Issue

Cause

Solution

-

The udiModuleName value of the ST_Cmd does not correspond to any number of the submodules.

Verify the initialization of the command tables.

-

The list of modules in a group contains the number which corresponds to none of the submodules.

Verify the definition of the groups.

NumberOfCmdStepsRange

Enumeration name:

NumberOfCmdStepsRange

Enumeration value:

98

Description:

The number of steps of a command is outside the valid range.

Issue

Cause

Solution

-

A command table with 0 or less steps was transferred.

Verify the initialization of the command tables.

Use the FC_FirstStep and FC_NextStep functions to define the command tables.

NumberOfCmdTablesRange

Enumeration name:

NumberOfCmdTablesRange

Enumeration value:

34

Description:

The number of command tables is outside the valid range.

Issue

Cause

Solution

-

The number of command tables at the input i_udiNumberofCmdTables is <= 0.

Make certain that at least one command table is contained in the list of the command tables at the i_pstListOfCmdTables input and assign the i_udiMumberOfCmdTables input with the number of the command tables in the list of the command tables.

NumberOfSubModulesRange

Enumeration name:

NumberOfSubModulesRange

Enumeration value:

66

Description:

The number of submodules is outside the specified range

Issue

Cause

Solution

-

The number of submodules at the i_udiNumberOfSubModules input is < 0.

Make certain that a value greater than or equal to zero is applied at the i_udiNumberOfSubModules input that corresponds to the number of submodules under this equipment module.

PointerCmdTableInvalid

Enumeration name:

PointerCmdTableInvalid

Enumeration value:

36

Description:

The pointer onto CmdTable is invalid.

Issue

Cause

Solution

-

The list of command tables at the i_pstListOfCmdTables input has not been completely initialized.

Verify the call-up of FC_UpdateCmdTableListElement for each command table.

PointerListOfCmdTablesInvalid

Enumeration name:

PointerListOfCmdTablesInvalid

Enumeration value:

33

Description:

The pointer onto ListOfCmdTables is invalid.

Issue

Cause

Solution

-

The pointer of the i_pstListofCMDTables input is not assigned (zero).

Make certain that the address of the array of the command tables is transferred at the i_pstListofCMDTables input. For instance with ADR(astListOfCMDTables)

PointerSubModuleGroupsInvalid

Enumeration name:

PointerSubModuleGroupsInvalid

Enumeration value:

104

Description:

The pointer onto SubModuleGroups is invalid.

Issue

Cause

Solution

-

The pointer of the i_pudiSubModuleGroups input is not assigned (zero).

Make certain that the address of the array in which the groups of the submodules are managed is given at the i_pudiSubModuleGroups input. For instance with ADR(aaudiSubModuleGroups)

PointerSubModulesItfInvalid

Enumeration name:

PointerSubModulesItfInvalid

Enumeration value:

97

Description:

The pointer SubModulesItf is invalid

Issue

Cause

Solution

-

The pointer of the i_pstSubModulesItf input is not assigned (zero).

Make certain that the address of the array in which the submodules are managed is given at the i_pstSubModulesItf input. For instance with ADR(astSubModuleInterface)

SizeOfListOfCmdTablesInvalid

Enumeration name:

SizeOfListOfCmdTablesInvalid

Enumeration value:

99

Description:

Invalid size of the ListOfCmdTables.

Issue

Cause

Solution

-

An invalid value was transferred at the i_udiSizeOfListOfCmdTables input.

The size of the array of the command tables must be transferred to the i_udiSizeOfListOfCmdTables input. For instance SIZEOF(astListOfCMDTables)

-

At the i_udiNumberOfCMDTables input, the number of the command tables contained in the list of command tables at the i_pstListofCMDTables input was not transferred.

Make certain that the number of command tables is transferred at the i_udiNumberOfCMDTables input.

SizeOfSubModuleGroupsInvalid

Enumeration name:

SizeOfSubModuleGroupsInvalid

Enumeration value:

105

Description:

Invalid size of the SubModuleGroups.

Issue

Cause

Solution

-

An invalid value was transferred at the i_udiSizeOfSubModuleGroups input.

The size of the array in which the groups are managed must be transferred to the i_udiSizeOfSubModuleGroups input. For instance SIZEOF(aaudiSubModuleGroups)

-

At the i_udiNumberOfGroups input. the number of groups defined in the list at the i_pudiSubModuleGroups input was not transferred.

Make certain that the correct number of groups is transferred at the i_udiNumberOfGroups input.

-

At the i_udiNumberOfGroupMembers input, the maximum number of slaves in a group defined in the list at the i_pudiSubModuleGroups input was not transferred.

Make certain that the correct maximum number of members of a group is transferred at the i_udiNumberOfGroupMembers input.

SizeOfSubModulesItfInvalid

Enumeration name:

SizeOfSubModulesItfInvalid

Enumeration value:

96

Description:

The size of the submodule interface is invalid

Issue

Cause

Solution

-

An invalid value was transferred at the i_udiSizeOfSubModulesItf input.

The size of the array must be transferred to the i_udiSizeOfSubModulesItf input in which the submodules are managed. For instance SIZEOF(astSubModuleInterface)

-

At the i_udiNumberOfSubModules input, the number of submodules managed in the list of submodules at the i_pstSubModulesItf input was not transferred.

Make certain that at the correct maximum number of submodules is transferred at the i_udiNumberOfSubModules input.

SubModuleItfNotInitialized

Enumeration name:

SubModuleItfNotInitialized

Enumeration value:

103

Description:

An interface of a submodule has not yet been initialized.

Issue

Cause

Solution

-

The name of a submodule is empty.

Make certain that the string of all submodules in which their name is given is not empty.

-

The ID of a submodule is 0.

Make certain that each submodule has an ID which describes its position in the machine tree.

WaitAtNegativeStep

Enumeration name:

WaitAtNegativeStep

Enumeration value:

41

Description:

Waiting at a negative step.

As requested, the processing of the command table was interrupted.

The processing of the command table continues if the iq_diStartStep input is set to the step which is to be executed next.

WaitCmdsDone

Enumeration name:

WaitCmdsDone

Enumeration value:

43

Description:

Waiting until commands are processed.

The module controller processes the command table.

WaitForCmd

Enumeration name:

WaitForCmd

Enumeration value:

39

Description:

Waiting for a command.

The module controller is waiting for a command.