Type Information Functions

Help Contents

Introduction

Fernhill SCADA supports these Type Information functions:

FunctionParameter TypeDescription
SizeOf ANY Returns the size, in bytes, of a type.
IsTypeOf ANY, TYPE Returns TRUE if the first parameter is the type of the second parameter.

Remarks

The Type Information functions provide information about a type.

Examples

  1. Obtain the size, in bytes, of a type:
    Var A, B : DINT; End_Var
    A := SizeOf( B );

    The variable A will be assigned the value 4.

  2. Test whether an input variable to a function is an integer:
    Function CheckTypeIsInteger : BOOL
    Var_Input Item : ANY_ELEMENTARY; End_Var
    
        CheckType := IsTypeOf( Item, ANY_INT );
    End_Function

Standards Compliance

Type Information functions are an extension to the IEC 61131-3 standard.

Further Information

Elementary Data Types

To learn about elementary data types such as INT, STRING, TIME.

Generic Data Types

To learn about generic data types such as ANY_INT, ANY_NUM, ANY_MAGNITUDE.

Common Elements

To learn about other language Common Elements.

Glossary

For the meaning of terms used in Fernhill SCADA.