MATLAB: Do I receive an error when I try to run the Link for ModelSim 1.0 (R13SP1+) demo MODSIMRAND

dosEDA Simulator Link MQerrorfailedhdldaemonlaunchMATLABmodelsimnotpathrunningvsimdir

I am trying to run the ModelSim demo MODSIMRAND using the following code in MATLAB
vsim('vsimdir', 'C:\FPGAdv62PS\Modeltech\win32');
modsimrand
but I keep getting the following error
To enable access from ModelSim, HDLDaemon is used with appropriate link settings.
The following messages are produced by HDLDaemon to indicate link status ...
HDLDaemon is NOT running
HDLDaemon shared memory server is running with 0 connections
Failed to launch Modelsim!
If Modelsim is not on the system path,
please use parameter 'vsimdir' to specify its location
??? Error using ==> vsim
'modelsim' is not recognized as an internal or external command,
operable program or batch file.

Best Answer

This happens when the Link for ModelSim 1.0 (R13SP1+) program is not on the Windows path. When using the VSIM command directly, you can specify the directory to run ModelSim from.
However the MODSIMRAND function does not have this option and the 'vsimdir' parameter is not used in later calls.
Add the directory that the ModelSim program is in to the Windows path. Note: Adding this directory to the MATLAB path will not fix the problem.