FC_SetSubModuleIds - General Information

Overview

Type:

Function

Available as of:

V1.0.4.0

Task

Automatic setting of the module IDs of subordinate modules.

Description

The function generates the ModuleIds of the submodules as follows:

SubmoduleId = MainModuleId x 100 + Index

The index runs from 1 to n = NumberOfSubModules.

Interface

Input

Data type

Description

i_udiMainModuleId

UDINT

ID of the node in which subordinate modules exist.

i_pstSubModulesItf

POINTER TO ST_StandardModuleInterface

Array of the default interfaces of the submodules.

i_udiNumberOfSubModules

UDINT

Number of submodules in the array at the i_pstSubModulesItf 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

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

InputParameterInvalid

PointerSubModulesItfInvalid

97

The pointer SubModulesItf is invalid

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The function SetSubModuleIds works without exceptions

PointerSubModulesItfInvalid

Enumeration name:

PointerSubModulesItfInvalid

Enumeration value:

97

Description:

The pointer SubModulesItf is invalid

Issue

Cause

Solution

-

The pointer SubModulesItf is invalid

The pointer SubMoulesItf must be >0