Example 3:

Put a value in memory location vw200, and using shifting method, move this value to the output of the PLC.

Solution:

when we press the PLC input button (I0.0), the PLC will put the value (980) inside memory location vw200, and when the rising edge of the pulse arrives, the contents of memory location will be shifted to the left for one bit (the instruction SLW = shift left word). we could put 2 after # to shift two bits to left. If we put 7 after the #, the overflow indicator will be activated (SM1.1=1) which will activate the output in question.

here is the ladder diagram:

 

Example 4:
Using two timers, write a program so we have a pulse on PLC output with (TON = 10 sec.) and (TOFF = 10 sec.)
*TON: timer output on, TOFF: timer output off. 

Solution:


Example 5:

Using up-counter (CTU), make the PWM algorithm.

solution: 
there is inside the PLC places for generating  a series of pulses with fixed durations, one of these places is SM0.5, it generates a pulse of 1 second (on time is 0.5 sec and off time is 0.5 sec). another one is SM0.4, it generates a 60 second pulses.

.. and timing diagram:


Privacy Policy   Contact Us