Module 4 Introduction to Calogix and Logic Module
Module 4 Introduction to Calogix and Logic Module
Setpoint Output
The first three settings relate to the set point for each one of the controller channel 1 outputs a,b, and
c.
Step 1: Double click on the ‘Value’ setting for each one of these to see the option available. Note that
these in each case are for none and outputs 1, 2, and 3. It is possible that any one of the three physical
outputs can be assigned as Setpoint1 and so on for setpoint 2 and setpoint 3.
The physical outputs on the controller have been designated a, b, and c to avoid confusion with
numerical outputs 1, 2, and 3 and the software use of numerical designations that are used throughout
the programming of the module.
Instead of setpoint 1 set to output 1, setpoint 2 set to output 2, setpoint 3 set to output 3, this can be
stated as setpoint 1 set to output a, setpoint2 set to output b, and setpoint 3 set to output c.
Note that when any one of the set points are set to a particular value the controller PC screen mimic
indicates this by SP1,2,or3 on the appropriate module of the controller.
Step 2: For this exercise set the three set point outputs to 1, 2, and 3, respectively.
This means that the action of outputs (a), (b), and (c) are referenced to the values of settings entered
into ‘Module 1 Setpoint1 Control’, a setting that we will dealing with shortly.
19
Burntout state
The next three settings in figure 5-1 are for the ‘Burntout state’ for the outputs (a), (b), and (c).
The ‘Burntout’ state relates to a failure in the input signal (4-20 mA) that may become open circuit or
described as ‘Burntout’. In the event of this happening the outputs can be set to specific conditions
depending on the process under control to prevent dangerous situations arising, set alarms and
prevent the loss of the process material that may be considered to be of high value.
We will verify the action of these settings when running the controller program.
Output inversion
Each one of the outputs can be set to a true or false state. The next three settings in the output
settings table are for this purpose.
Note that the ‘output settings’ description is ‘output inversion’ so if the setting is ‘False’ then the
physical output is non-inverted.
As we shall be controlling the water level in the process tank the Setpoint1 value can be entered in the
range 0-100 %.
20
Step 6: To set the controller ‘Mode’ double click on ‘Park’ to see the type of control that can be
applied. Set the mode to Park.
Before we can run the controller we need to connect up the 4-20 mA output from module one.
Step 8: Disconnect the two leads to the pump input sockets and connect the 4-20 mA output from the
controller module 1 to the pump input sockets, plus to plus, and minus to minus.
Step 9: Ensure that the process tank valve A is set to have a small drain on the tank to enable the
control action to function properly. (Lever at approximately 30 degrees from the vertical).
The controller should start the pump on maximum flow and begin to fill the process tank. This process
will continue until the tank water level approaches the set point, i.e. 50%, at which point the pump
flow is gradually reduced until the desired water level is reached. The pump will continue to run to
maintain the desired level replacing the water steadily draining from the tank as set by valve A.
Step 11: Examine the controller action by slowly opening and closing valve A and note that the pump
flow increases as the flow is reduced.
Within the charting software there are many parameters that if required can be ‘tagged; to be
displayed on the chart with the traces shown in various colors and names attached. We will set up a
chart that displays the current process and examine the response of the system to various changes in
controller PID values.
Step 13: Click on the icon at the top of the screen that looks like a small graph
Step 14: Enter a filename and set the major time scale interval to the values shown.
This is a scrolling chart and in this case for every centimeter if he chart represents a time interval of ten
seconds and in that ten seconds period five samples will be taken and the chart updated once every
two seconds.
21
Step 15: Complete the rest of the chart settings as shown in figure 5-4 and then click Next.
Another window will open that will list the controller(s) that are available to have their data displayed
on the chart.
Step 16: Click on the Add button to list the available controllers.
You should find the controller(s) listed in the Select data source window.
Step 17: Double click on the controller to list the available modules. From the list select module 1, this
is the one that is being used to control the level in the process tank.
The window shown in figure 5-5 should now be viewable listing the parameters available to be ‘tagged;
and displayed on the chart.
Step 18: From the tag list select Input 1 Formatted Process Value. This will become highlighted on blue.
Select Next to see the window as shown in figure 5-6.
22
Figure 5-6 Trace properties window
Step 19: Enter the unit to be charted, in this case Percent and choose a trace color from the drop down
menu by clicking on the color tab
Step 20: Enter the maximum scale, minimum scale, and scale step as shown in figure 5-6, then click on
the finish tab.
Step 21: In the next window, click on ‘Add’. This window will allow a second trace of interest to be
included in the chart.
Step 23: From the tag list select ‘Setpoint1 Formatted Value’ and then click on the ‘Next’ tab.
Step 24: Select the trace color if necessary and check the scaling settings, then click on finish.
You should now have two items listed in the Chart trace selection window as shown in figure 5-7.
The top trace is the process variable (PV) and the second one is the set point (SP). At this stage we
could change the tag information through the Delete, Edit, and Add tabs and you may wish to do this if
your settings are not as shown in Figure 4-13.
Step 25: Click on the next tab to see the window in figure 5-8.
23
Figure 5-8 Chart format properties window
The chart background, grid and cursor can be changed so as not to mask any of the previous color
settings so if necessary change the cursor color to blue to avoid the same color as chosen by the
default settings.
The date/time format may be completed if desired but it is no necessary for this to be done for this
exercise.
Step 26: Click on Finish to see the chart and to begin recording Data.
The chart in figure 5-9 Shows the result obtained with the set point set to 50%, left hand side of the
chart, and the response of the system process with the set point changed to 70%, right hand side of
the chart.
Note the two areas where there are small reductions in the process variable (tank level). These are due
to the opening and closure of the tank drain valves to observe the controllers response to these
changes.
Step 27: Try his for yourself by opening the tank drain valve fully, noting the increase output of the
pump in an attempt to maintain the water level, waiting for about 30 seconds before closing the drain
valve almost fully, and allowing a small drain into the sump tank.
24
The controller should be seen to stabilize at the set point. Changing the PID values will change the
system response.
Step 28: Make the graph of PI, PD, and PID controller, try disturbing the system by opening Valve A
(flowing the water down to reservoir).
Step 29: Close the Process Tank drain valve and remove the connection to the positive input to the
pump 4-20 mA socket before moving on to the next exercise, Setting Alarms.
25
Experiment 5 Alarming
Step 1: Complete previous setting and the system condition is set as at the previous exercise
(Chart running, PID control set ‘P’ with a proportional band setting of 5)
Step 2: “Right click” on controller graphic > select “Properties” > Click”Module1” to reveal the setting
option
Step 4: Set mode “Park” from right hand column and click “Apply”
(hold the controller preventing any further output action )
26
Step 5: Set Setpoint1 to “70” and click “Apply”
Step 6: Double click on “Setpoint2 Control” and set Operating mode to “FSHI” (Full Scale HIgh)
(this Setpoint2 output to alarm if process value increase above the value of Setpoint2)
27
Step 8: Double click on “Setpoint3 Control” and set Operating mode to “FSLO” (Full Scale LOw)
(this Setpoint3 output to alarm if process value decrease under the value of Setpoint3)
28
The Alarm setting are more easily understood if they are represented in a graphical
Ex1. As an exercise to reinforce your understanding of setting up the alarm re-programs the controller
such that alarm HI occurs at 55% and alarm LO at 35%. Check that the alarm lamps operate in the
correct way using the previous procedure as a guide
Ex2. Set up an alarm sequence that will indicate when the process tank level is below 30% using a lamp
and a second alarm that uses the sounder when the level reduces to 10%.
29
QUESTIONS
30
Instrumentation System Laboratory
Module 5 Introduction to Logic Module
Version 1.0 June 2014
Devised by:
0
Objective
1
Introduction
OVERVIEW:
CALogix has integrated logic function capability that can be used for controlling a system by linking
associated inputs and outputs using logic, timer, counter and comparator functions.
To access logic I/O settings right mouse click on the controller image, mouse over properties then
click on the module number (module slot number must have logic I/O module fitted)
A user-defined label (name) for the module can be entered in the module name field
Input 1, 2, 3 range
The voltage range of inputs 1, 2 and 3 can be user-defined as one of three voltage ranges i.e. 0-24V,
0-10V and 0-5V.These voltages are used to determine high and low states for logic functions and
also for comparator switching levels. Voltages above 66% of the input range will be considered as
high state and below 33% as low state e.g. for a 0-10V input range <3.3V = low logic state (0) and
>6.6V = high logic state (1).
Comparators will convert the input level to a percentage of full scale and will be compared against
other inputs or a constant. e.g. With an input range of 0 - 24V, an input voltage of 2.4V will be
considered to have a value of 10.0 in a comparator block.
Each of the inputs can be independently set for a different voltage level input. Once each input has
been set, write the settings to the controller by clicking the apply button.
2
LOGIC PROGRAMMING
3
Logic program trace mode
Trace mode allows monitoring of a logic program that is running in a controller. Green lines
show the active part of the program. Counter and timer values can also be read.
Note: Windows is not a real-time operating system therefore there may be a delay before changes in the
controller are visible on PC screen.
If other applications are running in addition to CALogix-sw the delay may be greater.
Note: When in trace mode the logic desktop will be in read-only mode.
4
Logic Function Blocks
Placing a Function Block on the Logic Desktop
1) Left-Click on the icon for the logic function block type you require
2) Continuing to hold the mouse button, drag the mouse pointer into the logic desktop area
3) Once mouse pointer is in position that you want to place function block, release the mouse
button.
4) The function block should now be visible.
By clicking on the drop down menu for operation type (or mode in some blocks) the operation type
can be selected.
5
The various function block options and how they are configured is shown below.
Logic Blocks
Boolean
Operation mode for a Boolean function block can be selected as AND, NAND, OR, NOR, XOR, XNOR
or LATCH (see selecting operation above). Truth table for Boolean functions are given in the
appendix.
Each Boolean function block requires a two inputs from either an input block or other function
blocks. The output of the block must be connected to another function block or an output block.
Timers
A number of timer functions are available with CALogix, these are: on-delay, on-off delay, on-pulse,
off-pulse, delayed pulse, symmetrical & asymmetrical recycler pulse, and symmetrical &
asymmetrical recycler pause. Timer charts showing the operation of these are shown in appendix.
The time settings are entered by clicking on the time required and entering the data in HH. MM.SS.S
format. Once entered click on OK to accept the settings change.
All timers require a single input from either an input block or another function block. The block
output must be connected to another function block or an output block.
Time settings for standard timer types are set via CALogix software. To adjust timer settings
remotely via an operator panel, SCADA or field device ensure that the ‘remote’ box is ticked in the
function block ‘properties’. This feature is only available for ‘on’ and ‘off’ delay timers, other timer
types can be created from these basic timer blocks, contact CAL for more information. The data
register in which the timer can be accessed remotely is shown outlined in the function block when
the logic program has been downloaded to CALogix, see below.
6
Counters
Counters blocks will give an output after the input has received a user specified number of input
pulses. Two types of counter blocks can be selected: counter reset and high speed counter. The high
speed counter can count pulses up to 1 kHz and counter reset to a frequency of 10 Hz. Otherwise
both counters function in a similar way.
If using a high speed counter, the physical input for the counter must be from input 1 on the logic
I/O module.
A counter requires two inputs to operate, a count input and a control input. As pulses are received
at the count input the counter will increment, an output is given when the set number of counts is
received. The counts received will reset to 0 when the control input goes to a high-state (1), the
block output is also reset to a low-state (0) if the count value had been previously reached.
The operation of each of the input 1 and 2 can be selected in the properties window shown above.
It is also possible to select whether the counter will increment on a rising edge (low to high state) or
level triggered (i.e. when input reaches and is stable at a high state). This is set within the trigger
parameter within the properties window.
Comparator
Comparator blocks take a voltage level from a logic I/O module and compare the value with either a
constant or the value of another logic I/O module input.
Comparators convert the input level to a percentage of full scale e.g On a logic I/O module input
with range of 0-24V, an input voltage of 2.4V will be considered to have a value of 10.0 in a
7
comparator block. The compare function allows a greater or a less than comparison with the input. If
the comparison is true the block will have a high-state output (1).
The block will require one input for comparing with a constant or two when comparing inputs. The
output must be connected to an output or another function block.
Inputs
Inputs block provide a link from physical inputs to control logic functions. There are four types of
input:
1) Physical input – the input block status mirrors the current state of a physical input on a logic
I/O module.
2) Power Up - the input status is high (1) when the CALogix unit is powered on.
3) Output (In) - The input block status mirrors the output state of a PID or a logic I/O block.
4) Soft I/P – Soft inputs allow logic to be triggered remotely from an operator panel, SCADA, or
field device. There are 8 soft inputs (0-7) available within a CALogix base unit and restored in
a single register.
Outputs
Output blocks require a single input from other function blocks or an input block. Do not connect the
output of an output block to other function blocks.
Physical output
To control output on a logic I/O module a physical output block is used. To configure an output block
select the module number and the output. When connected to logic function blocks the specified
physical output will switch as the logic driving the output changes state.
8
Figure 2-9 Setpoint value window
Manual Power
PID control can be suspended and replaced by a constant proportional output by using a manual
power function block. The value is entered as a % of full power (i.e. 100% = output fully on).
Manual power can be selected to apply to SP1, SP2, or SP3 of a specified module and will operate
when input to block switches from low (0) to high (1) logic state. To return to PID control to manual
power an additional block can be created within the logic program to set manual power value to 0.
Autotune
A PID module can be tuned using an output logic block. Autotune@75%SP (3/4 setpoint) or
Autotune@ATSP( at setpoint) can be selected for the required PID module.
PARK can also be selected to disable the controller outputs. In a situation where PARK is activated
using a logic function, the controller can only be taken out of PARK by changing the mode settings in
CALogix-sw or via an operator panel.
Event Input
Event inputs are set within the programmer functions of CALogix. If required within a program, a
profile will be held in his current position until an event input is received.
9
Select the module number and give the event a numerical tag that corresponds to the required
event input.
For easy identification it is recommended that you give an event input the same number as the
segment in the program. For instance if the EIP segment is 4 then set the event input to number 4 in
the logic. This means that when the EIP segment is displayed it will appear as EIP4.
Program
A program output can be used to run, stop or hold a program (profile). Select the module and the
program number along with the control mode.
When the input to block is high (1), the chosen programmer function will be activated.
Inverting inputs
Function blocks inputs can be inverted in the following way:
10
4) Click on OK to accept the setting.
Validating a Program
Once a logic program is complete click icon on the logic toolbar. A check is hen carried out for
program validity and any errors are displayed. See example below.
click on the logic toolbar and the logic running LED should switch off.
Trace Mode
Trace mode allows a user to monitor a logic program as it is running. After a logic program is started
11
Figure 2-18 Green means the logic is ‘1’
As the output of a function block becomes active (1) a green triangle is shown on the top left corner
of the block.
Figure 2-19 Logic and physical output function blocks are active
Current timer and counter values are also shown within the logic block and will show changes as
they occur. While trace mode is on the logic desktop will be in read only mode, no changes to the
Note: As windows is not a real time operating system there may be a delay from when an action occurs at the controller to
when it is displayed within a CALogix-sw. This delay may be reduced by closing down other applications whilst CALogix-sw
is running.
12
Exercise 1 Setting up a logic sequence (Channel3, Module3)
Step 1: Right click on the image of the controller. Click on the: “Properties” and click “Module 3”
(You will notice that there are settings for three inputs and that these correspond to the three inputs on the 38-54-PC
controller. Each input has an associated output; input1 to output a, input 2 to output b and input 3 to output c.)
Step 2: Double click on the right-hand side column and from the drop down option set the input
voltage for all three inputs to 24 V. OK these settings.
(This will be the operating voltage that we will use to operate the logic control sequence using the 24V dc supply available
on the controller panel)
Step 3: Click “Logic icon” on the tool bar to open the logic circuit construction window
Step 4: Click “Red square” icon to stop the logic module operation.
13
For this ‘First exercise’ we will use ‘basic logic gates’ to perform simply tasks.
Consider a requirement where two signals have to be the same logic level such as in the case of a
heating furnace with an access door.
One way to approach this problem is to build a truth table applying logical requirement.
Only when the heat is off and the temperature is at a safe level will the door lock be
released such that the furnace can be entered.
To implement this we need a logic gate that when both inputs are ‘0’ the output is at ‘1’.
This type of logic gate is called a ‘NOR’ gate. When input1 NOR input2 is at ‘1’ the output is at ‘1’
14
Step 5: Click “Boolean logic” holding down the left button of the mouse to place a logic AND gate on
the desk top.(This is always the first logic gate in the series.)
Step 6: Left click to highlight the graphic and then right click to select “Properties”.
Step 7: Left click on the down arrow to open a drop down box and select the “NOR” gate from the
options and click “OK”. (The NOR gate should now be on its own in the logic window. We need now to attach the
inputs that represent the interlock switches.)
Step 8: Click and hold down the left mouse button on “Module Input” icon
(Drag across the INPUT and locate it slightly above and on left hand side of the NOR symbol. Release the mouse
button to see the INPUT symbol. Note that this will show the module number and input.)
15
Figure 3-8 Module Input block
Step 9: Right click on the “input” symbol and select the appropriate module; in this case “module 3”.
Select the input that will be used for one of the interlock switches to input 1. Click OK to set the input to module 3, input 1
(To reposition any of the symbols left click to highlight, move the mouse over to the shaded area of the box to obtain a fine
cross near the mouse pointer. Click the left mouse button and hold down, drag the symbol to the desired position, release
the mouse button. )
Figure 3-10 Click on the Link icon (arrow symbol) on the tool bar
Figure 3-11 Drawing a dotted line between the edges of the two symbols
16
Figure 3-12 Release the mouse button when the link is in position
Step 11: Add a second input block and allocate it to “Module3” and “Input2”.
(Connect this second input block to the logic gate as previously described. Note the linking tool will remain in operation
until the Arrow icon is clicked off. If it remains on further logic circuit construction will be prevented)
Step 12: Left click on the “Module Output” hold down the mouse and move the mouse to place the
output block in front of the logic block.
17
Step 13: Connect a link between “Logic block” to the “Output block”.
When the circuit is complete it can be validated by clicking. Click on this symbol to validate your
circuit.
If there is an error in the connectivity or the logic functionality it will be indicated in the logic window. Should an error be
displayed check and correct if necessary and re-validated the circuit.
Step 14: Write the logic program to the CPU by selecting the “Write logic data”.
Step 15: Check that the changes have been recorded by selecting the “Read logic data”.
The next step is to connect the physical input and output connection of the logic module (channel 3)
to the appropriate external components. We will use the two switches, SW1 and SW2 on the
controller panel for the inputs and for the output, the release door signal, LP2.
18
Figure 3-20 Physical Input and Output Connection
From our truth table it can seen that both input should be initially at a ‘1’ (high) state.
It is often the case that available component do not match the required function such that an
alternative has to be considered. This situation exists with the switch type (push to make contact)
that is available. To use this type of switch with the logic it is necessary to connect a ‘1’ to our logic
input when the button is pressed.
Changing the logic function. We now have: when both inputs are at ‘1’ the condition for opening the
furnace door, the output will be at ‘1’ to release the door mechanism. The logic for these condition is
an AND gate. Substitute 24V for logic ‘1’ and we have a workable circuit to match the components
available.
In your previously configured circuit, change the NOR gate to an AND gate and write the change to
the controller. The resulting circuit should be as show in Figure below
19
Make the connections as show below
Run the configuration by selecting the “Start Run Mode” icon, this removes the ‘hold’ on the
module operation.
Step16: Test the function of the logic circuit by pressing SW1 and SW2 separately at first and then
together.
(You will see that LP2 is lit(door release) when both inputs are active, meeting the criteria that when the furnace heat has
been turned off and the temperature is at a low save value it is safe to open the door and enter the furnace.)
Step18: Press and hold SW1 for a few seconds and you will see the input route highlighted.
Step19: Repeat for SW2 and then for both switches pressed together.
(You must select the run mode (green square icon) for the trace facility to work. To return to normal operation select the
trace off by clicking on the trace icon)
20
Experiment 2 Exercises on Logic Function
Exercise 1
Goal: Modify the existing circuit such that when SW1 is pressed the LP1 lamp cycles on and off and
the pressing of SW2 with SW1 brings on LP2.
Step 2: Click on the third icon (clock face) and place theOn delay block above the AND block
Step 3: Right click on the block and select from Properties from the drop down list the Symmetrical
Recycler pulse.
Step 4: Click into the time box on the lower section and enter HHH:MM:S2.S. This will appear as 2
seconds in the timer block. Click OK.
Step 5: Place an output block (5th icon) above the existing output block.
Step 7: Set the module to 3 and the output to 2 and click OK.
Step 8: Click on the Arrow icon and link from module 3 input 1 block to Sym Pulse block.
Step 10: Check the circuit using the validation function, tenth icon .
Output (b) on CH3 is required to be connected to PL1 to indicate when SW1 is pressed.
Step 11: Connect the + terminal of LP1 to the +24V output socket.
Step 13: Connect the other terminal on relay b to the 24V – terminal.
Step 15: Test by pressing SW1, LP2 will not lit but LP1 will be cycling on and off at a rate of
approximately 2 seconds.
Step 16: Test by pressing SW2, LP2 and LP1 won’t lit.
Step 17: Test by pressing SW1 and SW2, LP2 will lit and LP1 will be cycling on and off.
21
Figure 4-1 the block diagram of Logic Exercise 1
The resulting logic circuit should look like the figure above.
Exercise 2
Goal: Configure a 24V logic circuit that will light LP1 when either one of two input switches are
activated. When both switches are activated together, an audible alarm is set off with time interval
of 2 seconds on and 5 seconds off.
Investigate the logic circuit using the Trace mode to verify functionality and test the full circuit with
input switches, LP1 and alarm already wired correctly.
22
Exercise 3 Using Process Controller Panel to control water level
Step 1: Click “Logic icon” on the tool bar to open the logic circuit construction window
Step 2:Setting “Input Block” to ‘Module 1’ and ‘Input 1’ for Level sensor.
Step 3: Setting “Compare Block” icon and setting the ‘Compare Input To Constant’ and Value “80”
23
Step 4: Setting “Output” to ‘Module 1’ and ‘Output 1’ for Water pump.
Step 7: Click on “Write logic data” to write the logic program to the CPU.
24
Step 8: Click on “Read logic data” to check that the changes have been recorded.
Step 9: Connect “Input”, from “Level sensor” to “4-20 mA i/p” on process controller panel
Step 10: Connect “Output”, from “4-20 mA o/p” to “Pump 4-20mA input”
25
Step 11: The result connection
26
QUESTIONS
27