Allen-Bradley LOGIX 5000 Reference Manual page 515

Controllers advanced process control and drives and equipment phase and sequence instructions
Hide thumbs Also See for LOGIX 5000:
Table of Contents

Advertisement

Structured Text Programming
Use this format
value1 operator value2
operator value1
function(numeric_expression)
value1 operator (function((value2+value3)/2)
For
Absolute value
Arc cosine
Arc sine
Arc tangent
Cosine
Radians to degrees
Natural log
Log base 10
Degrees to radians
Sine
Square root
Tangent
Truncate
The table provides examples for using arithmetic operators and functions.
Example
For this situation
If gain_4 and gain_4_adj are DINT tags and your specification says:
'Add 15 to gain_4 and store the result in gain_4_adj'"
If alarm and high_alarm are DINT tags and your specification says:
'Negate high_alarm and store the result in alarm.'
If overtravel and overtravel_POS are DINT tags and your specification says:
'Calculate the absolute value of overtravel and store the result in
overtravel_POS.'
If adjustment and position are DINT tags and sensor1 and sensor2 are
REAL tags and your specification says: 'Find the absolute value of the
average of sensor1 and sensor2, add the adjustment, and store the result
in position.'
See also
Structured Text Components: Expressions
Rockwell Automation Publication 1756-RM006K-EN-P - November 2018
Use this function
ABS (numeric_expression)
ACOS (numeric_expression)
ASIN (numeric_expression)
ATAN (numeric_expression)
COS (numeric_expression)
DEG (numeric_expression)
LN (numeric_expression)
LOG (numeric_expression)
RAD (numeric_expression)
SIN (numeric_expression)
SQRT (numeric_expression)
TAN (numeric_expression)
TRUNC (numeric_expression)
Chapter 10
Optimal data type
DINT, REAL
REAL
REAL
REAL
REAL
DINT, REAL
REAL
REAL
DINT, REAL
REAL
DINT, REAL
REAL
DINT, REAL
Write
gain_4_adj := gain_4+15;
alarm:= -high_alarm;
overtravel_POS := ABS(overtravel);
position := adjustment + ABS((sensor1 +
sensor2)/2);
on
page 513
515

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents