Variable Reference

Help Contents

Introduction

A variable reference indicates the location of a program variable. These can be used to:

A variable reference can be:

Examples

  1. A reference a program variable uses an Identifier:
    SampleCount
  2. A reference to an element of an Array:
    ConveyorLoads[1]
  3. A reference to a member of a Struct:
    ItemLocation.Distance
  4. A Tag Reference:
    %"Pressure.Value"

The above examples use the following Variable Declarations:

TYPE
    PolarCoordinates : STRUCT
        Angle : LREAL;
        Distance : LREAL;
    End_STRUCT
End_TYPE
VAR
    SampleCount : LREAL;
    ConveyorLoads : ARRAY [0..5] OF REAL;
    ItemLocation : PolarCoordinates;
End_VAR

Further Information

Array

To learn about array types and how to reference array elements.

Struct

To learn about struct types and how to reference structure members.

Pointer

To learn about pointer types and how to dereference pointer values.

Glossary

For the meaning of terms used in Fernhill SCADA.