For users to link their own libraries to their UserCodeBlock dlls, they will need to create a "Named Library UCB" block in their model.
What we mean by named library is that the "Library Name" parameter in the UserCodeBlock dialog must be non-blank (ie. mylib).
Blank Library Name UCBs are always linked into simucb.dll (default) whereas named library UCBs are linked into libraryname.dll (ie. mylib.dll)
To specify a user libraries to link with for a named library UCB, enter the following Xmath code before running the SystemBuild simulation.
> mylib = simlib() # Create the simlib MSO mylib
> mylib.library = ["c:/workucb/lib1.lib","c:/workucb/lib2.lib"] # Specify your libraries to link to
> _simlibs.mylib = mylib; # Copy mylib MSO to the _simlibs partition (sim looks for simlib MSOs in this partition)
> showsimlib mylib # Show the contents of the mylib MSO to verify its contents (optional)
> y = sim("mymodel",t,u); # sim will link mylib.dll with lib1.lib and lib2.lib before running sim
See the Building, Linking and Debugging UCBs section in Chapter 14 pg 14-34 of the MATRIXx 8.0 SystemBuild User Guide for more details.
Bob Wilson
MATRIXx R&D