@: Access Block.
The purpose of this block is to give access to any of the internal variables and parameters in a block and transfer them to the same or another variable in another block.
It does two transfers, from An to Bn and from Cn to Dn, using any parameters in those blocks. If no block number is defined that connection is ignored. If no parameter identity is given that link is ignored.
It allows transfer of store contents up to the least common size.
Its own output, Vn, is whatever it got from block An (if anything, except no vector of store values).
The second source block, Cn, could be the same block as An but pointing to a different parameter.
For animated motion for example, one Access block processes two transfers so a single @-Access block can, for example, pick up some suitable calculated X and Y values and control the on-screen position of another block by transferring them to that block's internal X,Y values.
The necessary conversions between integer and real (floating point) numbers are made automatically.
Changing a block's ID number, Name or Type is not allowed.
Warning This has been made deliberately open so use it with care. Since you get direct control of the internals of blocks, it's easy to screw up.
For example, you could get some very funny results transfering (Xcode 17) between two memory blocks with different lengths, but if you were making a transfer from a memory to a belt block it could be OK.
You may want to make a transfer only under limited circumstances so the block can be switched On and Off like other blocks.
It is activated as it is created so it can be used just once to make a transfer then left off. (Example: making a function generator out of memory values).
How to use it
Identify the blocks from which you want to extract values.
Get the extraction running as you expect it to perform before connecting up the links for Imposition of values.
Using bb or dd as zero will result in nothing being moved into blocks Bn or Dn, but you can see what comes out of An at the output of the access block and what comes out of Cn can be dumped into a container/constant as a place to see the effect harmlessly.
The Access codes are listed below in the code for the Extract function. The Impose procedure uses the same codes.
Access Block Code
The Xcode defines what variable or parameter will be extracted or imposed. Xcode 17 deals only with compatable stores.
Procedure ActivateAccess(ii:integer); //responds to @ symbol
var XcodeA, XcodeB, XcodeC, XcodeD, HighIndex, jj: integer;
Vc : real;
begin with B[ii] do begin
if OnOff=0 then EXIT;
Vn:=0;
XcodeA:= round(aa); //get value from inside Block An
XcodeB:= round(bb); //to put it in Block B (if allowed)
if An>1 then Vn:=Extract(An, XcodeA); //extract ignores outside range 1-16
if Bn>LastSystemBlock then Impose(Bn,XcodeB,Vn); //impose ignores outside range 1-16
XcodeC:= round(cc); //get value from inside Block Cn
XcodeD:= round(dd); //to put it in Block D (if allowed)
if Cn>1 then Vc:=Extract(Cn, XcodeC); //extract ignores outside range 1-16
if Dn>LastSystemBlock then Impose(Dn,XcodeD,Vc); //impose ignores outside range 1-16
if (XcodeA=17) and (XcodeB=17) then begin
HighIndex:= min(High(B[An].Store),High(B[Bn].Store));
if HighIndex>0 then for jj:=0 to HighIndex do B[Bn].Store[jj]:=B[An].Store[jj];
end{if Xcode};
if (XcodeC=17) and (XcodeD=17) then begin
HighIndex:= min(High(B[Cn].Store),High(B[Dn].Store));
if HighIndex>0 then for jj:=0 to HighIndex do B[Dn].Store[jj]:=B[Cn].Store[jj];
end{if Xcode};
end {with Bii};
end;
Function Extract(ii,Xcode:integer):real;
begin result:=0.0;
with B[ii] do
case Xcode of
0 : begin end;
1 : result:= OnOff;
2 : result:= Displ;
3 : result:= State;
4 : result:= Xn;
5 : result:= Yn;
6 : result:= An;
7 : result:= Bn;
8 : result:= Cn;
9 : result:= Dn;
10 : result:= Pn;
11 : result:= aa;
12 : result:= bb;
13 : result:= cc;
14 : result:= dd;
15 : result:= pp;
16 : result:= Vn;
end{case Xcode};
end;
|
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
|