Simplified C-Block Questions from the help description:
(1) "formulas are evaluated before simulation starts" & "... interpret and execute the C code at runtime" along with "If no ZOH ... C block is called at every small time step." appear to be conflicting.
(a) How are formulas evaluated before a simulation starts if C code is executed at each time step?
(b) is the entire block of C code run at each time step? e.g. if variables are defined and library links set up, are these redone at each time step? Additionally & for example, if a variable is set to zero in the C code definition, is this variable set to zero at each time step?
(2) When a ZOH is used at a C block input, is the C code only executed at ZOH steps while the code runs at t and delt steps? Or does the simulation operate only at the ZOH steps?
(3) Can the output of a C block be tied directly to the input of that same C block?
Thank you
Professor Greg Mowry
gsmowry@stthomas.edu