# PLC Program to Measure Unknown Frequency

«
»

This is a PLC Program to Measure Unknown Frequency.

Problem Description

Measure and display unknown frequency. Implement this in PLC using Ladder Diagram programming language.

Problem Solution
• Define an address to which Unknown frequency is given as an input.
• This address is set to 1 whenever a positive pulse is detected otherwise remain 0.
• And Frequency may be defined as number of cycles per second. This cycle includes three terms, high (positive) pulse, zero and negative pulse.
• Frequency input detects positive pulses.
• Give this input to Up Counter to determine the number of positive pulses per second with unknown frequency.
• Use timer to stop the counter from counting after 1sec.
• Reset counter after measuring of frequency is done.
• However to define a particular Amplitude signals, Limit instruction may be useful.
PLC Program

Here is PLC program to Measure Unknown Frequency, along with program explanation and run time test cases.

```List of Inputs and Outputs
B3:0/0	 = Latching Bit					(Bit)
I:1/0	 = Unknown frequency input			(Input)
I:1/14	 = Start PB					(Input)
I:1/15	 = Stop PB and reset counter			(Input)
T4:1	 = 1sec time delay				(Timer)
C5:0	 = Up counter to increment each positive pulse	(Counter)
TOD	 = Hex to BCD conversion		       (Compute)
T4:0/DN = Stop counting				(Timer)
-(RES)-	 = Reset Counter coil				(Output)```
Program Description
• Latching bit is connected in series with all the rungs except -(RES)- in order to master stop the measuring process.
• Whenever it is required to measure the unknown frequency, I:1/14 Start PB is pressed which activates the Latching rung hence timer is started and counter also allows the positive pulses to increment accumulator value.
• This is stopped by T4:0/DN bit when 1sec is over.
• Stop PB I:1/15 input resets counter and timer both.
• Accumulator value is converted into corresponding BCD number and fed to Display with address O:6.
Runtime Test Cases

When it was tested using timer, Time Base = O.1 and Preset = 0.5 replacing I:1/0 with Timer DN bit.  