McSimAPN: Creating Blocks.
MJMcCann-Consulting

Creating, connecting, moving, defining parameters for blocks.
MJMcCann-Consulting Logo

Normal Menu Route to Creation.
McSimAPN provides a menu route to create blocks of any type.
Start McSimAPN. You can create a model immediately. I often bring up a blank model file that has suitably chosen parameters like the Step size (Delt) and graphing intervals (GrDel) suitable for the sort of model needed. Save it immediately to give it a name.
L-Click on [Grid?] to give an alignment grid for layout. It also causes all blocks to show their ID numbers which will help in connecting up. (Not essential, but you can also see where your cursor was last clicked.)
In the menu, select "Create" , then the block type you want from the drop down list.
The window that appears can be edited to define connections (generally the An, Bn,Cn Dn and Pn values) and the constants associated with each of them, (generally aa, bb, cc, dd and pp values). There are some hints that show on the form, but if you have these help files running there is more detail.
Accept changes and the block is in and connected as appropriate. It is executed (activated) immediately when defined. You can always rt-click on it in the diagram to make changes (see below). Thus you can create a pattern of blocks, ignoring connections, and then go back and connect them later.

Connection points
When you first create a block, it is not connected to any other block. Connections are made by putting block numbers into the column marked connections. They are known as An, Bn, Cn, Dn and sometimes Pn. The block uses the inputs it gets from the outputs of those connected blocks in its calculations.
When you select "Accept any Changes" the block-creation (or modification) menu goes and the diagram will show any connections you have made.
As a minor clue to reading the diagrams, incoming connections (when used) go to little blobs on the left hand side of blocks, in order An, Bn, Cn, Dn, Pn with colours Red, Blue, Green, Black, Purple respectively. Connections made by other blocks to read values (or in the case of Containers and Integrators to insert tokens or fluxes), are made to a point a few pixels inside the block.

Parameters in Blocks
Each input to a block generally has a parameter associated with it. They are known as aa, bb, cc, dd, pp. This allows the input obtained from a connection to be modifed, usually by adding the value of the parameter to the value obtained from the output of the connected block. Since McSimAPN doesn't even look for Block 0, this means that if the value needed is a constant it can be inserted in the second column, leaving a zero in the connections column, and will then become effective on its own.
Some blocks, such as A-Activity, B-conveyor-Belt, D-Diverter, V-Visualizer, X-multiplier attach different meanings to the numbers in the connection column and in the parameters column, so check in the corresponding help file as listed down the RHS of this, and every, Help page.

Modes in Blocks
Many of the blocks have the option to change the "Mode". This provides a means of giving the blocks a wider repertoire. Thus the K-logic block has modes to make it function as: OR, AND, NOR, NAND, XOR. The T-Timer block can be a free running, triggerable multivibrator, a monostable (one-shot), a bistable or a manually triggered one shot. The V-Visualizer, has multiple modes providing various ways of displaying the data from a block.

Changing (Editing) Existing Blocks
R-Click on the block (into the first letter of its name) to bring up the form again with its current values. Remember you may be doing this in the middle of a run, which is allowed. You can edit values including connections and let the run continue.
If you only wanted to read some values, then [Cancel] releases the model without making changes.

Moving Blocks (by drag and drop or by edit)
Left Mouse button down on a block just below and to the right of its left topmost corner (essentially in the first character of its name) and drag to a new position. The new X,Y coordinates (top left of block) will be exactly where the tip of the cursor was as you released. The cursor doesn't visually drag the block around. The block jumps on Mouse-button up.
There is another way, useful if you want a diagram to be very accurately aligned for show, and that is to adjust the X and Y coordinates that define the position of its top left corner.
So far I haven't implemented a multiblock move, nor copy and paste, sorry. However, single block insert and copy are described below.

Rat's Nest Display
The normal McSimAPN display has connections going directly from block to block -- a typical Rat's nest approach to layout.
If you need to clean it up, then you can insert some innocuous block as a transferor. For example, a summation block that can be moved to a convenient position with only the one input you wish to transfer. You may also want to change the input connections of other blocks that use the value you are transfering and reduce the transferor block to its minimal display.
Just remember that in McSimAPN, the ID number sequence is also the computational sequence so if the transferor has a lower number than the transferee there will be a single step delay in passing the value along. Sometimes, that's desirable. However, you can fix it by inserting the transfering block into the sequence to be processed just after the transferee block. See below and the "McSimAPN Operations" help file.
If the multiple 'Graphs' block input connections are a nuisance, they can be supressed at the Graphs block (set Display=4).

Menu Insert or Copy Route to Creation
The menu "Edit" provides for insertion and copying of blocks.
Copy. If you have made blocks that represent a part of a model having more such blocks, then copying may be helpful. It does carry over connections as well as parameters so unless the replicated blocks use the same connections, then it may be wiser to copy to preserve parameters before making connections. The default copying operation puts a new block at the end of the ID number and hence the computational sequence, but copying to an ID number already in use will overwrite. The receiving block moves to or appears at the location of the last click on the diagram as for normal creation proceses.
Insert. The Edit then Insert operation will put a new block of a chosen type in place in the sequence and you can chose its parameters and connections as normally.
The main intention is to make it easier to insert blocks into a sequence for computational purposes. Another use is the insertion of blocks simply to make the display more readable, as mentioned above. When making a new model this is not likely to be needed at first but becomes important in controlling computational sequence. It is further discussed in the Help file about "McSimAPN Operations".

Text Editing Route to creation
The very first versions ran only from a text file input. It's still feasible but very tedious. More reasonable is to edit an existing file. The model files are all straight (flat) ASCII files and can be edited in any text editor. If you look into an example McSim model file you will see origination data and other commentary information, none of which appears in the model. BUT comments for each individual block, if used, are preserved.
Lines which don't start properly or have defects are ignored so McSimAPN won't be upset if you give it a copy of Beowulf, but it doesn't make a good a dynamic simulation. A better approach is to make a preliminary file, showing the key components or samples of the components (blocks) to be used. Then since it is a space separated file, you can run it into MS Excel and use Excel's abilities to copy with numeric changes, to make up files with multiple replicas of clusters of blocks, making Excel do the systematic assignment of block ID numbers and connections. Then save the block definitions as a text file and read it back into McSimAPN.
Not recommended for beginners.

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 visualizer
W sWitch selector/MUX
X multiply
y not assigned
Z random (fuZZ)
& signed summation
% division/difference
@ access/transfer 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: blanktable.htm