Siemens SIMATIC S5-115U User Manual page 376

Simatic s5 series cpu 941-7ub11 cpu 942-7ub11 cpu 943-7ub11 and cpu 943-7ub21 cpu 944-7ub11 and cpu 944-7ub21
Table of Contents

Advertisement

Integral Blocks
11.1
Integral Function Blocks
Integral function blocks can be devided into various groups according to function.
11.1.1 Conversion Blocks
Use blocks FB240 and FB241 to convert numbers in BCD code to fixed-point binary numbers and
vice versa.
Code Converter: B4
Use function block FB240 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".
Call and Parameter Assignments
Parameter
Type
Type
BCD
I
SBCD
I
BINARY
Q
Code Converter: 16
Use function block FB241 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 transferred to
a 16-bit word before conversion.
Call and Parameter Assignments
Parameter
Type
Type
BINARY
I
SBCD
Q
BCD2
Q
BCD1
Q
11-2
-FB240-
Data
Assignment
W
- 9999 to+9999
Bi
"1" for "-"
"0" for "+"
W
16 bits "0"
or "1"
-FB241-
Data
Assignment
W
- 32768 to+32767
Bi
"1" for "-"
"0" for "+"
By
2 tetrads
W
4 tetrads
Meaning
BCD number
Name : COD : B4
Sign of the
BCD
BCD number
SBCD :
Binary number
BINARY:
Meaning
Binary number
Sign of the
Name : COD : 16
BCD number
BINARY:
BCD number
SBCD :
tetrads 4 and 5
BCD2 :
BCD number
BCD1 :
tetrads 0 to 3
S5-115U Manual
STL
: JU FB 240
:
STL
: JU FB 241
EWA 4NEB 811 6130-02b

Advertisement

Table of Contents
loading

Table of Contents