EasyManuals Logo
Home>Allen-Bradley>Controller>LOGIX 5000

Allen-Bradley LOGIX 5000 User Manual

Allen-Bradley LOGIX 5000
561 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #515 background imageLoading...
Page #515 background image
Structured Text Programming
Chapter 10
Rockwell Automation Publication 1756-RM006K-EN-P - November 2018 515
For Use this function Optimal data type
Absolute value ABS (numeric_expression) DINT, REAL
Arc cosine ACOS (numeric_expression) REAL
Arc sine ASIN (numeric_expression) REAL
Arc tangent ATAN (numeric_expression) REAL
Cosine COS (numeric_expression) REAL
Radians to degrees DEG (numeric_expression) DINT, REAL
Natural log LN (numeric_expression) REAL
Log base 10 LOG (numeric_expression) REAL
Degrees to radians RAD (numeric_expression) DINT, REAL
Sine SIN (numeric_expression) REAL
Square root SQRT (numeric_expression) DINT, REAL
Tangent TAN (numeric_expression) REAL
Truncate TRUNC (numeric_expression) DINT, REAL
The table provides examples for using arithmetic operators and functions.
Use this format Example
For this situation Write
value1 operator value2 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’"
gain_4_adj := gain_4+15;
operator value1 If alarm and high_alarm are DINT tags and your specification says:
‘Negate high_alarm and store the result in alarm.’
alarm:= -high_alarm;
function(numeric_expression) 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.’
overtravel_POS := ABS(overtravel);
value1 operator (function((value2+value3)/2) 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.’
position := adjustment + ABS((sensor1 +
sensor2)/2);
See also
Structured Text Components: Expressions on page 513

Table of Contents

Other manuals for Allen-Bradley LOGIX 5000

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Allen-Bradley LOGIX 5000 and is the answer not in the manual?

Allen-Bradley LOGIX 5000 Specifications

General IconGeneral
BrandAllen-Bradley
ModelLOGIX 5000
CategoryController
LanguageEnglish

Related product manuals