EasyManua.ls Logo

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

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
Controller TypeProgrammable Automation Controller (PAC)
Communication ProtocolsEtherNet/IP, ControlNet, DeviceNet
Programming SoftwareStudio 5000
Programming LanguagesLadder Logic, Structured Text, Function Block Diagram, Sequential Function Chart
Supported I/OAnalog
Power Supply24V DC, 120/240V AC (depending on module)
Operating Temperature0°C to 60°C (32°F to 140°F)
Relative Humidity5% to 95% non-condensing
RedundancySupported with specific modules and configurations
CertificationsUL, CE

Summary

Important user information

Global changes

Details on global changes made in this release of the manual.

New or enhanced features

Information on new and updated features introduced in this manual.

Preface

Studio 5000 environment

Describes the Studio 5000 Automation Engineering & Design Environment.

Additional resources

Lists documents containing additional information on Rockwell Automation products.

Purpose of this manual

Explains the manual provides details on available instructions and guidance for equipment phase instructions.

Legal Notices

Contains copyright notice, End User License Agreement (EULA), and open source licenses.

Chapter 1 Process Control Instructions

Alarm (ALM)

Provides alarming for any analog signal.

Discrete 3-State Device (D3SD)

Controls discrete devices with three possible states (e.g., fast/slow/off).

Discrete 2-State Device (D2SD)

Controls discrete devices with two possible states (e.g., on/off).

Deadtime (DEDT)

Performs a delay of a single input with selectable deadtime.

Function Generator (FGEN)

Converts input based on a piece-wise linear function.

Lead-Lag (LDLG)

Provides phase lead-lag compensation for an input signal.

Enhanced PID (PIDE)

Provides enhanced capabilities over standard PID with velocity form algorithm.

Position Proportional (POSP)

Opens or closes device by pulsing contacts with pulse width proportional to position difference.

Ramp/Soak (RMPS)

Provides alternating ramp and soak periods to follow a temperature profile.

Scale (SCL)

Converts unscaled input to floating point value in engineering units.

Split Range Time Proportional (SRTP)

Drives heating/cooling digital outputs with periodic pulses based on PID output.

Totalizer (TOT)

Provides time-scaled accumulation of an analog input value.

Coordinated Control (CC)

Controls a single process variable by manipulating up to three control variables.

Internal Model Control (IMC)

Controls a single process variable using an internal model and compared error signal.

Modular Multivariable Control (MMC)

Controls two process variables using up to three control variables.

Chapter 2 Drives Instructions

Integrator (INTG)

Implements an integral operation.

Proportional + Integral (PI)

Provides two methods of operation for proportional and integral gains.

Pulse Multiplier (PMUL)

Provides interface from position input module by computing input change from scan to scan.

S-Curve (SCRV)

Performs a ramp function with an added jerk rate.

Second-Order Controller (SOC)

Provides a gain term, first order lag, and second order lead.

Up/Down Accumulator (UPDN)

Adds and subtracts two inputs into an accumulated value.

HMI Button Control (HMIBC)

Enables operators to initiate machine control operations via PanelView 5500.

Chapter 3 Filter Instructions

Derivative (DERV)

Calculates the amount of change of a signal over time in per-second units.

High Pass Filter (HPF)

Provides a filter to attenuate input frequencies below the cutoff frequency.

Low Pass Filter (LPF)

Provides a filter to attenuate input frequencies above the cutoff frequency.

Notch Filter (NTCH)

Provides a filter to attenuate input frequencies at the notch frequency.

Second-Order Lead Lag (LDL2)

Provides a filter with a pole pair and a zero pair.

Chapter 4 Select_Limit Instructions

Enhanced Select (ESEL)

Lets you select one of as many as six inputs based on selection options.

High/Low Limit (HLL)

Limits an analog input between two values (high/low, high, or low limits).

Multiplexer (MUX)

Selects one of eight inputs based on the selector input.

Rate Limiter (RLIM)

Limits the amount of change of a signal over time.

Select (SEL)

Uses a digital input to select one of two inputs.

Selected Negate (SNEG)

Uses a digital input to select between the input value and its negative.

Selected Summer (SSUM)

Uses Boolean inputs to select real inputs to be algebraically summed.

Chapter 5 Statistical Instructions

Moving Average (MAVE)

Calculates a time average value for the In signal, optionally supporting weights.

Maximum Capture (MAXC)

Retains the maximum value of the input over time and allows re-establishment of maximum.

Minimum Capture (MINC)

Retains the minimum value of the input over time and allows re-establishment of minimum.

Moving Standard Deviation (MSTD)

Calculates a moving standard deviation and average for the In signal.

Chapter 6 Logical and Move Instructions

D Flip-Flop (DFF)

Sets Q output to D input state on clock transition; QNot is opposite of Q.

JK Flip-Flop (JKFF)

Complements Q and QNot outputs when Clock input transitions from cleared to set.

Reset Dominant (RESD)

Uses Set and Reset inputs to control latched outputs; Reset has precedence.

Set Dominant (SETD)

Uses Set and Reset inputs to control latched outputs; Set has precedence.

Chapter 7 Equipment Phase Instructions

Attach to Equipment Phase (PATT)

Lets a program take ownership of an equipment phase.

Detach from Equipment Phase (PDET)

Relinquishes ownership of an equipment phase.

Equipment Phase Clear Failure (PCLF)

Clears the failure code of an equipment phase.

Equipment Phase Command (PCMD)

Transitions an equipment phase to the next state or sub state.

Equipment Phase External Request (PXRQ)

Initiates communication with FactoryTalk Batch software.

Equipment Phase Paused (PPD)

Sets up breakpoints within the logic of an equipment phase.

Equipment Phase New Parameters (PRNP)

Clears the NewInputParameters bit of an equipment phase.

Equipment Phase Override Command (POVR)

Gives a Hold, Stop, or Abort command to an equipment phase, regardless of ownership.

Chapter 10 Structured Text Programming

Structured Text Syntax

Explains statements, case sensitivity, tabs, and components like expressions and comments.

Structured Text Components: Comments

Details how to add comments using //, (* *), or /* */ formats.

Structured Text Components: Assignments

Explains using the assignment operator := to change values in tags.

Structured Text Components: Expressions

Describes how to use tag names, literals, functions, and operators in expressions.

Structured Text Components: Instructions

Explains how structured text statements can be instructions and their execution.

Structured Text Components: Constructs

Details program constructs like IF...THEN, CASE...OF, FOR...DO, WHILE...DO, REPEAT...UNTIL.

CASE...OF

Selects actions based on a numerical value using a case statement.

FOR...DO

Executes an action a number of times before doing anything else.

IF...THEN

Completes an action when specific conditions occur.

REPEAT...UNTIL

Continues performing an action until conditions are true.

WHILE_DO

Continues performing an action while certain conditions are true.

Chapter 11 Common Attributes for Advanced Process Control and Drives Instructions

Common Attributes

Guidelines for common attributes for Advanced Process Control and Drives Instructions.

Math Status Flags

Guidelines for Math Status Flags.

Immediate values

Details on entering immediate values in decimal or other radix.

Data Conversions

Rules for mixing data types in programming and operand conversions.

Elementary data types

Lists elementary data types supported by controllers and their ranges.

LINT data types

Describes the LINT data type as a 64-bit integer.

Floating Point Values

Explains REAL and LREAL tags, and IEEE 754 standard.

Index Through Arrays

Describes how to dynamically change array elements using tags or expressions.

Bit Addressing

Explains using bit addressing to access a particular bit within a container.

Function Block Faceplate Controls

Information on faceplate controls for function block instructions.

Related product manuals