Integral Function Blocks; Conversion Blocks; Blocks - Siemens SIMATIC S5 Manual

Hide thumbs Also See for SIMATIC S5:
Table of Contents

Advertisement

Blocks

6.1

Integral Function Blocks

Integral function blocks can be divided into separate groups according to function.
6.1.1

Conversion Blocks

Use blocks FB 240 and FB 241 to convert numbers in BCD code to fixed-point binary numbers and
vice versa.
Code Converter: B4
Use function block FB 240 to convert a number in BCD code (four tetrads) with sign to a fixed-
point binary number (16 bits).
A two-tetrad number must be changed to a four-tetrad number before conversion by padding it
with "0 bits".
Call and Parameter Assignment
Parameter
Type
BCD
I
SBCD
I
BINARY
Q
Code Converter: 16
Use function block FB 241 to convert a fixed-point binary number (16 bits) to a number in BCD
code with additional consideration of the sign. An eight-bit binary number must be changed to a
16-bit word before conversion.
Call and Parameter Assignment
Parameter
Type
DUAL
I
SBCD
Q
BCD2
Q
BCD1
Q
6-2
-FB 240-
Data
Assignment
Type
W
-9999 to+9999
Bi
"1" for "-"
"0" for "+"
W
16 bits "0"
or "1"
-FB 241-
Data
Assignment
Type
W
-32768 to+32767
Bi
"1" for "-"
"0" for "+"
By
2 tetrads
W
4 tetrads
Meaning
BCD number
Name
Sign of the
BCD
BCD number
SBCD
Binary number
DUAL
Meaning
Binary number
Sign of the BCD
number
BCD number
tedrads 4 and 5
BCD number
tedrads 0 to 3
S5-115F Manual
STL
: JU FB 240
: COD : B4
:
:
:
STL
: JU FB 241
Name : COD : 16
DUAL :
SBCD :
BCD2 :
BCD1 :
EWA 4NEB 811 6149-02

Advertisement

Table of Contents
loading

This manual is also suitable for:

S5-115f

Table of Contents