You are on page 1of 10

Monitoring and Control

Systems
Unit 7
Logistics:-
Monitoring can be described as the measurement of some physical property (such as temperature, pressure, light intensity,
flow rate or movement) using a measuring device that records a value that can be transmitted to a computer such as a
SENSOR (a device that measures a property and transmits it to a controlling computer). Such a MONITORING SYSTEM
can be used for ANY ONE of the following reasons:-
• To check if the monitored values are in acceptable limits (if not then some immediate action will be required).
• To continuously monitor if the controlled property is as required. If there is a change then the CONTROL PART of the
system will have to take appropriate actions to reverse the change using a device such as a ACTUATOR (a device that
receives a signal

As it can be seen in the diagram, both ADC (Analogue to Digital Converter)


and DAC (Digital to Analogue Converter) are two integral parts of a Computer
Controlled Environment. There is also an ACTUATOR that is an electrical
motor that drives a controlling device (not shown in diagram). The system
shown in the diagram represents a continuous environment where (1) when a
measurement is made (2) IF NEEDED then a control action is initiated. (3)
Following the control action a measurement is taken again which introduces
the element of FEEDBACK in the whole system.
Furthermore, a CLOSED LOOP FEEDBACK CONTROL SYSTEM is a
special type of monitoring and control system where the feedback directly
controls the operation. In such a system a MICROPROCESSOR functions as
a CONTROLLER. It compares the actual value (as read by sensor) with the
desired value and transmits a value to actuator based on the difference
calculated.
What is Real Time Programming?
All SIMPLY MONITORING or MONITORING AND CONROLLING systems require a REAL TIME
PROGRAMMING in which a sensor must repetitively take sensor readings for the whole time the system is turned on. IF a
simple loop is used then this would mean that readings are taken EVERY CLOCK CYCLE which is unnecessarily frequent.
However, if the repetitions for taking sensor readings is controlled through a TIMED SEQUENCE (maybe by introducing a
delay inside the loop) then the number of sensor readings can be reduced.

The program shown here (ß) has the following


features :-
• The Loop is infinite
• Before the OUTER LOOP to restart an INNER
LOOP (for loop) is run that does nothing but
create a delay.
• If a sensor reading indicates a problem a
procedure is called within the loop to generate a
notification.
• Following this procedure call the BOOLEAN
variable has to be reset to prevent the warning
procedure from being called repetitively.

The Code shared here represents a system that is controlling a
ENCLOSED ENVIRONMENT that contains sensor to
MONITOR a property and an actuator to CONTROL a
property. As it can be seen that a procedure is called to activate
the actuator only if a sensor reading shows a significant change.
The code will only work properly if it can be ensured that the
activation of the actuator has caused a change in the property
before the sensor reading in the next iteration in the loop.

The program shown here has the following features :-


• The Loop is infinite
• Before the OUTER LOOP to restart an INNER
LOOP (for loop) is run that does nothing but create
a delay.
• If a sensor reading indicates a problem a procedure
is called within the loop to generate a notification.
• Following this procedure call the BOOLEAN
variable has to be reset to prevent the warning
procedure from being called repetitively.
Bit Manipulation
A different approach can be to set
values for BOOLEAN variables
subject to what the sensors detect.
For example if a controlled
Monitoring and control program would be checking whether any of the four
environment has TWO
flags were set. The machine code for running such a program could use
PROPERTIES to be monitored then
individual bits to represent each flag. The way that flags could be set and
FOUR BOOLEAN VARIABLES
read are illustrated by the following assembly language code fragments in
can be used in the following manner
which the FOUR least significant bits (positions 0, 1, 2 and 3) of the byte are
(for example).
used as flags.
CODE DESCRIPTION
LDD 0034 Loads contents of Address 0034 to ACC. Performs BITWISE AND operation of the
AND #B00000000 contents of the ACC with 0 to convert each bit to 0.
STO 0034 *any bit AND 0 is 0.
LDD 0034 Performs BITWISE XOR operation to invert the 0th bit of the bytes. Basically it changes the
XOR #B00000001 value of Flag1
STO 0034
LDD 0034 Retains the value in position 1 (Flag 2) may it be 0 or 1 and sets all other bits to 0. A
AND #B00000010 instruction following this instruction compare this bye with the binary value of 2 to see if the
STO 0034 Flag 2 has been set.
LDD 0034 Bitwise OR operation of the contents with mentioned BITMASK will cause the bit 2 (Flag 3)
OR #B00000100 to be set to 1 while all other bits will remain unchanged.
STO 0034
A zoo needs to control the climate to accommodate the living conditions for different animals. The zoo uses a
computerized system which in turn makes use of actuators. These actuators will operate devices which adjust the
microclimate. The actuators to control the climate in Tank 4 uses memory location 0804. Bit 5 of this memory
location controls the heater. Use some of the assembly language instructions to write the instructions that will
ensure bit 5 of location 0804 is set to 1

First, we need to find out which tank we want to make changes to.
In this case, tank 4 which is address 0804 so we have to load the address
0804 to the actuator.
Then we need to make sure that bit 5 is switched on. (Turn it on if it is off and
Keep it on if it is already on)
We can use the OR operation for this task as it matches our requirement
our mask will be 00100000. Further Practice

The instruction is OR #B00100000


Finally, we have to give this instruction to the actuator so that it can start to
alter the temperature of the tank.
In other words, we need to store the instruction in the actuator’s memory
and more specifically, we store it at address location 0804.
The instruction is STO 0804.
BITREG COUNT VALUE ACC
B00001010 0 1 00001010
0 0 0 0 1 0 1 0 00000000
0 0 0 0 1 0 0 0 1
0 0 0 0 1 0 0 0 2 2
00001010
00000010
0
1 1
2
4 4
00001010
00000000
4
8 8
00001010
00001000
1
2 2
8
2
BITREG COUNT VALUE ACC
0 0 0 0 1 0 1 0 B00001010 0 1 B00001010
0 0 0 0 1 0 0 0 B00000000
0 0 0 0 1 0 0 0 1
2 2
B00001010
B00000010
0
1 1
2
4 4
B00001010
B00000000
4
8 8
B00001010
B00001000
1
2 2
8
2
9608/32/O/N/17
9608/31/M/J/18
9608/31/M/J/20

You might also like