Bistable Test

The bistable elements and edge detection are tested in this section. IEC 61131-3 defines two types of bistable elements: set dominant (SR) and reset dominant (RS). Inputs I1 and I2 are connected to an RS bistable and inputs I3 and I4 are connected to an SR bistable. The output of the RS and SR bistable block goes to a rising edge detection and a falling edge detection block respectively. Finally, the rising edge detector is connected to the set input of the bistable RS0 and the falling edge detector is connected to the reset input of the bistable RS1.

Figure 1. Bistable Test

In this program, the output O1 is set if input I1 is active before inputs I2 and I3. The output should remain set until I2 is triggered or I3-I4 is triggered in sequence. Detailed changes in the output point can also be observed in HMI.