This example has been made with: RT-LAB 7.2.4 QNX 6.2.1
Transcription
This example has been made with: RT-LAB 7.2.4 QNX 6.2.1
How to interact with a Simulink RTW auto-generated S-function and RT-LAB This example has been made with: RT-LAB 7.2.4 QNX 6.2.1 Matlab 7.0.4 1.Simple example with RT-Demo1 part 1 1.Simple example with RT-Demo1 part 1 A. Open RT-Demo1.mdl a demo provided by RT-LAB B. Select all the blocks related to the PID controller, right click with your mouse and select the option “create subsystem” C. Name the subsystem just created with all LOWER CASE characters this is essential since QNX is case sensitive D. Right-click on the mask and select Real-time workshop-ÆGenerate Sfunction E. Once you do this a Simulink window is opening with your s-function block, replace the subsystem pid by this S-function F. Your S-function is then generated; open the model with RT-LAB Main control. G. Press open model, select your model and press: CTRL + SHIFT + mouse right click on the EDIT button of the Maincontrol H. The model directory will pop-up H. You could paste in this directory filter.sh the file included with this .zip file. I. Open the directory pid_sfcn_rtw and delete the files: rt_nonfinite.c and rt_nonfinite.h J.RT-LAB is ready to be configured open configurationÆadvanced-ÆFiles and Command. Open Change Global settings and press ADD J. Keep the ASCII option and select all the c files and h files in this directory K. Press Add again and change to binary option and select the file filter.sh located in the model directory L. Go then in Compilation options in Compilation command add the line /bin/sh ./filter.sh If you have more than one c files in the directory of the auto-generated Sfunction, you need to add the c files in User sources files of this window. You are then ready to compile.