Definitelly I do not understand something.
In script mode Impedance.run() command blocked execution, so it's impossible to do anything till it stops.
In Custom script mode StaticIO object does not recognized:
Generally, all I want to do is:
While Impedance measurements running at every step get DUT Ch2+ voltage in the form of Vrms, Vreal, VImag or something acceptible. If it is < some preset switch to lower Rref(by activating corresponding DIO) and vice versa.
Or if events Resistor too small/high are available make the same actions based on them.