How to save & empty the contents of `SimulationData` at regular intervals?

Thank you @xchoo for looking into it. I tried the sim.model.params[<probe_obj>] method (and the similar one mentioned in the link you provided) but wasn’t successful. This print(loihi_sim.model.params[probe_otp]) throws the following error:

KeyError: <Probe at 0x7f1d54d9d0a0 of 'output' of <Node (unlabeled) at 0x7f1d54d78e80>>

i.e. most likely, the sim.model.params[<probe>] doesn’t work with NengoLoihi.

Next, I tried the collect_probe_output method. Actually I had the 1.1.0.dev0 version of NengoLoihi and it didn’t have the collect_probe_output(), but get_probe_output() and this didn’t work for some reason. Then I installed the released 1.1.0 version of NengoLoihi and tried to make it work. Looks like I need to define the HardwareInterface() simulator as mentioned here. For this I needed a proper Model object which I got from loihi_sim.model after defining loihi_sim = nengo_loihi.Simulator(temp_net) (assuming this is correct). Next, I needed a suitable probe object for the probe_otp (in the code in main post), but I just couldn’t find a mapping. Therefore, I took my chances with the probe_0 = loihi_sim.model.probes[0] and ran the following code:

with HardwareInterface(loihi_sim.model, use_snips=False) as sim:
    for _ in range(5):
        sim.run_steps(10)
        sim_u = sim.collect_probe_output(probe_0)
        print(sim_u.shape)

It works, I get the shape of sim_u = (10, 1) for every iteration of the for loop. But upon plotting the last value of sim_u, the plot is simply a random line, not oscillating around 2.0. I guess… probe_0 is not the correct hardware mapping of the probe_otp, or anything else is wrong. Can you please help me with it?

Note that I did run the above code with use_snips=True, but it just got stuck.