I am having trouble running the example Simulink models. When I run the IMU_Serial_Example.slx file, I get a very long list of warnings. One such example is as follows:
Warning: Unable to load block diagram 'RC_Library'
In general\private\openmdl at 13
In general\private\openslx at 9
In open at 159
In uiopen at 196
When I look at the simulink the blocks are not there but replaced with a red box with detached border and in it saying 'Bad Link'.
I have followed the instructions stated in the How To Guide, i.e. Replacing the core/arduino with the one in this repository and inserting #if 0 and #endif in the wrappers. The files are also placed in the Matlab directory (C:\...\Documents\Matlab).
The version I am using is R2012b with APM 2.5. Any help is gladly appreciated.
26 Jun 2014
APM2 Simulink Blockset
Simulink blockset for use with the ArduPilot Mega 2.0 hardware. Includes blocks to read external rad
@Johan S Lovgren
Thank Johan, this worked out quit good. I was able to bring the mex-File to work, it stated all successful. In my Simulink Library Browser a new Library appeared: ArduPilot 2 Target. So far so good.
But the Ardu Pilot 2 Target Library is empty. It states "No Blocks".
I can do a right click on it and do a "Open Ardu Pilot 2 Target Library". This opens a new window in which I do have the blocks. This seems to be the library located in:
Draging them into a Model though, they do not become usable blocks. Double clicking on the blocks within the Model these blocks state:
"Error evaluating 'OpenFcn' callback of SubSystem block 'untitled/Discrete IO'.
Undefined function or variable 'Discrete_IO_Library'. "
I tried something else:
I went one folder further down, eg. APM2/blocks/Serial. There is a Serial_Library.slx which I can open giving me three blocks I can actually use. With use I mean connect them and change Parameters. I thought grate, and started assembling them together by opening each of the libraries. But problems rase when I closed the Libraries again. The blocks of the Libraries I closed then started stating: Unresolved Link.
Also: While my workspace is within a folder of a block, everything is fine. But when I change the workspace to another block folder the Diagnostic Viewer states for example:
Error in S-function 'Test1/RC Write': S-Function 'Arduino_RCWrite_sfcn' does not exist
So I guess it all comes down to a not properly installed APM Library.
Can anybody help me with that?
Thank you very much