| Program List |
Comment |
| Read CH1 |
Read CH1 and CH2 to determine difference |
| Read CH2 |
|
| Subtract |
|
| Save Mem6 |
Save difference in Mem6 |
| Save Mem6 |
Save difference in Mem6 |
| Del S |
Delete stack, this is equivalent to pressing clear on calaulator.
This is done to prevent possible stack overflow and makes the equation
easier to read in the simulator. |
| Read CH1 |
|
| Gosub ChkCh1Lo |
Check if CH1 is below dropout value |
| Read CH2 |
|
| Gosub ChkCh2Lo |
Check if CH2 is below dropout value |
| Read Mem4 |
A deviation test is only required if either CH1 or CH2 are above
the drop out values. The following lines check if above dropout by
testing the values in Mem4 and Mem5, if either is above 0 then the
deviation test is performed at line DevTest. |
| If > 0 Goto DevTest |
|
| Del S |
|
| Read Mem5 |
|
| If > 0 Goto DevTest |
|
| Goto SendExit |
If both M4 and M5 are below 0 then the program will continue to
this point.LAB: SendExit is the general exit point. The Exit command
on the next line is never executed and has been added for clarity. |
| Exit |
----------------------------------- |
| LAB: ChkCh1Lo |
TEST if CH1 is below Con_a |
| Con_a |
|
| Subtract |
Subtract 'Con_a' from CH1 |
| If < 0 Goto Ry1Off |
Go to line Ry1Off if CH1< Con_a |
| Del S |
|
| Con_I |
|
| Save Mem4 |
Save Con_i in Mem4 |
| Del S |
|
| Return |
Go back to last gosub command |
|
----------------------------------- |
| LAB: Ry1Off |
|
| Del S |
|
| Con_j |
|
| Save Mem4 |
Save Con_j in Mem4 |
| Del S |
|
| Return |
Go back to last gosub command |
| Exit |
----------------------------------- |
| LAB: ChkCh2Lo |
TEST if CH2 is below Con_a |
| Con_a |
|
| Subtract |
Subtract 'Con_a' from CH2 |
| If < 0 Goto Ry2Off |
Go to line Ry2Off if CH2 < Con_a |
| Del S |
|
| Con_I |
|
| Save Mem5 |
Save Con_i in Mem5 |
| Del S |
|
| Return |
Go back to last gosub command |
| Exit |
----------------------------------- |
| LAB: Ry2Off |
|
| Del S |
|
| Con_j |
|
| Save Mem5 |
Save Con_j in Mem5 |
| Del S |
|
| Return |
Go back to last gosub command |
| Exit |
----------------------------------- |
| LAB: DevTest |
The Deviation Test checks if the difference between CH1 and CH2
are within the deviation value Con_b. |
| Del S |
|
| Read CH1 |
|
| Read CH2 |
|
| Subtract |
|
| ABS |
CH2 is subtracted from CH2 and the sign removed, |
| Con_b |
59 |
| Subtract |
Con_b is then subtracted. |
| If < 0 Goto SendExit |
If the value left in the calculator stack is < 0 then CH1 is
within the deviation value of CH2, Mem4 and Mem5 already hold the
correct values to control the relays and the program will jump to
the exit point at LAB: SendExit |
| Del S |
|
| Read CH1 |
The Deviation Test Failed as the value left IS NOT < 0 then CH1
and CH2 are outside the deviation value, the program will continue
to this point. Determine if CH1 > CH2 or CH2 > CH1 and switch OFF
the appropriate relay. |
| Read CH2 |
|
| Subtract |
|
| If > 0 Goto Rely1Off |
|
| Con_j |
CH2 is > CH1 |
| Save Mem5 |
Save Con_j on Mem5 |
| Goto SendExit |
Goto exit |
| Exit |
---------------------------------- |
| LAB: Rely1Off |
|
| Con_j |
|
| Save Mem4 |
Save Con_j on Mem4 |
| LAB: SendExit |
General program exit point. Used to send the values in MEM4, MEM5
and MEM6 to the computer adaptor. The module will function without
these commands, they have been included to monitor the values in these
locations while testing. |
| Send M4 |
|
| Send M5 |
|
| Send M6 |
|
| Exit |
----------------------------------- |