R: Relay Block.
MJMcCann-Consulting

Switches other blocks on and off, to control their action; active or passive.
MJMcCann-Consulting Logo

Relay Block.
This is unlike other blocks which deal with numeric values computed from the output of other blocks. The relay simply switches other blocks on or off. It does not influence their outputs.
This behaviour imitates the electronic analogue computer in that the control signals and the computed values were all simply various voltage levels.
The same action takes place when a L-click on a block toggles it on or off. A block that is OFF shows grey on the screen. Its output is frozen at the level it had when switched. Exceptions are the Flux, F, and Inductor, J blocks which go to zero flow when off, thus imitating a series switch.
Don't confuse a block being OFF with giving ZERO output. If it was delivering 27.3 as its output value before being switched off then it will continue to show that value while off. It will restart computing and can change when switched back on.

The expected use is in controlling blocks like the A:Activity, B:Belt, D:diverter blocks in the Petri Net group to imitate them being brought in and out of service. For example the relay can itself be controlled by a Timer.
Blocks switched OFF are frozen, if timing out for an next event the timing is delayed while the block is off. Timing starts up again when the block is brought back ON. Tokens are therefore not lost. Containers that are OFF are locked to access by A and D blocks.
Another use is in switching over from one computation to another, freezing one part, while switching on another.

The Relay uses its Av input to decide what to do. If Av=Va+aa is greater than zero, then the Relay state is 1 (On, true). Va is the output of the block at An, etc.
When the Relay is On the blocks identifed by Bn,Cn, and Dn are switched ON, while the block identifed by Pn is switched OFF, and vice-versa.

Relays can be chained since the output value, 0 or 1, is compatible with other logic blocks. So you can use the output of one to control another. But remember that the computational sequence may cause a delay in change propagation if the ID numbering doesn't run like the required sequence.
A relay can be switched off just like any other block.

Relay Block Code
Procedure ActivateR(ii:integer); //detects value on channel A and relays it to other blocks
var Av: real;
Signal: integer;
begin with B[ii] do begin
if OnOff=0 then EXIT; // this block itself may be off so it won't respond.
Av:=B[An].Vn+aa;
Vn:=1.0; Signal:=1; //things are ON by default
if Av <=0 then begin // control neg or zero, switches things off.
Vn:=0.0; Signal:=0 end{if};
if Bn>LastSystemBlock then B[Bn].OnOff:=Signal;
if Cn>LastSystemBlock then B[Cn].OnOff:=Signal;
if Dn>LastSystemBlock then B[Dn].OnOff:=Signal;
if Pn>LastSystemBlock then B[Pn].OnOff:=1-Signal;
end{with}
end{proced};

MJMcCann-Consulting

Help Index:
Index/Search

Background
Simulation Concepts
Continuous Systems
Discrete Systems
McSimAPN Structure
McSimAPN Operation

Using McSimAPN
Start McSimAPN
Save Model,data
Create Blocks
Run-Hold-Reset
Link Excel+VBA

PetriNet Block Types
A activity/action
B belt conveyor
C container/constant
D diverter(random)

Analogue Block Types
E exponents
F flux/flow
G function Generator
H hysteresis
I integrator
J inductor
K logic element
L logarithms
M memory
N note/label
O oscilloscope/graph
p not assigned
Q quantizer/rounding
R relay on/off
S sin/asin/atan
T timer/clock
U user link Excel
V visual voltmeter
W sWitch selector/MUX
X multiply
y not assigned
Z random (fuZZ)
& signed summation
% division/difference
@ access/move values

Invitation. McCann can help if you have a design or operational problem that needs some technical support that is outside your team's experience, some quantitative assessment of what is really the cause of the difficulties, some design alternatives or just a fresh look by an intelligent interrogator.
If you have a problem with the behaviour of a market sector, plant, process or item of equipment and would like to get a quantitative handle on it to improve yield or optimise performance, then contact us. We are always ready to give a little time to discuss a new puzzle, in confidence, of course. We'll only worry about fees when we have some defined work. We can be flexible about how we work with you.
Top
MJMcCann-Consulting,
POB 902,
Chadds Ford PA
19317 USA.
T: 1 302 654-2953
F: 1 302 429 9458
E: mjmccann@iee.org
Request. Please let us know how you found this software and your interests by sending an email to mjmccann@iee.org Thank you Date: 2012.02.26
File: r.htm