Sunteți pe pagina 1din 5

Mechanical Simulation

755 Phoenix Drive, Ann Arbor MI, 48108, USA Phone: 734 668-2930 Fax: 734 668-2877 Email: info@carsim.com

Technical Memo
carsim.com

How to Switch Between Different Instances of MATLAB/Simulink for CarSim/TruckSim/BikeSim


This document explains how to use the regserver command to switch between different instances of MATLAB/Simulink for use with CarSim, TruckSim, and BikeSim. Note This document was written using CarSim 8.03a with MATLAB R2009b and R2010a as examples. Please substitute your MATLAB versions and target paths as necessary.

1. Create a new desktop shortcut for MATLAB R2010a from the MATLAB.exe file and call it MATLAB R2010a reg. Do not use previous MATLAB shortcuts. See Figures 1 and 2

Figure 1: Create the new MATLAB shortcut from the MATLAB.exe file

Figure 2: MATLAB desktop icons 2. Right click on the new shortcut and click on Properties at the bottom of the list. 3. On the Shortcut tab in the Target path, type: "C:\Program Files\MATLAB\R2010a\bin\matlab.exe" /regserver

June 2011

1/5

Notes Include the quotes if you have a space in the path name (i.e., Program Files) There is a space after the exe Click OK when you are done. See Figure 3.

Figure 3: MATLAB R2010a reg Properties 4. Repeat the above process to create a new desktop shortcut for each of your MATLAB installations. Refer to Figures 1 3. 5. Launch CarSim, TruckSim, or BikeSim. 6. Use the Datasets menu and select a Simulink example. 7. On the Run Control screen click Send to Simulink. 8. Click the Run arrow in Simulink to make sure the model runs.

2/5

9. In the MATLAB Command Window type ver (without the quotes) to see what MATLAB version is running. It should be the most recent version of MATLAB that was installed on your computer. See Figure 4.

Figure 4: MATLAB Command Window with MATLAB R2010 for a Carsim Simulink dataset 10. Close that instance of MATLAB/Simulink either by typing exit (without the quotes) in the Command Window or click the X in the upper right corner of the MATLAB Command Window. a. When asked if you want to save the Simulink model, select No. See Figure 5.

Figure 5: Message prompting you to Save or not to Save the Simulink model 11. On your computers desktop, double click on the second MATLAB instance you wish to run (i.e., Matlab R2009b reg). In preparation for this example, R2010a was the more recent installation so R2010a opened first. This step switched to R2009b. Note If you get a message saying you need Administrator Privileges, close any instance of MATLAB that starts to open, right click on the new shortcut (i.e., Matlab R2009b reg) and select Run as administrator. Depending on your User Account Control settings, you may be asked if you want to continue. Select Yes. See Figure 6.

3/5

Figure 6: User Account Control setting 12. A MATLAB Command Window will open. As before, type ver (without the quotes) to see what MATLAB version is running. This should be the other instance of MATLAB. See Figure 7. 13. When you are done, close MATLAB.

Figure 7: MATLAB Command Window for R2009b 14. Return to CarSim, TruckSim, or BikeSim and click Send to Simulink. This will launch a new MATLAB Command Window with the associated Simulink model. 15. Click the Run button in Simulink to make sure the model runs.

4/5

16. Check the Command Window to make sure the correct version of MATLAB has launched. See Figure 8.

Figure 8: MATLAB Command Window for CarSim Dataset Active Susp. Bounce Sine Sweep: D-Class, Sedan 17. Perform your simulations. When you are done, close MATLAB/Simulink. 18. Repeat this procedure either to switch back to the initial MATLAB version, or to select a third, fourth, etc. instance of MATLAB.

If you have any questions, please contact us at tech@carsim.com.

5/5

S-ar putea să vă placă și