filmov
tv
2 Simulink s-function builder Call Library files such as .cpp & .h from outside the project folder

Показать описание
*** Part 1 (Previous Video) *** PART 1 CONTAINS SOURCE FILES
======================================================================
*** Part 2 (This video) ***
Table of Contents
*** Objective ***
*** Summary ***
*** MY DEMO FOLDER *** Note: you will have to update this file by following the steps in the video
*** Solution ***
*** Additional Resources ***
*** Additional Information ***
======================================================================
[*** Objective ***]
Call Library files such as .cpp & .h from outside the project folder.
======================================================================
[*** Summary ***]
To call Libraries from outside the project folder open the Libraries panel of S-Function Builder and add the root path found in the Arduino Library. When adding the desired Arduino library path select "INC_PATH" as the tag name. In this video I added the Arduino path for path for both OneWire & DallasTemperature.
======================================================================
[*** MY DEMO FOLDER ***] Note: you will have to update this file by following the steps in the video
======================================================================
[*** Solution ***]
*** While In Simulink ***
Step 1) Stop simulation
Step 2) Delete all Library files located in the project folder
Step 3) Open the S-Function Builder Block by double clicking on the block
Step 4) Click on the 'Libraries' Panel
Step 5) Right click next to the column header name 'tag' & select 'Add PATH'
*** Tag *** *** VALUE ***
INC_PATH "C:\Users\user-name\Documents\Arduino\libraries\OneWire"
INC_PATH "C:\Users\user-name\Documents\Arduino\libraries\DallasTemperature"
Step 6) Build new wrapper file (DS18B20_wrapper.c)
Step 7) Close and save S-function Builder Block.
*** While In MATLAB Project Window ***
Step 9) Update code in new wrapper file (DS18B20_wrapper.c)
Open file "DS18B20_wrapper.c" and write [extern "C"] everywhere the word Void appears.
*** While In Simulink ***
Step 11) Run simulation by pressing "Monitor & Tune"
======================================================================
[*** Additional Resources ***]
*** Build S-Functions Automatically Using S-Function Builder ***
*** Developing Simulink Device Driver Blocks: Step-By-Step Guide and Examples ***
======================================================================
[*** Additional Information ***]
*** Tag Purpose ***
INC_PATH == Specify the include search paths for header files and source files.
======================================================================
*** Part 2 (This video) ***
Table of Contents
*** Objective ***
*** Summary ***
*** MY DEMO FOLDER *** Note: you will have to update this file by following the steps in the video
*** Solution ***
*** Additional Resources ***
*** Additional Information ***
======================================================================
[*** Objective ***]
Call Library files such as .cpp & .h from outside the project folder.
======================================================================
[*** Summary ***]
To call Libraries from outside the project folder open the Libraries panel of S-Function Builder and add the root path found in the Arduino Library. When adding the desired Arduino library path select "INC_PATH" as the tag name. In this video I added the Arduino path for path for both OneWire & DallasTemperature.
======================================================================
[*** MY DEMO FOLDER ***] Note: you will have to update this file by following the steps in the video
======================================================================
[*** Solution ***]
*** While In Simulink ***
Step 1) Stop simulation
Step 2) Delete all Library files located in the project folder
Step 3) Open the S-Function Builder Block by double clicking on the block
Step 4) Click on the 'Libraries' Panel
Step 5) Right click next to the column header name 'tag' & select 'Add PATH'
*** Tag *** *** VALUE ***
INC_PATH "C:\Users\user-name\Documents\Arduino\libraries\OneWire"
INC_PATH "C:\Users\user-name\Documents\Arduino\libraries\DallasTemperature"
Step 6) Build new wrapper file (DS18B20_wrapper.c)
Step 7) Close and save S-function Builder Block.
*** While In MATLAB Project Window ***
Step 9) Update code in new wrapper file (DS18B20_wrapper.c)
Open file "DS18B20_wrapper.c" and write [extern "C"] everywhere the word Void appears.
*** While In Simulink ***
Step 11) Run simulation by pressing "Monitor & Tune"
======================================================================
[*** Additional Resources ***]
*** Build S-Functions Automatically Using S-Function Builder ***
*** Developing Simulink Device Driver Blocks: Step-By-Step Guide and Examples ***
======================================================================
[*** Additional Information ***]
*** Tag Purpose ***
INC_PATH == Specify the include search paths for header files and source files.
Комментарии