BCD_TO_DINT block
Short summary
Name |
BCD_TO_DINT |
→POU type |
|
Category |
|
Conform to →IEC-standard |
no restrictions |
Graphical interface |
|
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 |
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:
"Blocks for safe logic" whether this block is supported for developing safety-relevant applications.
"Highlighting safe logic in the FBD-editor" for the effects when using the block as a block for safe logic .
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.