Converting The Loop Output To A Scaled Integer Value; Forward- Or Reverse-Acting Loops - Siemens SIMATIC S7-200 System Manual

Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

SIMATIC Instructions

Converting the Loop Output to a Scaled Integer Value

The loop output is the control variable, such as the throttle setting in the example
of the cruise control on the automobile. The loop output is a normalized, real
number value between 0.0 and 1.0. Before the loop output can be used to drive an
analog output, the loop output must be converted to a 16-bit, scaled integer value.
This process is the reverse of converting the PV and SP to a normalized value.
The first step is to convert the loop output to a scaled, real number value using the
formula given below:
R
= (M
Scal
where:
R
Scal
M
n
Offset
Span
The following instruction sequence shows how to scale the loop output:
MOVR
-R
*R
Next, the scaled, real number value representing the loop output must be
converted to a 16-bit integer. The following instruction sequence shows how to do
this conversion:
ROUND AC0 AC0
MOVW AC0, AQW0

Forward- or Reverse-Acting Loops

The loop is forward-acting if the gain is positive and reverse-acting if the gain is
negative. (For I or ID control, where the gain value is 0.0, specifying positive
values for integral and derivative time will result in a forward-acting loop, and
specifying negative values will result in a reverse-acting loop.)
9-94
- Offset) * Span
n
is the scaled, real number value of the loop output
is the normalized, real number value of the loop output
is 0.0 for unipolar values
is 0.5 for bipolar values
is the maximum possible value minus the minimum possible value
= 32,000 for unipolar values (typical)
= 64,000 for bipolar values (typical)
VD108, AC0
//Move the loop output to the accumulator.
0.5, AC0
//Include this statement only if the value is
//bipolar.
64000.0, AC0
//Scale the value in the accumulator.
//Convert the real number to a 32-bit integer.
//Write the 16-bit integer value to the analog
//output.
S7-200 Programmable Controller System Manual
A5E00066097-02

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents