Code of Puls Generator

Is rtw able to create c-code of a Puls generator? I used it in my model to activate an event, which is used in a transition between two stateflow charts. Is this possible? Rtw doesn't create errors, but the programm doesn't work, the two charts should switch on/off a LED to simulate a blinker but they just glow.

1 个评论

maybe your pulse generator is switching the LED too fast. Try a slower interval to see if it dims or blinks

请先登录,再进行评论。

回答(1 个)

Fangjun Jiang
Fangjun Jiang 2011-9-11

0 个投票

Go to Simulink library->Model-Wide Utilities, double click 'Block Support Table', search for 'Pulse Generator' block in the documentation, see if there is any notes regarding code generation support for this block. In R2007b, there are two notes that you might need to look into.
In what hardware are you running the generated C code? In my past experience, I avoided all time-related blocks because I don't know how it is going to access the real-time clock in my hardware module.

类别

在 帮助中心 和 File Exchange 中查找有关 Code Generation 的更多信息

标签

提问:

2011-9-11

Community Treasure Hunt

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

Start Hunting!

Translated by