FC_GetSubModuleIds - General Information

Overview

Type:

Function

Available as of:

V1.0.4.0

Task

Read out the submodules of a module.

Description

The modules of the template form a tree with its sub-modules and on its peak stands the MainMachine. The function accesses the tree. It searches the specified module via i_udiModuleId and indicates the ID of all submodules of the module.

Interface

Input

Data type

Description

i_pstMachineStandardItf

POINTER TO ST_StandardModuleInterface

Pointer to the default interface of the MainMachine. Connect this input always to "ADR(SR_MainMachine.stMachineInterface)".

i_udiModuleId

UDINT

Id of the modul which submoduls should be read out.

i_pudiResultSet

POINTER TO UDINT

Array to write the Id of the submodules. Connect the address of a variable of the type "ARRAY[1..c_diResultSetSize] OF UDINT" to this input; Example: "ADR(audiResultSelt)"

i_udiResultSetSize

UDINT

The size of the array applied at i_pudiResultSet. For the above example this would be c_diResultSetSize.

Output

Data type

Description

q_etDiag

GD.ET_Diag

General, library-independent statement on the diagnostic.

A value not equal to ET_Diag.Ok corresponds to an error message.

q_etDiagExt

ET_DiagExt

POU-specific output on the diagnostic.

q_etDiag = ET_Diag.Ok -> Status message

q_etDiag <> ET_Diag.Ok -> Error message

Return Value

Data type

Description

UDINT

>=0 The number of submodules of the desired module. This relates to the number of entries written into the array.

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

OK

ResultSetSizeRange

69

ResultSetSize is outside the valid range.

ExecutionAborted

MissingExtInit

56

Initialization of the Ext structure failed.

InputParameterInvalid

ModuleIdInvalid

67

The module ID is invalid.

InputParameterInvalid

PointerMachineStandardItfInvalid

58

The pointer MachineStandardItf is invalid

InputParameterInvalid

PointerResultSetInvalid

68

The pointer onto ResultSet is invalid.

InputParameterInvalid

ResultSetSizeRange

69

ResultSetSize is outside the valid range.

UnexpectedProgramBehavior

UnexpectedFeedback

10

An unintended error has been detected during execution.

MissingExtInit

Enumeration name:

MissingExtInit

Enumeration value:

56

Description:

Initialization of the Ext structure failed.

Issue

Cause

Solution

-

Initialization of Ext failed

The parameter ET_Diag must be OK

ModuleIdInvalid

Enumeration name:

ModuleIdInvalid

Enumeration value:

67

Description:

The module ID is invalid.

Issue

Cause

Solution

-

TheModulId is invalid

The parameter ET_Diag must be OK

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The GetSubModuleIds function was executed without errors

PointerMachineStandardItfInvalid

Enumeration name:

PointerMachineStandardItfInvalid

Enumeration value:

58

Description:

The pointer MachineStandardItf is invalid

Issue

Cause

Solution

-

The pointer MachineStandardItf is invalid

The parameter ET_Diag must be OK

PointerResultSetInvalid

Enumeration name:

PointerResultSetInvalid

Enumeration value:

68

Description:

The pointer onto ResultSet is invalid.

Issue

Cause

Solution

-

The pointer ResultSet is invalid

The variable ResultSet must be >0

ResultSetSizeRange

Enumeration name:

ResultSetSizeRange

Enumeration value:

69

Description:

ResultSetSize is outside the valid range.

Issue

Cause

Solution

-

The ResultSetSize is invalid

The ResultSetSize variable must be >= index

UnexpectedFeedback

Enumeration name:

UnexpectedFeedback

Enumeration value:

10

Description:

An unintended error has been detected during execution.

Issue

Cause

Solution

-

Unintended feedback during execution

The variable ET_DiagExt must be <> etDiagExt