Professional Documents
Culture Documents
3. MEMORY/DUMMY 7
ADDRESS
4. COUNTER(16-bit) 7
5. COMPARISON 7
6. COMPARATOR 10
7. EXERCISE 5
Operand: S : T
Syntax:
TMR<SPACE>TIMER ADDRESS<SPACE>DELAY TIME(SECONDS)
1 - 7. TIMER Pg no: 1 2 3 4 56
After 50 sec (time you mentioned) delay , the output (Y0) turns ON
Based on the process you can use timers as OFF delay or PULSE timer
1 - 7. TIMER Pg no: 1 2 3 4 5 6
DATA REGISTER
Functionality: Data Registers are storage registers in which we can
store data and use that data anywhere in your logic or program.
Instead of giving direct value in program, we can give the value
through data registers
Data Types:
– Word (16-bit) (only positive values i.e. 0 to 65535)
– Double Word (32-bit) (only positive values i.e. 0 to 2^31)
– Integer (16-bit) (-32767 to 32767)
– Double Integer (32-bit) (-2^31 to 2^31)
– Real/Float number (32-bit) (decimal values)
If there is counting pulse input after counting is attained, the contacts and
the counting values will be un unchanged. To re-count or to conduct the
CLEAR motion, please use the RST instruction
4 - 7. COUNTER(16-bit) Pg no: 1 2 3 4 5 67
If Counter gets 5 signals(False to True), it will activate the Counter call function C0. The Output
Y0 is ON
4 - 7. COUNTER(16-bit) Pg no: 1 2 3 4 5 6 7
COMPARISON
Instruction:
Input Comparison Instructions
– = (Equal)
– <> (Not equal)
– < (Less than)
– <= (Less than or equal)
– > (Greater than)
– >= (Greater than or equal)
Function: Input comparison instructions compare two values (constants
and/or the contents of specified words) and create an ON execution
condition when the comparison condition is true.
Syntax: LD<SYMBOL><SPACE>S1<SPACE>S2
Operands: S : S1, S2
S1: K, H, KnX, KnY, KnM, KnS, T, C, D, E, F
S2: K, H, KnX, KnY, KnM, KnS, T, C, D, E, F
5 - 7. COMPARISON Pg no: 1 2 3 4 5 67
Input X1 is ON, D2 and D3 values are not equal output is ON
5 - 7. COMPARISON Pg no: 1 2 3 4 5 6 7
COMPARATOR
Syntax: CMP<SPACE>S1<SPACE>S2<SPACE>D
the two values are binary values. When b15=1 in 16-bit instruction or b31=1
in 32-bit instruction, the comparison will regard the value as a negative binary
value.
D:Comparison result
Operand:
– S1: K, H, KnX, KnY, KnM, KnS, T, C, D, E, F
– S2: K , H, KnX, KnY, KnM, KnS, T, C, D, E, F
– D: Y, M, S
6 - 7. COMPARATOR Pg no: 1 2 3 4 5 6 7 8 9 10
Create one input then type CMP<SPACE>D0<SPACE>D1<SPACE>M0
Click OK
6 - 7. COMPARATOR Pg no: 1 2 3 4 5 6 7 8 9 10
Create a program like below one then download the program into PLC and execute it.
M0 ---> Greater than output, M1---> Equal output, M2---> Less than output
6 - 7. COMPARATOR Pg no: 1 2 3 4 5 6 7 8 9 10
Compile and download into the PLC.
6 - 7. COMPARATOR Pg no: 1 2 3 4 5 6 7 8 9 10
Input X0 is ON
The data register D0, D1 values are equal.
M1 is ON
6 - 7. COMPARATOR Pg no: 1 2 3 4 5 6 7 8 9 10
If you want the change the data register value select compare instructions and right click.
Click the Change Present Value
6 - 7. COMPARATOR Pg no: 1 2 3 4 5 6 7 8 9 10
The window is open and select the device name D0
Change the value in K10 and click OK
6 - 7. COMPARATOR Pg no: 1 2 3 4 5 6 7 8 9 10
Now M0 is ON because of D0 greater than D1
6 - 7. COMPARATOR Pg no: 1 2 3 4 5 6 7 8 9 10
Same procedure repeat and change the D1 value.
6 - 7. COMPARATOR Pg no: 1 2 3 4 5 6 7 8 9 10
Now M2 is ON because D0 lesser than D1
6 - 7. COMPARATOR Pg no: 1 2 3 4 5 6 7 8 9 10
EXERCISE
EXERCISE - 4
MOTOR
START STOP
POSITION PB PB
SENSOR
DRILLER
DRILL DOWN
POSITION SENSOR
JOB
SENSOR
When the job sensor detects the object and the position sensor is ON, the
drill forward will turn ‘ON’ until the drill down position sensor gets ‘ON’.
Then the motor should rotate in opposite direction and drill backward until the
When the stop push button is pressed, the motor should gets ‘OFF’
FROM PUMP
SUMP
START STOP
PB PB
HLS
VALVE
LLS
TO
HOUSEHOLD
USAGE
7 - 7. EXERCISE Pg no: 1 2 34
When the start push button is pressed, the process is ready to start.
When LLS is ‘ON’, the pump should be in ‘ON’ state until HLS gets ‘ON’
Once HLS gets ‘ON’, the pump turns ‘OFF’ and the valve should turn ‘ON’
When the valve is in ‘ON’ state, the water starts draining from the tank and this leads
HLS to turn ‘OFF’. Once HLS turns ‘OFF’ the pump should not turn ‘ON’ until the LLS
turns ‘OFF’
Once LLS turns ‘OFF’ after the draining of water, the pump should turn ‘ON’ and the
valve should turn ‘OFF’. Therefore the process should repeat in a cyclic manner until the
7 - 7. EXERCISE Pg no: 1 2 3 4