Programming the Simple Type

Overview

A Simple type is always managed by an HSCSimple function block.

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

Adding a HSCSimple Function Block

Step

Description

1

Drag the Libraries > Controller > HMISCU > HMISCU_HSC > HSCSimple FB to the Application tree > HMISCUxx5 > POU and drop it on the Start Here box in the lower window.

2

The instance name is located in the Variable field at the Device tree > HMISCU••5 > Embedded Functions > HSC > HSC0• with the HSC0• > Type that is set to Simple.

NOTE: This method is for ST, LD, or FBD languages.

G-SE-0022644.1.gif-high.gif

 

 

I/O Variables Usage

The tables describe how the different pins of the function block are used in One-shot mode.

The table describes the input variables:

Input

Type

Comment

EN_Enable

BOOL

TRUE = authorizes changes to the current counter value.

Sync

BOOL

On rising edge, sets the counter value with the configured preset

ACK_Modulo

BOOL

Not used

The table describes the output variables:

Output

Type

Comment

HSC_REF

HSC_REF

Reference to the HSC.

To be used with the HSC_REF_IN input pin of the function blocks.

Validity

BOOL

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

HSC_Err

BOOL

TRUE = indicates that an error was detected.

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

Run

BOOL

TRUE = counter is running.

Switches to FALSE when CurrentValue reaches 0. A rising edge on Sync is needed to restart the counter.

CurrentValue

DWORD

Current count value of the counter.

Modulo_Flag

BOOL

Not used