MATRIXx 8.0 Release Notes

 

NOTE: The term “inoperative” refers to a feature/capability that is known to be not working, but maybe visible in the product. Inoperative features are expected to be fixed in a future update release. A “deprecated” feature is one that was deliberately removed or has limited support just for compatibility. However, a deprecated feature is one that will likely be completely removed in a future release. Continued use of a deprecated feature is not recommended.

 

Version 8.0.1

This section describes important changes made for this release.

 

 

Compiler Requirements for Xmath, Simulator and AutoCode

Configuring environment variables for C++ compiler [Windows]

 

Visual C++ should be configured for "command line compilation". Normally at the end of Visual C++ compiler installation you will be presented with a dialog "Setup Environment Variables". Check the box "Register Environment Variables" and finish the installation.

 

If you failed to do the above described configuration during installation, you will have to re-install the whole Visual C++ package to re-configure. However, there are some alternate ways you can set the environment for MATRIXx. See Setting the Environment for .NET 2003/2005 Compilation (UCBs and LNXs)  [Windows only].

 

FORTRAN Compiler Requirement [Windows]

 

Due to upgrading to the .NET 2003 suite, you must also upgrade the FORTRAN compiler to one that is compatible with .NET 2003. We recommend the Intel Visual Fortran Compiler 10.0 or later.

 

 

HyperBuild

 

This advanced simulation capability was found to be broken in the previous release. The issues have been resolved and now work as documented in its user guide, with the following addendums:

 

 

UCB Compatibility

Compatibility with a simucb.dll built in v7.x [Windows]

A simucb.dll built in v7.x is automatically recognized in v8 by the Simulator tool and the simulator will use that DLL ‘as is’ for the purposes of simulation. The simucb.dll is treated as a “Manual” built UCB DLL, which means that it will not rebuild the UCBs to use it within v8. The simucb.dll will be rebuilt to the new format when the simucb.dll does not contain the UserCodeBlocks the simulation requires.

 

This capability facilitates moving between both v7.x and v8.0.x of the same simulation without any changes. Note however that a simucb.dll built by v8.0.x is not backward compatible with v7.x.

 

 

Project System

FileSuperBlock Compatibility

 

The FileSuperBlock is partially deprecated within v8.0 but due to compatibility requirements, it is partially supported. The following is a summary of the compatibility features present in this version.

 

The following capabilities are not supported in v8.

 

If possible, we recommend transitioning your models away from using FileSuperBlocks. In future releases, there should be complete project system capability to do the kinds of things FileSuperBlocks were intending to do in a much more open and flexible paradigm. Eliminating a model’s FileSuperBlocks is relatively easy and there are at least three approaches you can take.

 

One approach is to obsolete your use of FileSuperBlocks completely and use the project system.

 

The second approach is similar to the first approach, except that you don’t need a project, you save everything to a new savefile, essentially merging all of the diagrams into one.

 

The third approach is to keep the basic idea of FileSuperBlocks (i.e. models kept in separate files not normally loaded) within v8. You can ultimately use a project or not. This approach converts the FileSuperBlocks into regular superblocks, yet keeps them ‘undefined’ for later resolution. Note, this approach will require that for simulation all of the savefiles are loaded into the project system before simulation.

 

Known Issue

 

Xmath

Changes worth mentioning:

 

 

Xmath Processor Affinity [Windows]

We removed the hard-coded limitation on processor affinity for the Xmath server process. Tests show that multiple Xmath sessions properly utilize multiple cores/processors. As a result, spawned processes from the Xmath session (e.g. sim) will run on multiple cores/processors.

 

PGUI

Small changes worth mentioning:

 

PGUI Issue

There are a couple of PGUI commands that use a modal dialog to prompt the user for input. In some cases, when the command is used without any other PGUI windows, the dialog window will appear behind the IDE’s windows. A work-around is to create a PGUI window before prompting for a file. (This applies to uiPrompt as well). The following is a portion of a script which shows creating the PGUI tool and window before calling the uiFileSelection command.

 

alias T "getfile"

 

## created a tool context and a window to ensure fileselect is 'on top'

void = uiToolCreate(T);

uiWindow(T, {name="xx",title="",visibility=1,height=0,width=0,xr=0,yr=0});

 

result = uifileselection(T, {pattern = "*,*", flags="o", title="Select File", value="c:\program files\"});

display result

 

# destroy the tool

uiDestroy(T);

 

It’s important to note that this issue only appears when there are no other PGUI windows yet created. Thus, a typical PGUI mathscript command does not have this GUI issue as there would likely be a ‘main window’ created before any file selection or other prompt occurs.

 

SystemBuild

Changes worth mentioning:

 

SBA

A new command was added to SBA.

 

 

 

Version 8.0.0

The following items are not in the 8.0 release. We are planning to include these features in a subsequent release.

 

Notes on MATRIXx IDE Application

o       Specify the name of a solution, project file, SystemBuild model file or Xmath data file (.xmd only) to load.

§         Example: $MATRIXX\bin\matrixx.bat c:\proj\engine_project.proj-mtx

o       The option –newproject creates an new project with the name “Empty Project”

§         Use –newproject=name to create a new project with the specified name.

§         Use –newproject=name,modelfile to create a new project with the specified name and the model file loaded into it.

·         example: -newproject=Engine,c:\projects\engine.sbd-mtx

§         If the name or modelfile contains spaces, you must quote the whole option, for example “-newproject=Cruise Control”

 

 

Notes on the Project System

 

Some additional notes regarding the project system are listed below.

 

 

Xmath Data and the Project System

 

The project system treats Xmath data as foreign data to some extent. You are responsible to decide how to save the Xmath variables and there are several ways to accomplish this task. Experienced users tend to save multiple data files of Xmath data. Sometimes, startup scripts or other scripts manually executed perform the loading and saving tasks needed for a model. Another way to help with this issue is to use the project system and configured projects. A configured project offers startup, closedown and data save features.

 

When enabled, the data save occurs when the project closes, i.e. when it is removed from the solution, the solution is closed or the application closes. This save is not related to the save of the project. The Xmath data save feature of the project system may not be suitable under all circumstances because it is effectively a ‘blind’ save of the data in Xmath when the project closes. More complicate data arrangements may require the use of the closedown script feature to better selectively save data. In some circumstances maybe only you can judge when to save the Xmath data, therefore you must initiate the save manually.

 

Xmath data files saved with the .xmd file extension are recognized by MATRIXx. If you double-click on this kind of file from the Windows desktop, MATRIXx IDE will start and a new empty project will be created with the data file loaded into the Xmath session. Also, if you add a file with the .xmd extension into a project’s Files folder, you can select one or more of those kinds of files, right-click and select the Load Xmath Data menu option, which will load the files into the project’s Xmath session.

 

We are desirous of customer feedback on how Xmath data should be managed by the project system to better assist your day-to-day use of the product. In future updates of MATRIXx, we expect to reflect our customer’s needs in this area of the product.

 

 

Notes on the SystemBuild Editor

 

The new editor is quite a departure from the previous one. It conforms to “standard” Microsoft Windows behaviors:

 

 

 

Short-cut Keys

 

The following table contains the short-cut key sequences supported within the SystemBuild editors. The table uses a common Windows notation for describing key sequences. For example, “Ctrl+X” means pressing both the <Ctrl> key and <X> key simultaneously.

 

Key Sequence

Meaning

Selection Sensitive

SuperBlock

STD

UDT

DataStore

Ctrl+X

Cut to clipboard

ü

ü

-

-

-

Ctrl+C

Copy to clipboard

ü

ü

-

-

-

Ctrl+V

Paste from clipboard

 

ü

-

-

-

Ctrl+S

Update into project

 

ü

ü

ü

ü

Ctrl+P

Print

ü

ü

ü

-

-

Ctrl+W

Close

 

ü

ü

ü

ü

Delete

Delete

ü

ü

ü

-

-

 

 

Alt+D

Toggle normal/reverse block direction

ü

ü

-

-

-

Alt+F

Fit diagram to display in window

 

ü

ü

-

-

Alt+Shift+F

Normal size (100% zoom)

 

ü

ü

 

 

Alt+H

Show/hide block ID

ü

ü

-

-

-

Alt+I

Cycle input pin mode

ü

ü

-

-

-

Alt+L

Show/hide output labels

ü

ü

-

-

-

Alt+N

Cycle name location

ü

ü

-

-

-

Alt+O

Cycle output pin mode

ü

ü

-

-

-

Alt+R

Cycle block rotation

ü

ü

-

-

-

Alt+T

Cycle icon types

ü

ü

-

-

-

Alt+Shift+I

Connection Editor to connect to external inputs

ü

ü

-

-

-

Alt+Shift+O

Connection Editor to connect to external output

ü

ü

-

-

-

Alt+Shift+B

Connection Editor between two blocks

ü

ü

-

-

-

Alt+=

Enlarge (increase zoom) diagram view

 

ü

ü

-

-

Alt+-

Reduce (decrease zoom) diagram view

 

ü

ü

-

-

 

Setting the Environment for .NET 2003/2005 Compilation (UCBs and LNXs)  [Windows only]

 

The MATRIXx Simulator tool and Xmath cooperate in automatically compiling and linking UserCode block source files and your LNX executables. This requires that the environment to run the Microsoft®.NET compiler is properly configured. The environment must be setup before starting the MATRIXx IDE. The following techniques are the recommended ways to accomplish this task.

 

 

Notes on PGUI

 

The underlying graphical system of Xmath's Programmable Graphical User Interface (PGUI) has been completely replaced with a new GUI layer. As a result, the graphic look of PGUI windows is now more modern and consistent with the specific platform being run on. However, the new graphical system has exposed many design flaws in the PGUI scripting language. As much as possible, we've matched the old behavior, but in many cases, it's not possible to match, as the old behavior was wrong, crashed, or non-existent. The scripts will work 'as is'. But, you may need certain 'tweeks' to make the UI look better.  The PGUI scripts within Xmath have been updated, so you can use those as examples.

 

Here's some of the issue that were discovered that may help you updating your scripts:

 

Notes on SBA

Having to make SBA work within the new framework, required us to make some changes and additions to SBA commands. It also allowed us to fix a lot of discrepancies between documentation and actual behavior and command inconsistencies. Below are the changes that might create some migration issues or are worth noting because of a difference in behavior.

 

General information about SBA changes is listed below:

 

o       Use the EditCatalog command and specify the object to be the current object.

o       The CREATESUPERBLOCK, CREATESTD, CREATEUSERTYPE set the current object to be the new object just created.

o       Specifying an object name for the MODIFYSUPERBLOCK, MODIFYSTD, MODIFYUSERTYPE commands set the current to the specified object.

 

 

Specific issues regarding SBA commands are listed below.

 

 

 

Notes on Xmath

Console Visibility

 

The Xmath Server process is a console application. By default, the Server's console window is not shown when running MATRIXx. You may show  or hide  this console window using the following commands.

 

show console

hide console

 

These commands may be placed in one of your startup.ms scripts.

 

User and Home Directory Information

 

Xmath expands environment variables when in constructs a filename for any of its commands or functions that expect a filename.

 

Xmath also expands '~' (local home directory) and '~user' (for a user's network home directory). This capability is typically used on UNIX systems; however, Xmath extends it use for the Windows user.

 

In the following description, the rules for the Windows platform (as shown below) use environment variables delimited by '%' characters. On a UNIX platform, these rules will not be used. In place of these rules, Xmath, on the UNIX platform, will use the information returned from the getpwnam_r() system call.

 

To show your user settings type the following.

 

show user

 

On Windows, the command displays the following for "MySelf", the current logged in user.

 

Setting username to MySelf

1. $HOME = U:\MySelf

2. %HOMEDRIVE% = C:, %HOMEPATH% = \Documents and Settings\MySelf

3. %USERPROFILE% = C:\Documents and Settings\MySelf

Home directory is set to U:\MySelf

1. $SHELL = c:\vendors\hamilton\v2.2.116\bin\csh.exe

2. %ComSpec% = C:\WINDOWS\system32\cmd.exe

Command shell is set to c:\vendors\hamilton\v2.2.116\bin\csh.exe.

NOTE: Xmath's oscmd uses C:\WINDOWS\system32\cmd.exe by default.

 

Note that it also shows the process by which Xmath chooses the home directory and command shell. It uses $HOME and $SHELL, respectively. This means that you can control the interpretation of '~' in a filename by setting $HOME. If you do not set $HOME, Xmath looks at the standard environment variables (or system calls) for the platform.

 

Xmath does not use the command shell setting. It does maintain the setting for you in case you want to code your scripts to use it. Xmath expands '~user' according to different rules. It refers to this expansion as the network home directory for the user.

 

For example, the following command can show the expansion of the current user, '~MySelf'.

 

show user "MySelf"

 

Setting username to MySelf

1. $NETHOME =

2. %HOMESHARE% = \\<host>\Users\MySelf

3. $HOME = U:\MySelf

4. %HOMEDRIVE% = C:, %HOMEPATH% = \Documents and Settings\MySelf

5. %USERPROFILE% = C:\Documents and Settings\MySelf

Home directory is set to \\<host>\Users\MySelf.

1. $SHELL = c:\vendors\hamilton\v2.2.116\bin\csh.exe

2. %ComSpec% = C:\WINDOWS\system32\cmd.exe

Command shell is set to c:\vendors\hamilton\v2.2.116\bin\csh.exe.

NOTE: Xmath's oscmd uses C:\WINDOWS\system32\cmd.exe by default.

 

Note that in this case, it uses $NETHOME as the override. If you set $NETHOME, it will use that for the parent directory for your user home directories. Otherwise, it will consult with the platform specific environment variables. On Windows it may use %HOMESHARE%. If neither the $NETHOME or %HOMESHARE% environment variables are set '~user' defaults to '~' for the currently logged in user.

 

You can use the '~user' path for other users in your network. If you use it on another user, it can only expand the path using the network home directory rules.

 

show user "OtherUser"

 

Setting username to OtherUser

1. $NETHOME =

2. %HOMESHARE% = \\<host>\Users\OtherUser

Home directory is set to \\<host>\Users\OtherUser.

Command shell is set to C:\WINDOWS\system32\cmd.exe.

 

If user "bob" tells you to load a model from his public directory, you might type in something like the following.

 

load "~bob/public/model.xmd"

 

The Xmath get function has been extended to support the user information.

 

shell = get ({user, shell})  # command shell for the current user

 

home = get ({user, homedirectory})  # local home directory for the current user

home = get ({path="~"})             # equivalent

 

home = get ({user="name", homedirectory}) # network home directory for the user

home = get ({path="~name"})               # equivalent

 

 

Startup Script Details

 

Xmath executes various startup.ms scripts when it launches. The startup scripts are located in the following places.

 

(1)     startup.ms files in the directories specified with $XMATH_STARTUP

a.    $XMATH_STARTUP is an environment variable which contains a comma or semi-colon separated list of directories. Each path element in this list may be encoded to use environment variables lending more levels of indirection.

b.    There is no limit as to how many directories can be specified in the $XMATH_STARTUP environment variable.

c.    Xmath may augment your definition of  $XMATH_STARTUP with additional required directories that contain  startup.ms  files.

(2)     ~/xmath/startup.ms

a.    Xmath also looks for a startup under the  xmath  subdirectory under the current logged in user's local home directory. (See the discussion on show user).

(3)     ./startup.ms

a.    Finally, Xmath will execute a startup.ms in the current directory from which Xmath was launched. If MATRIXx was launched from a command shell, the current directory is managed by the command shell.

b.    For Windows users, the current directory can be managed by a Windows shortcut wherein it manages a "Start in" property.

 

To provide visibility into the startup process, Xmath provides the following command.

 

show startup

 

# Processing startups in getenv("XMATH_STARTUP"):

# (XMATH_STARTUP is delimited with commas or semicolons)

     execute file="$SYSBLD\etc\startup.ms";

# Processing startup in directory: "~/xmath"

     execute file="~\xmath\startup.ms";

# Processing startup in directory: "."

     execute file=".\startup.ms";

 

 

Enhancements to oscmd

 

Xmath's oscmd function has been enhanced. For compatibility with previous versions of Xmath, oscmd uses %SystemRoot%\system32\cmd.exe as the command shell for Windows. On UNIX, it uses /bin/csh. You can now specify the shell keyword to have oscmd issue the command to a particular shell.

 

On Windows, you can produce a directory listing with the following commands.

 

oscmd ("dir");   ## using the default shell

 

oscmd ("dir", {shell="c:\windows\system32\cmd.exe /Q /C"});  ## equivalent

 

On UNIX, you would produce the directory listing with the following command.

 

oscmd ("ls");   ## using the default shell

 

oscmd ("ls", {shell="/bin/csh -f -c"});  ## equivalent

 

When filenames have spaces in them and/or when the OS command to be issued has arguments which have quoted strings, you may want to specify an argument vector to oscmd.

 

## Send an ARG Vector to CreateProcess

 

oscmd ([ "cmd.exe", "/Q", "/C", "dir", "*.bat" ]);

 

oscmd ("cmd.exe /Q /C dir *.bat", {shell=""});  ## equivalent

 

In the following we send a command directly to an interpreter which acts as its own command shell, in this case Perl.

 

## Send the print command directly to perl

 

oscmd ("print ""Hello World\n"";", shell="perl -e");

 

## Equivalent to:

 

oscmd ("perl -e 'print ""Hello World\n"";'", {shell=""});

 

oscmd ([ "perl", "-e", "print ""Hello World\n"";" ]);

 

We could have also invoked the Perl interpreter via a command shell as the following illustrates.

 

## Send the perl print command through the C-Shell

 

oscmd ("perl -e 'print ""Hello World\n"";'", {shell="csh -f -X -C"});

 

If you have UNIX shells available (even on the Windows platform), you may develop more sophisticated commands as in the following.

 

## Other commands sent to Hamilton C-Shell

 

oscmd ("ls -t | head -20", {shell="csh -f -X -C"});

 

oscmd (shell="csh -f -X -C", ...

      "ls -lF | awk '{print $6 ""\t"" $7 ""\t"" $8 ""\t"" $9}'");

 

Xmath's oscmd function also supports a tee keyword which redirects standard output and error to a named file.

 

oscmd ("myprog arg1 arg2", {tee="myfile.txt"});

 

You can redirect output to a file as well as capture the output into an Xmath string variable.

 

[myvar] === oscmd ("myprog arg1 arg2", {tee="myfile.txt"});

 

 

Executing Perl Commands from Xmath command line

 

Due to the popularity of Perl, Xmath now supports a perlcmd function. This function constructs a command and uses oscmd.

 

Here are some variations.

 

perlcmd ("print ""Hello World\n"";");

 

perlcmd (file="myscript.pl");

 

By default  perlcmd  uses the Perl interpreter located at the path: $MATRIXX/perl/perl.

 

You can specify perlcmd to use your own version of Perl. For example, the following command is directed to use the perl executable in your $PATH environment variable.

 

perlcmd ("print ""Hello World\n"";", {perl="perl"});

 

The  perl keyword specifies the path to the Perl executable. In this case we leave it up to the OS to find Perl simply by specifying "perl".

 

To display the path to the Perl executable, type one of the following.

 

perlcmd ({which});               ## for $MATRIXX/perl/perl

perlcmd ({which, perl="perl"});  ## for Perl in $PATH

 

To display the Perl version, type one of the following.

 

perlcmd ({version});               ## for $MATRIXX/perl/perl

perlcmd ({version, perl="perl"});  ## for Perl in $PATH

 

Since perlcmd uses oscmd for its implementation, it also supports the tee keyword to redirect standard output and error to a named file.

 

 

Access to Environment Variables

 

The MATRIXx product uses environment variables to influence various operations. For example, the expansion of '~' may use $HOME and the expansion of '~user' may use $NETHOME. Also, Xmath executes startup.ms files in directories listed in the $XMATH_STARTUP variable.

 

To support the use of environment variables, Xmath supports the following commands and functions. Examples are shown.

 

showenviron   ## Prints out the list of environment variable settings

 

showenviron "XMATH"  ## prints out the setting for $XMATH

 

setenviron "MYVAR", "myvalue"   ## set $MYVAR=myvalue

 

unsetenviron "MYVAR" ## clears the setting of $MYVAR

 

x = getenviron ("MYVAR")  ## Sets Xmath variable, x, to $MYVAR

 

x = getenviron()   ## returns all environment variables in an MSO variable.

 

 

Accessing the content of a Partition or MSO

 

The list of variable names in a partition or MathScript Object (MSO), can be retrieved with the get command.

 

names = get ({variables, partition="main"});

 

names = get ({variables, mso=mymso});

 

By default, get ({variables}) returns a list of names. To return the same information as a string array, type one of the following.

 

names = get ({variables, partition="main", string});

 

names = get ({variables, mso=mymso, string});

 

Issues

 

 

Known Bugs

 

 

Q & A