%<BaseSampleTime> variable not available in simulink model-tlc file?
Mostra commenti meno recenti
I am trying to create a simulink block that should depend on the base-sample-rate of the model. I tried to put the following in the model-block-tlc file:
%if %<BaseSampleTime> > 0.003
adc1_sum = 0;
for (int i=0; i<8; i++ ) {
adc1_sum += Get_ADC_Value(11);
}
%else
adc1_sum= Get_ADC_Value(11)*8;
%endif
But I get: Undefined identifier BaseSampleTime
Is there a way to determine this value in the models tlc-file? (apart from creating a variable when this value is in scope?)
Thanks in advance, Sietse
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Target Language Compiler in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!