HSCSimple_TM3: Control a Simple Type Counter for TM3

Function Block Description

This function block controls a Simple type counter with the following reduced functions:

oone-channel counting

ono threshold

ono capture

ono reflex

The HSCSimple function block is mandatory when using a Simple counter type.

The function block instance name must match the name defined by configuration. Hardware related information managed by this function block is synchronized with the MAST task cycle.

Warning_Color.gifWARNING

UNINTENDED OUTPUT VALUES

oOnly use the Function Block instance in the MAST task.

oDo not use the same Function Block instance in a different task.

Failure to follow these instructions can result in death, serious injury, or equipment damage.

NOTE: Forcing the logical output values of the FB is allowed by EcoStruxure Machine Expert but it will have no impact on hardware related outputs if the function is active (executing).

Graphical Representation

G-SE-0074953.1.gif

 

 

IL and ST Representation

To see the general representation in IL or ST language, refer to Function and Function Block Representation.

I/O Variables Description

This table describes the input variables:

Inputs

Type

Comment

HSC_REF_TM3

HSC_REF_TM3

Reference to the HSC instance.

Enable

BOOL

TRUE = activates counter and takes into account pulses on the counter input.

Sync

BOOL

One shot counter: On rising edge, loads the preset of the counter.

Modulo loop counter: On rising edge, resets and initializes the counter.

ACK_Modulo

BOOL

One shot counter: Not used.

Modulo loop mode: On rising edge, resets the modulo flag Modulo_Flag.

This table describes the output variables:

Outputs

Type

Comment

Validity

BOOL

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

Run

BOOL

TRUE = counter is activated.

In One-shot mode, switches to 0 when CurrentValue reaches 0. A rising edge on Sync is needed to restart the counter.

In Modulo loop mode, TRUE, indicates that the counter is activated.

Valid

BOOL

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

Error

BOOL

TRUE = indicates that an error was detected.

ErrorId

HSC_ERROR_TM3

Indicates the value of the error detected. See HSC_ERROR_TM3 enumeration.

Modulo_Flag

BOOL

One shot counter: Not relevant.

Module loop mode: Set to TRUE when the counter rolls over the modulo value.

CurrentValue

DWORD

The value of the counter.