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 Comment

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

Sign in to comment.

Answers (1)

Fangjun Jiang
Fangjun Jiang on 11 Sep 2011

0 votes

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.

Categories

Find more on Code Generation in Help Center and File Exchange

Tags

Asked:

on 11 Sep 2011

Community Treasure Hunt

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

Start Hunting!