FC_InitCmdGroup

 

FC_InitCmdGroup - General Information

Overview

Type:

Function

Available as of:

V1.1.0.0

Support for:

PacDrive pilot template architecture

Task

Function for initialization of an axis that is controlled by the function block AXM.FB_AxisModuleTpi.

Description

This function is used to create a group and assign axes to the group. A group allows a single command to act on multiple axes.

Enumerations are used to name groups and these are declared as constants. The following are typical group names:

oc_udiMasterGroup : UDINT := 2001; (* Name of the module group 1 *)

oc_udiSlaveGroup1 : UDINT := 2002; (* Name of the module group 2 *)

oc_udiSlaveGroup2 : UDINT := 2003; (* Name of the module group 3 *)

All user created groups have to be numbered between 2000 and 4000 (2000 and 2000 +TPL.Gc_udiNumberOfGroups). The function will return FALSE if the i_udiGroupName parameter is outside this value range.

The following enumeration is predefined to act on all axes:

o TPL.Gc_udiAllSubModules : DINT := 1000; (* Predefined group *)

 Up to ten axes can be assigned to the group with the inputs i_udiMemberAxis1 to i_udiMem­berAxis10. The axis names are also declared as a constant.

The following are several typical axis´ names:

oc_udiMaster : UDINT :=1;

oc_udiAxis2 : UDINT :=2;

oc_udiAxis3 : UDINT :=3;

oc_udiAxis4 : UDINT :=4;

 The maximum quantity of axes per group is limited to ten by the predefined constant TPL.Gc_udiNumberOfGroupMembers.

The group is added to the array that holds all the groups with the iq_aaudiCmdGroup input. The maximum quantity of groups is limited to five by the predefined constant c_udiNumberOfGroups.

Interface

Input

Data type

Description

i_udiGroupName

UDINT

Specifies a group number. The number has to be between 2000 and 4000.

i_udiMemberAxis1 to i_udiMemberAxis10

UDINT

Specifies the axes that are members of this group.

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_aaudiCmdGroup

ARRAY[1..Gc_udiNumberOfGroupsTpi, 1..Gc_udiNumberOfGroupMembersTpi] OF UDINT

Specifies the array that holds all the groups.

Return Value

Data type

Description

 

The function will return FALSE if the predefined constant TPL.Gc_udiNumberOfGroupMembers is less than ten.

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

InputParameterInvalid

GroupNameRange

70

The group name is outside the valid range.

InputParameterInvalid

NumberOfGroupMembersTpiRange

71

The number of group members TPI is out of range.

GroupNameRange

Enumeration name:

GroupNameRange

Enumeration value:

70

Description:

The group name is outside the valid range.

Issue

Cause

Solution

-

Input parameter invalid.

i_udiGroupName is outside the permitted range.

i_udiGroupName must be greater than Gc_udiGroupOffset and smaller than Gc_udiGroupOffset + Gc_udiNumberOfGroupsTpi.

NumberOfGroupMembersTpiRange

Enumeration name:

NumberOfGroupMembersTpiRange

Enumeration value:

71

Description:

The number of group members TPI is out of range.

Issue

Cause

Solution

-

Input parameter invalid.

Gc_udiNumberOfGroupMembersTpi is outside the permitted range.

Gc_udiNumberOfGroupMembersTpi must be greater than or equal to 10.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok