Neil C
27 Aug 07, 08:27 PM
I have been set the task of controlling a heating system. The inputs will come from various channels of bus couplers, and the outputs will be the control of relays, which actuate various pumps. These pumps need to be switched on and off according to the status of the inputs. It appears that I will have to provide some custom code via a Pascal controller in order to do this.
Switching the relays on is fairly straight-forward, as when any bus coupler raises a signal, then the various relays which that bus coupler channel require can be actuated on. (Question, - is it right to use the “Once” statement within the Pascal controller to detect this change of state of the Bus Coupler channel?). Some of the relays may already be on, but sending another on signal won’t cause any problems.
However, where the problem will lie, is when a bus coupler channel goes off, and the various relays associated with that channel need to be turned off. The difficulty is that there may be other bus coupler channels on, which share some of those relays, and so these relays need to remain activated. It is therefore not just a question of turning off all the relays associated with that bus coupler channel. What I think is required is some kind of Pascal code which examines the current levels of the inputs from various bus couplers, and then only switches off the relays required. Can anybody please tell me what Pascal code is needed to examine the current levels of the bus coupler channels?
Once these levels have been determined, I would imagine that this is possible using various “if” and “and” statements. For example (using semi-formal english rather than Pascal code), -
if bus cup channel 1 is off, and bus cup channel 2 if off, and bus cup channel 3 is off, then switch off relays 123, 123, and 125;
else if bus cup channel 1 is off and bus cup channel 2 is off, then switch off relays 123 and 124,
else ... (etc, etc).
Does this look correct and feasible? If it is not, then does anybody have any suggestions on how it can be done?
Another question which arises is that when creating the code with the Pascal controller, it appears to not support the continuous running of programs, which in conventional Pascal would be achieved by simply running a continuous loop. As the Pascal controller is running continuously, does the use of “once” statements get around this problem?
So, to summarise, if anybody could answer the following questions, it would be greatly appreciated:
(1) Is the use of the “once” statement in order to find detect changes in state of the bus coupler channels correct?
(2) What code is needed to examine the current levels of the outputs of the bus couplers?
(3) Does the combination of various “if” and “and” statements appear possible, in order to switch off only those relays required?
(4) Will the use of “once” statements provide a mechanism which avoids the continual looping of Pascal code, by activating the various “if” and “and” statements only when there is a change in state of the bus coupler inputs?
Any comments and suggestions would be most gratefully received
Switching the relays on is fairly straight-forward, as when any bus coupler raises a signal, then the various relays which that bus coupler channel require can be actuated on. (Question, - is it right to use the “Once” statement within the Pascal controller to detect this change of state of the Bus Coupler channel?). Some of the relays may already be on, but sending another on signal won’t cause any problems.
However, where the problem will lie, is when a bus coupler channel goes off, and the various relays associated with that channel need to be turned off. The difficulty is that there may be other bus coupler channels on, which share some of those relays, and so these relays need to remain activated. It is therefore not just a question of turning off all the relays associated with that bus coupler channel. What I think is required is some kind of Pascal code which examines the current levels of the inputs from various bus couplers, and then only switches off the relays required. Can anybody please tell me what Pascal code is needed to examine the current levels of the bus coupler channels?
Once these levels have been determined, I would imagine that this is possible using various “if” and “and” statements. For example (using semi-formal english rather than Pascal code), -
if bus cup channel 1 is off, and bus cup channel 2 if off, and bus cup channel 3 is off, then switch off relays 123, 123, and 125;
else if bus cup channel 1 is off and bus cup channel 2 is off, then switch off relays 123 and 124,
else ... (etc, etc).
Does this look correct and feasible? If it is not, then does anybody have any suggestions on how it can be done?
Another question which arises is that when creating the code with the Pascal controller, it appears to not support the continuous running of programs, which in conventional Pascal would be achieved by simply running a continuous loop. As the Pascal controller is running continuously, does the use of “once” statements get around this problem?
So, to summarise, if anybody could answer the following questions, it would be greatly appreciated:
(1) Is the use of the “once” statement in order to find detect changes in state of the bus coupler channels correct?
(2) What code is needed to examine the current levels of the outputs of the bus couplers?
(3) Does the combination of various “if” and “and” statements appear possible, in order to switch off only those relays required?
(4) Will the use of “once” statements provide a mechanism which avoids the continual looping of Pascal code, by activating the various “if” and “and” statements only when there is a change in state of the bus coupler inputs?
Any comments and suggestions would be most gratefully received