# Ladder Logic for PLC Program

Having trouble understanding this ladder logic program. I can solve more basic ladder logic programs but I do not know how to account for small voltage adjustments. Here is the problem:

You are designing a PLC program which controls a cooling van on a vehicle engine. The engine must stay at 205 degrees F. The PLC should have 2 outputs for fan control: an output which turns the fan on and off, and a second output which is a voltage value which corresponds to the speed of the fan. The fan speed voltage should be between 0 and 5 volts, where 0 V indicates a slow fan for 1 degree above temperature (206 degrees) and 5 V indicates maximum fan speed for 10 degrees above temperature (215 degrees). The input to the PLC is a thermopile which is 0 V at 150 degrees F, and increases by 25 mV for every degree F above that. The system should also have a third output which is an overheat light which flashes if the engine temperature ever reaches 15 degrees above the temperature setpoint (220F).

• Welcome to EE.SE you may want to review the guidelines on asking questions and edit your question, because you have not actually asked a question, you have only stated a problem. electronics.stackexchange.com/help/how-to-ask May 11, 2016 at 17:15
• Also state the PLC make and model (and provide a link) so that we know what features are available. Post all this information in your original question and not in the comments. May 11, 2016 at 17:45

Without knowing what PLC you are using, I'll give you an example with a CLICK PLC. The CLICK PLC makes this trivial as it has built in I/O on the processor and I'm using model C0-02DR-D \$139 which has

• (4) 24VDC inputs
• (4) Relay outputs
• (2) Analog outputs (configurable as 4-20mA or 0-5V)

The first thing is to scale the input. Some PLCs such as Allen Bradley's have instructions for doing this, but the CLICK makes this easier using a graphical editor. Here it is;

The temp input signal is connected to input AD1 (analog to digital). We select 0-5V option. For scaling we set 0V = 150deg F and 5V = 350deg F (since 25mV = 1 degree).

5V = 5000mV
5000mV/25mV = 200
150 + 200 = 350


The scaled input is saved in memory register DF1 which is a 32 bit floating value address.

Now we scale the output;

The output fan speed output is connected to output DA1 (digital to analog). Again, we select 0-5V option. 206deg F = 0V and 215deg F = 5V. For this output, we assign memory register DF3, a 32 bit floating value address. Notice on both Input and Output scaling, we selected the option Enable Range Limiter which tells the CLICK to ignore values outside of the limits.