DefineUnitMode (Method)

Overview

Type:

Interface

Available as of:

V1.4.2.0

Inherits from:

Description

The method is used to define a unit control mode in the FB_UnitModeManager2.

For each unit control mode, an individual state model can be defined using the parameter i_diStatesDisabled. The method verifies whether the defined state model is plausible according to the dependency rules.

Interface

Input

Data type

Description

i_sName

STRING

Specifies the name of the unit mode. Refer to Unit Control Modes.

i_diValue

UDINT

Numeric value of the unit mode. Refer to the table below. Refer to Unit Control Modes.

Valid range: 1...31

i_diStatesDisabled

DINT

This parameter is used to determine the state model for the unit mode. The states 1...17 of the PackML state model can be disabled by turning on the corresponding bit in the DINT.

The bits 0...16 represent the individual states as defined in ET_StateModelDefinition.

Refer to the rules for state model definition (Dependency Rules).

i_diStatesModeChangeAllowed

DINT

This parameter is used to determine in which state a unit mode change is allowed. The states 1...17 of the PackML state model where a mode change is allowed are defined by turning on the corresponding bit in the DINT.

The bits 0...16 represent the individual states as defined in ET_StateModelDefinition.

i_etInitialState

ET_States

This parameter is used to determine the initial state for the unit mode. This input is optional. If it is unassigned the initial state is set to ET_States.Stopped.

Output

Data type

Description

q_etResult

ET_Result

Provides diagnostic and status information as a numeric value.

If q_xError = FALSE, q_etResult provides status information.

If q_xError = TRUE, q_etResult provides diagnostic/error information.

q_sResultMsg

STRING

Provides additional diagnostic and status information as a text message.

Return Value

Output

Data type

Description

DefineUnitMode

BOOL

Indicates TRUE if the method is completed successfully.

Unit Control Modes

The ANSI/ISA TR88.00.02-2015 standard defines a set of unit control modes. These are listed in the table below. The names and the corresponding values are reserved in the FB_UnitModeManager2.

Unit Control Mode

Value

Description

Invalid

0

Invalid value for unit control mode.

Production (1)

1

This mode represents the mode which is used for routine production.

Maintenance

2

This mode may allow authorized personnel to run an individual machine independent of other machines in a production line.

Manual

3

This mode provides direct control of individual machine modules.

User definable

4...31

User definable states

(1) With the 2015 revision of the ANSI/ISA TR88.00.02-2015, the control mode Producing was changed to Production. For reasons of compatibility with the previous version of the PackML library, the name Producing has been maintained.

Dependency Rules

Dependency rules for defining a state model as per ANSI/ISA TR88.00.02-2022:

  • The states Stopped, Aborted, and Execute are mandatory.

  • If the state Resetting exists, the state Idle must exist. However, the state Idle does not necessarily require the state Resetting.

  • If the state Completing exists, the state Complete must exist.

  • If the states Holding or UnHolding exist, the state Held must exist.

  • If the states Suspending or UnSuspending exist, the state Suspended must exist.