Event Generator/Detector Initialization and Warm-up time

Question: My electric-drive model worked perfect with real-time software-synchronized simulation. However, when I connect my controller model with the electric-drive model through IO loopback (analog and digital), the simulation gave unexpected result. I verified that all IO channels used were functional, and that my controller is ok with two or three time-steps deley caused by IO loopback. What else should consider, when I go to a Hardware-in-loop test from a validated real-time simulation without Hardware?

Answer: In order to synchronize the time-stamped digital IOs with the model, it is scheduled that  the event generator (time-stamped digital output) and the event detector (time-stamped digital input) will really work at the first TEN time-steps, after the model is executed. If your controller absolutely relies on a correct response from the plant/drive and start firing, you have to mannually make such initialization that your plant can send the response without having the first group of pulses. Remember the event-generators and detectors start to work later than the rest part of the model.