Knowledge on sampling the internal Simulink subsystem

I have an external Simulink subsystem A with a 1.0 sample time containing an internal B subsystem with a 10.0 sample time. Everything works as expected; however, I need an outport for subsystem A, which indicates if subsystem B was selected in this step, i.e. gives 1 every tenth step (1.0 / 10.0), otherwise 0 (I don't want to hardcode this with a counter, but get this information correctly). It is of course acceptable that subsystem B sends this information via outport to the containing subsystem A.

+3


source to share


1 answer


One way to do this would be as shown below. I hope the pictures are self-explanatory. The model shown is subsystem A with a 1s sampling time and the atomic subsystem is a subsystem B with a 10s sampling time. (Please open the image in another tab to see the full size model)

Model



which leads to the next signal, which I believe is what you are after.

Plot

+2


source







All Articles