BCD_TO_DINT block

Short summary

Name

BCD_TO_DINT

→POU type

→function

Category

IEC-block, Convert

Conform to →IEC-standard

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/check.svg no restrictions

Graphical interface

images/download/thumbnails/414780978/BCD_TO_DINT-version-1-modificationdate-1534929280439-api-v2.png

Available since

version 1.22.0 (for logi.CAD 3)

Functionality

The block converts a binary coded decimal value (a →BCD-value) into a decimal value of data type DINT.

At input IN, connect the BCD-value that should be converted. If it is not a valid BCD-value, the result of the block is not defined.

Inputs, return value


Identifier

→Data type

Description

Inputs:

IN

BYTE, WORD, DWORD or LWORD

BCD input value

Return value:

DINT


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

See:

Example for usage within ST-editor

PROGRAM Test
VAR
result : DINT;
END_VAR
result := BCD_TO_DINT(IN := 16#12345); (* The variable 'result' evaluates to '12345'. *)
END_PROGRAM

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.