GET_BYTE_REF block

Short summary

Name

GET_BYTE_REF

→POU type

→function

Category

IEC-block, MemoryEnh

Conform to →IEC-standard

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/add.svg not defined in IEC-standard

Graphical interface

images/download/thumbnails/414781800/GET_BYTE_REF-version-1-modificationdate-1535026894582-api-v2.png

Available since

  • version 1.41.0 (for logi.CAD 3) – initial variant

  • version 2.0.9 (for library Standard) – graphical interface with in-out variable

Functionality

The block returns a →reference to the first byte of the element connected to input IN.

Inputs, outputs, return value


Identifier

→Data type

Description

In-outs
(VAR_IN_OUT)

IN

REAL, LREAL, USINT, UINT, UDINT, ULINT, SINT, INT, DINT, LINT, TIME, BOOL, BYTE, WORD, DWORD, LWORD, STRING, CHAR, DATE_AND_TIME, DATE, TIME_OF_DAY or a →user-defined data type
Restriction: In case of →array data types, only one-dimensional arrays are allowed.

input value

Return value:

REF_TO BYTE

reference to the first byte of the input value

Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.

Example for usage within ST-editor

Usage example of the GET_BYTE_REF block
FUNCTION_BLOCK ExampleGetByteRef
VAR
result : REF_TO BYTE;
arrayVar : ARRAY [1..10] OF UINT := [10(16#BEEF)];
END_VAR
result := GET_BYTE_REF(IN := arrayVar); /* 'result' contains the reference to the first byte of 'arrayVar' */
ENO := result^ = 16#EF;
END_FUNCTION_BLOCK

When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.