Skip to content

ReferenceLocalVariable

Local variable with activated isReference Property, is generated as Reference variable for each platform.

Assign reference

Use new namespace "ref" for all reference methods.

qyrwcv2s

B&R

myRef ACCESS ADR(variable);

S7Tia

din_refVariable := REF(#din_refVariableBase);

Beckhoff

din_refVariable REF= din_refVariableBase;

Check reference

Use isValid method to check if reference is set:

if (ref.isValid(din_refVariable)) {

B&R

There is no check reference support at B&R

IF (TRUE) THEN

S7Tia

IF (din_refVariable <> NULL) THEN

Beckhoff

IF (__ISVALIDREF(din_refVariable)) THEN

Constraints

  • S7Tia does not support static reference (REF_TO type) variables. Reference variables are generated as temporary variables.