Siemens SIMATIC S7-GRAPH Manual page 88

For s7-300/400 programming sequential control systems
Table of Contents

Advertisement

Programming Actions and Conditions
Assignments with Built-in Function
Assignments with a built-in Function are entered with the syntax A:=func(B).
These assignments are essentially conversions functions and complex math
functions. The assigned address A specifies the data type of the expression. You
can use the following assignments with a built-in function:
Assignment with
Built-in Function
Conversion functions:
A := BCD_TO_NUM(B)
A := NUM_TO_BCD(B)
A := INT_TO_DINT(B)
A := DINT_TO_REAL(B)
A := ROUND(B)
A := TRUNC(B)
Math functions:
A := NEGR(B)
A := ABS(B)
A := SQR(B)
A := SQRT(B)
A := LN(B)
A := EXP(B)
A := SIN(B)
A := ASIN(B)
A := COS(B)
A := ACOS(B)
A := TAN(B)
A := ATAN(B)
A := NEG(B)
Other Functions:
A := NOT(B)
A := SWAP(B)
A := RLDA(B)
A := RRDA(B)
7-12
Comment
BCD to INT or DINT (STL instructions: BTI, BTD)
INT or DINT to BCD (STL instructions: ITB, DTB)
INT to DINT (STL instruction: ITD)
DINT to REAL (STL instruction: DTR)
REAL to DINT (STL instruction: RND)
REAL to DINT, truncate remainder (STL instruction: TRUNC)
REAL negation
REAL absolute value
REAL square
REAL square root
REAL logarithm to base e
REAL exponent to base e
REAL sine
REAL arc sine
REAL cosine
REAL arc cosine
REAL tangent
REAL arc tangent
Negation (two's complement)
(STL instructions: NEGI, NEGD, NEGR)
One's complement (STL instructions: INVI, INVD)
Swap bytes (STL instructions: TAD, TAW)
Rotate 32 bits left by 1 bit via CC1 (STL instruction: RLDA)
Rotate 32 bits right by 1 bit via CC1 (STL instruction: RRDA)
S7-GRAPH for S7 300/400 Programming Sequential Control Systems
C79000-G7076-C526-01

Advertisement

Table of Contents
loading

Table of Contents