How to write Driver Blocks for Arduino on the new 2012b Version?

조회 수: 2 (최근 30일)
phil
phil 2013년 3월 11일
Following the guide "Writing a Simulink Device Driver block: a step by step guide" by Campa I have not been able to successfully write my own driver blocks.
Following this manual to the letter and it appears that at the final step when uploading to the board with "Run On Target Hardware" there are compiler issues....which warn about "redefining" certain functions which causes an abort.
I have installed the target support with targetinstaller and I am able to run the standard in/out/servo blocks with no issue. Also my s functions compile with no problems!
opening a model from the examples gives the following... however s functions will still compile fine. Warning: File I/O error on file 'arduino.tlc' Operation that caused an error: find In general\private\openmdl at 13 In open at 159 In uiopen at 196
I can only reason that there is a new method implemented on the R2012b version and I can not find any documentation for it. :( I am using the "realtime.tlc" in the Target selection but some documents mention "arduino tlc"....
Really stuck here any help would be appreciated :)
  댓글 수: 2
Ryan G
Ryan G 2013년 3월 13일
Have you tried using the standard arduino blocks first and running on target hardware? You can do a quick setup to make the 13 pin blink and the LED on the hardware should blink. You can do this without changing your hardware setup on the arduino.
phil
phil 2013년 3월 16일
Hi Ryan,
Thank you for your answer. I can run any of the standard blocks with no problem...! serial read/write digital pins, pwm's etc... there is no issue.
The issue really just arises when trying to create my own driver block from the manual!... :(
The author is also running 2012b so I am a little confused as to why this is happening...
Maybe the author is not using the rtw.tlc but rather the arduino.tlc in code generation... im stuck :(
Is it also possible that when you create your own driver blocks you can NOT use the arduino blocks from the library?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Arduino Hardware에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by