Editing Library Blocks

10 views (last 30 days)
Balazs
Balazs on 31 May 2011
Is it possible to modify the behavior of Simulink Library blocks? The present situation is that I need to use the I2C Rx (and Tx) Library blocks for Texas 28335 processors, and the read data length is varying. The data length can only be set via the dialog box, but I'd like to feed it through an Input port. What should I do?
I've searched for the available sources in the Matlab paths:
  • the block itself
  • the "Edit mask" preferences
  • some callback functions in an .m file
  • a translated file with some behavior of the block (.tlc)
Should I modify the .tlc and .m file, or is it useless? I've tried it with no success...

Answers (1)

Fangjun Jiang
Fangjun Jiang on 31 May 2011
You can always make your own library blocks based on the Simulink library blocks. That is the answer to your question title. However, this approach won't work for your problem. You can mask the parameter. But there is a big difference between the parameter through the parameter dialog and a varying signal through a port. The value of the parameter can't change while the simulation is running. I think you are out of luck if you want to do it through "editing library blocks". You may need to develop your own block using s-function or embedded matlab function.

Community Treasure Hunt

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

Start Hunting!