README FOR MULTIPLE ALTIA UCB BLOCK PACKAGE



This package is available at:  ftp://ftp.altia.com/pub/outgoing/multiucb.exe

The files in this package allow you to use multiple Altia UCB blocks in a single MATRIXx SystemBuild model. As provided, it supports up to 9 Altia blocks. This is in addition to the single Altia block already supported by SystemBuild for MATRIXx releases 6.06 or newer.


Preparing to Install New Files

If this package comes as a self-extracting zip archive or a simple zip archive, it will create a directory named multi_altia_ucb when it is unpacked.

Change to the multi_altia_ucb directory in a file browser window before attempting to install any of the new files. Then read the steps below.


Installing Altia UCB Files for Simulating with Multiple Altia Blocks

These Altia UCB files must be installed for each individual project that requires multiple Altia Blocks. This means you must perform the following steps for each unique project directory.

1. Copy the files altia2mtx1.c through altia2mtx9.c and altiamtx.h to the project directory. You might want to also copy the readme.txt file for future reference.    Also copy makeucb.mk to the project directory, but BE CAREFULL if  you already have some of your own custom UCB code in the project  directory. In this case, you will probably already have a copy of  makeucb.mk. You want to merge the customizations in Altia's version of makeucb.mk into the existing makeucb.mk if it has been previously customized. The Altia customizations are changes to the definitions for USRLIBS and CDEFS. These definitions should look like:

        USRLIBS = $(SYSBLD)\lib/libdde.lib user32.lib

        CDEFS = /DPC /DMSWIN32 /DSBUSER /DALTIAEXTERNALUCB

You can open your existing makeucb.mk file in a simple text editor such as Notepad to make the necessary customizations.

 If you don't have a makeucb.mk file in your project directory or you are certain that the one you have is an exact copy of $ISIHOME/mx_<REV>/sysbld/bin/makeucb.mk, then you can copy makeucb.mk from this package directly into your project directory.

2. Start Xmath with the directory set to the same project directory used in step 1 and then start SystemBuild and open your model file.

    TO USE MULTIPLE ALTIA UCB BLOCKS, YOU MUST ALWAYS SET THE DIRECTORY IN XMATH TO THE PROJECT DIRECTORY CONTAINING THE FILES FROM THIS PACKAGE. ALTERNATIVELY, YOU CAN START XMATH FROM A COMMAND PROMPT WINDOW THAT HAS ITS CURRENT DIRECTORY SET TO THE PROJECT DIRECTORY.     IN ANY CASE, THE XMATH WORKING DIRECTORY MUST BE THE PROJECT DIRECTORY BEFORE YOU START SYSTEMBUILD FROM XMATH.

3. Now, you can add the 1st Altia block to your project. Adding the first block is done in the normal way, but we will go through the procedure here for completeness.

To add the first block, just drag the Altia block from the SuperBlock section of the SystemBuild Palette Browser into an area of your model. Select the Altia block just dragged in, press the <Enter> key to open its property dialog and make the following property changes:

Connect the inputs and outputs of the Altia block to other blocks in your design. When you have done this, double-click on the Altia block to open the Altia editor and create a GUI as usual.

4. To add another Altia block, the procedure is a little different. For the first Altia block configured in step 3, you used the Altia UCB code built into SystemBuild (to be more accurate, you used the usraltia1 function built into the SystemBuild simulation executable).

Each additional Altia block must use externally supplied Altia UCB code. The files altia2mtx1.c through altia2mtx9.c, in conjunction with altiamtx.h, supply us this code for up to 9 additional Altia blocks. The make file makeucb.mk tells SystemBuild how to compile these .c files into DLLs (Dynamic Link Libraries) that can be accessed at simulation time.

To add the next block, again drag the Altia block from the SuperBlock section of the SystemBuild Palette Browser into an area of your model. Select the Altia block just dragged in, press the <Enter> key to open its property dialog and make the following property changes:

Connect this Altia block to other blocks in your design. When you have done this, double-click on the Altia block to open the Altia editor and create a GUI as usual.

5. To add each additional block (up to 9 additional blocks), follow the procedures in step #4, but enter a "File Name" of altia2mtx2.c with a "Function Name" of altia2mtx2, a "File Name" of altia2mtx3.c with a "Function Name" of altia2mtx3, and so on.

6. When you have added all your Altia blocks and designed their associated GUIs, simulate in SystemBuild as usual.

When you run your simulation for the first time, SystemBuild will compile each altia2mtxN.c (where N is a number from 1 to 9) that is referenced by one of your Altia blocks. It will only compile the .c files that you referenced so no additional overhead is incurred if you have fewer than 9 additional Altia blocks. For example, if you have 5 additional Altia blocks, only altia2mtx1.c through altia2mtx5.c will be compiled and used at simulation time.

Compiling only happens the first time you run the simulation after adding one or more additional Altia blocks. The results of the compile are displayed in the Xmath window. If a compilation fails, it is probably because you need to make some customizations to the makeucb.mk file as described in step 1 (although none should be necessary if the Altia UCB blocks are your only external UCBs).