Using SimDriveLine with RT-LAB

Question :

How do I use 'SimDriveLine' with RT-Lab ?

Answer

First, go into C:\Program Files\MATLAB\R2008a\toolbox\physmod\drive\c, and transfer all the header (.h files) on your target (with the usual ftp procedure). Open a telnet session and do the following sequence :

 

# mkdir /home/ntuser/driveline
# cp /home/ntuser/*.h /home/ntuser/driveline
# cd /home/ntuser
# rm -rf *.h

Second, transfer the library file <lib_simdriveline.a> zipped in <driveline.tar> to your target by ftp, and then copy the library file into the a newly created 
folder /usr/matlab/v7.6/simdriveline using the following command: 

 

 

 

# mkdir /usr/matlab/v7.6/simdriveline
# cp /home/ntuser/lib_simdriveline.a /usr/matlab/v7.6/simdriveline

Third, define the <User external library> and <user include path> in RT-LAB Maincontrol/Configuration/Advanced/Compilation Options(Change Global Setting)
as shown in the attached screen-shot.

Fourth, define a variable <opal_internal_separate_nobreaklinks=1> in the MATLAB workspace, which modifies the RT-LAB separator process for s
upporting SimDriveLine Library. Normally, this command line should be included in the initialization file.

Fifth, But the "SimDriveLine" toolbox also creates some files (c and h) with the prefix "drive" : drive_mymodel.c, drive_mymodel.h. So you also have to transfer these files.
Attached is a model with the mainctrl file. 

 

TestSimDriveLine.rar - An example to test SimDriveLine with the RT-LAB mainctrl file
driveline.tar - Simdriveline real-time library
driveline.JPG - Model Configuration