Communication Using Global Variables - VXI VT1422A User Manual

Remote channel multi-function dac module user’s and scpi programming manual
Table of Contents

Advertisement

Implementing
Multivariable Control
_
Setpoint
+
Setpoint
+
_
Communication
Using Global
Variables
Implementing Feed
Forward Control
202 Creating and Running Algorithms
In this example, two PID algorithms each control part of a process and due
to the process dynamics are interactive. This situation can call for what is
known as a "decoupler." The job of the decoupler is to correct for the
"coupling" between these two process controllers. Figure 6-3 shows the two
PID controllers and how the de-coupler algorithm fits into the control loops.
As mentioned before, algorithm output statements don't write to the output
SCP channels but are instead buffered in the Output Channel Buffer until the
Output Phase occurs. This situation allows easy implementation of
decouplers because it allows an algorithm following the two PIDs to inspect
their output values and make adjustments to them before they are sent to
output channels. The decoupler algorithm's Decoupl_factor1 and
Decouple_factor2 variables (assumes a simple interaction) are local and can
be independently set using ALG:SCALAR:
/* decoupler algorithm. (must follow the coupled algorithms in execution sequence) */
static float Decouple_factor1, Decouple_factor2;
O124 = O124 + Decouple_factor2 * O125;
O125 = O125 + Decouple_factor1 * O124;
PID Controller ALG1
PID Controller ALG2
Figure 6-3. Algorithm Communication with Channels
A more traditional method of inter-algorithm communication uses global
variables. Global variables are defined using the ALG:DEF command in the
form:
ALG:DEF 'GLOBALS','<variable_declaration_statements>'
Example of global declaration
ALG:DEF 'GLOBALS','static float cold_setpoint;'
In this example, two algorithms mix hot and cold water supplies in a ratio
that results in a tank being filled to a desired temperature. The temperature
of the make-up supplies is assumed to be constant. Figure 6-4 shows the
process diagram.
O124
+
Decoupl_factor1
+
ALG3
De-coupler
+
O125
Decoupl_factor2
+
O124
O125
Process Interaction
Chapter 6

Advertisement

Table of Contents
loading

Table of Contents