You are on page 1of 11

# Solutions for

PLC Test 3
NFI
This document is created for NFIer’s to review the answers
for PLC Test 3.

Note:

NFI – Industrial Automation & (present in the directory) where you can find the Schematic
in this document. You can run & simulate that schematic
SCO 23, Sector 18-D,
diagram in respective software for better understanding.
Chandigarh

0172-5078767

www.nfiautomation.org

NFI – Industrial Automation & CAD Training Academy | Chandigarh | Panchkula|

## PLC TEST 3 WITH SOLUTIONS

1) Write a program when xo is pressed, k1001 is stored in D5, when x1 is pressed k-345 is stored in
D7, When x1 is not pressed k99 is stored in D7. When x2 is pressed D5 and D7 are added and
result is stored in D10?

## Code for Calculation

2) You need to read an analog voltage that has and range of -10v to +10v to a precision of +_ 0.05
volt. What resolution of A/D is needed

## Voltage Range : -10 V ~ +10 V

Precision required: + 0.05 Volt

## Resolution: Minimum 9 Bit A/D is required

Calculations:
Resolution of 10 Bit: (20 Volt) / 1024 = 19.53 mV
Resolution of 9 Bit: (20 Volt) / 512 = 39.06 mV (Comes with in the range)
Resolution of 8 Bit: (20 Volt) / 256 = 78.125 mV

3) We are given a 12 bit analog I/P with a range of -10v to +10v. If we put in 2.735 V. What will be
integer value after conversion? what is the error? What voltage can be calculated?

## Total Range : (-10V ~ +10 V) = 20 Volts

Resolution: 12 Bit

## | www.nfiautomation.org | www.nfiinnovation.org | Page 1

NFI – Industrial Automation & CAD Training Academy | Chandigarh | Panchkula|

## Input Voltage: 2.735 V

Calculations:
12 Bits = 4000 digital bits (2^12)
1 V = 200 Bits
2.735 V = 200 x @.735 = 547 Bits

Error Calculation: (Total Range)/ (Total Digital Bits) = 5 mV. It means the processor can measure &
convert minimum of 5 mV. Below this range, it cannot convert. For that we need to install higher
bit resolution processor.
Minimum voltage to be calculated is 5 mV

4) We need D/A convertor for an application. The O/p should vary from +5v to +10vdc only by
potentiometer at the A/D channel. Write the code.

## | www.nfiautomation.org | www.nfiinnovation.org | Page 2

NFI – Industrial Automation & CAD Training Academy | Chandigarh | Panchkula|

5) Write the program that will I/p an analog voltage. Do the Calculations below and O/P analog
voltage.
{Vout= 5 (vin) – 3/2 (Vin)}

## | www.nfiautomation.org | www.nfiinnovation.org | Page 3

NFI – Industrial Automation & CAD Training Academy | Chandigarh | Panchkula|

6) An m/c is connected to load cell that O/P voltage proportional to the mass on a platform.
1) When unloaded the cell output a voltage of 1volt.
2) Mass of 500 kg results in 6v.
 Write a program that will measure the mass and indicate it in the code in kg.
 If the mass is not b/w 300 kg and 400 kg and alarm ok will be turned on

## | www.nfiautomation.org | www.nfiinnovation.org | Page 4

NFI – Industrial Automation & CAD Training Academy | Chandigarh | Panchkula|

## | www.nfiautomation.org | www.nfiinnovation.org | Page 5

NFI – Industrial Automation & CAD Training Academy | Chandigarh | Panchkula|

7) How will you control the speed of DC motor using PLC? Write The code for PWM

## | www.nfiautomation.org | www.nfiinnovation.org | Page 6

NFI – Industrial Automation & CAD Training Academy | Chandigarh | Panchkula|

Practical Questions:
8) Write a program using A/D and D/A such that
When
 Avin -1 volt Y0 is ON AVout-2volt
 Avin-2v Y1is ON AVout=4volt
 Avin-4v Y2 is ON AVout=8 volt
 Avin-6v Y3 is ON AVout=3 volt
 Avin-8v Y4 is ON AVout=4volt
 Avin>8v All output are off

Code Attached*

## | www.nfiautomation.org | www.nfiinnovation.org | Page 7

NFI – Industrial Automation & CAD Training Academy | Chandigarh | Panchkula|

9) Make an arrangement for sorting metals and nonmetals objects on a conveyor using PLC.

For sorting of Metal & Non Metal object, we need two sensors:
Inductive Proximity – For metal detection
Capacitive Proximity – For non metal Detection
Assume, Sorting is done by Pneumatic Cylinder actuated by 3/2 single solenoid spring return Valve
Schematic Diagram Code: (Schematic Diagram Attached*)

## | www.nfiautomation.org | www.nfiinnovation.org | Page 8

NFI – Industrial Automation & CAD Training Academy | Chandigarh | Panchkula|

Working:
1) A toggle switch is used to run the conveyor
2) Now when both the sensors are “ON”, it means object is Metallic, so as per the code, the
solenoid will be actuated & metallic object will be displaced by the actuation of c linder as
shown below

## | www.nfiautomation.org | www.nfiinnovation.org | Page 9

NFI – Industrial Automation & CAD Training Academy | Chandigarh | Panchkula|

3) Now, if the object is non-metallic, then as per the code, it will pass away through the conveyor
(the cylinder will not actuate)