Programming

Overview

The Main type is always managed by an HSCMain function block.

NOTE: At build time, an error is detected if the HSCMain function block is used to manage a different HSC type.

Adding the HSCMain Function Block

Step

Description

1

Select the Libraries tab in the Software Catalog and click Libraries.

Select Controller > M258 > M258 Expert IO > HSC > HSCMain_M258 in the list, drag-and-drop the item onto the POU window.

2

Type the Main type instance name (defined in configuration) or select the function block instance by clicking:

G-SE-0005277.1.gif-high.gif

Using the input assistant, the HSC instance can be selected at the following path: Global Variables > <MyController> > PLC Logic > IoConfig_Globals.

G-SE-0006154.1.gif-high.gif

 

 

I/O Variables Usage

The tables below describe how the different pins of the function block are used in Period meter type.

This table describes the input variables:

Input

Type

Description

EN_Enable

BOOL

When EN input is configured: if TRUE, authorizes the counter enable via the Enable input.

EN_Preset

BOOL

Not used.

EN_Cap

BOOL

Not used.

EN_Compare

BOOL

Not used.

EN_Out0

BOOL

Not used.

EN_Out1

BOOL

Not used.

F_Enable

BOOL

Forces the Enable condition.

F_Preset

BOOL

Not used.

F_Out0

BOOL

Not used.

F_Out1

BOOL

Not used.

ACK_Modulo

BOOL

Not used.

ACK_Preset

BOOL

Not used.

ACK_Cap

BOOL

Not used.

SuspendCompare

BOOL

Not used.

This table describes the output variables:

Outputs

Type

Comment

HSC_REF

EXPERT_REF

Reference to the HSC.

To be used with the EXPERT_REF_IN input pin of the Administrative function blocks.

HSC_Err

BOOL

TRUE = indicates that an error was detected.

Use the EXPERTGetDiag function block used to get more information about this detected error.

Validity

BOOL

TRUE = indicates that output values on the function block are valid.

If the time-out value is exceeded, Validity = FALSE.

Run

BOOL

TRUE = Counter is activated.

TH0

BOOL

Not used.

TH1

BOOL

Not used.

TH2

BOOL

Not used.

TH3

BOOL

Not used.

Modulo_Flag

BOOL

Not used.

Preset_Flag

BOOL

Not used.

Cap_Flag

BOOL

Not used.

Reflex0

BOOL

Not used.

Reflex1

BOOL

Not used.

Out0

BOOL

Not relevant.

Out1

BOOL

Not relevant.

CurrentValue

DINT

The value of the counter.