M_SW is the effective function for the input connected to the MECHANICAL SW or OPTICAL SENSORS.Some times those inputs cause a-stable input value and those signals let the machinery works wrong.M_SW function wait the same values 1msec interval defined by t times.M_SW(t,IOn)When t is ignored, M_SW retry to read 3 times in 1msec interval.M_SW(IOn)IOn means the IO-number of the real IO ports on a PCB.