Programming the Simple Type

Overview

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

NOTE: At build time, 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

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

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

2

Type the Simple 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-0006148.1.gif-high.gif

 

 

G-SE-0074953.1.gif

 

 

I/O Variables Usage

The tables below describe how the different pins of the function block are used in Modulo-loop mode.

This table describes the input variables:

Input

Type

Comment

Enable

BOOL

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

Sync

BOOL

On rising edge, presets and starts the counter.

ACK_Modulo

BOOL

On rising edge, resets Modulo_Flag.

This table describes the output variables:

Output

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 to get more information about this detected error.

Validity

BOOL

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

Run

BOOL

Not relevant

Modulo_Flag

BOOL

Set to TRUE when the counter rolls over the Modulo value.

CurrentValue

DWORD

The value of the counter.