FC_GetAllModulesOfType - General Information

Overview

Type:

Function

Available as of:

V1.0.4.0

Task

Determine all modules of a certain type within a tree.

Description

The module tree at the i_pstMachineStandardItf input is searched for modules of the i_dwWantedType type in all subordinate-levels. References to the interfaces of this module are written into the array at the i_pdwResultSet input.

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_dwWantedType

DWORD

Module type that shall be searched for.

i_pdwResultSet

POINTER TO DWORD

Address of an array in which the addresses of the default module interfaces shall be entered.

i_udiResultSetSize

UDINT

Number of possible elements of the array at the i_pdwResultSet input.

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 Number of found modules of this type

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

ExecutionAborted

MissingExtInit

56

Initialization of the Ext structure failed.

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.

MissingExtInit

Enumeration name:

MissingExtInit

Enumeration value:

56

Description:

Initialization of the Ext structure failed.

Issue

Cause

Solution

-

Initialization of Ext failed

Restart initialization

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The GetAllModulesOfType function was executed without exceptions

PointerMachineStandardItfInvalid

Enumeration name:

PointerMachineStandardItfInvalid

Enumeration value:

58

Description:

The pointer MachineStandardItf is invalid

Issue

Cause

Solution

-

The pointer MachineStandardItf is invalid

The input i_pstMachineStandardItf has to be connected with a pointer to the ST_StandardModuleInterface structure of the MainMachine.

PointerResultSetInvalid

Enumeration name:

PointerResultSetInvalid

Enumeration value:

68

Description:

The pointer onto ResultSet is invalid.

Issue

Cause

Solution

-

The pointer ResultSet is invalid

The value 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 value ResultSetSize must be >=1