Relaysimtest
def test_pickup_delay(): relay = Relay(pickup_time_ms=10) relay.coil_energize() assert relay.get_contact_state("NO") is False # not yet closed relay.step_time(10) # advance simulation time assert relay.get_contact_state("NO") is True
You deploy the code. During a test, a technician opens the lid, but the motor keeps spinning because of a software bug. This is a safety hazard. relaysimtest
The most basic function of relaysimtest is verifying truth tables. You define the inputs (sensors, switches) and the expected outputs (relays, actuators). The simulator runs through every permutation of inputs to ensure the output matches the design specifications. a technician opens the lid
K1.coil_energize() sim.step(5) # K1 picks up K2.coil_energize() sim.step(5) # K2 picks up switches) and the expected outputs (relays