RobotStudio event

Help to simulate step-by-step using simulator class

Good morning all, I'm trying to simulate a RAPID program (simple path with two targets) using the Simulator methods Start/Step/Stop. While the Start method works nicely by starting the simulation of the whole program, Id' like to perform a step by step simulation in order to perform some additional computation during a trajectory execution (i.e. collision check). I tried the Simulator.Step method; but once called it throws an Invalid Operation Exception with the additional info on the 'Invalid Simulator State'. This means, I think, I miss some previous initialization of the simulator state machine or, at least, I have to tell the Simulator I'm going to use it in a step-by-step fashion through some property. Do someone could help me understanding which are the steps to successfully run a step-by-step simulation?