Design PLC ladder logic program for Analog Input Sampling at the rate of 2Hz frequency and PLC outputs the average…