S7-300/400PLC pulse method

Method one: CPU clock memory


CPU in the hardware configuration properties Cycle/Clock Memory in the Clock Memory setting the Memory Byte, you can look at to help, each one having a fixed frequency Propreties window click on the Cycle/Clock Memory (loop memory/clock) tab, you can set the Scan cycle monitoring time ( Scanning cycle monitoring time in MS), the default value is 150ms. If the actual cycling scanning time exceeds the set value. CPU will enter STOP mode. Scan cycle Load from Communication used to restrict the traffic handling as percentage of scanning cycle, the default value is 20%
Clock pulses are available for user programs using a square wave signal with duty cycle 1:1, one byte of memory every clock corresponds to one pulse is as follows:
 
Byte                          Bit7    Bit6  Bit5 Bit4   Bit3 Bit2 Bit1 Bit0
Frequency (Hz)         0.5    0.62    1   1.25     2    2.5    5   10
Period (seconds)      2         1.6     1    0.8    0.5   0.4    0.2  0.1

 

If to using clock pulse, first to selected “Clock Memory’ (clock memory) option, then set clock memory (m) of byte address. assumed set of address for 100 (that MB100), has Shang table known, M100.7 cycle for 2s, if with M100.7 of often open of touch points to control Q0.0 of coil, Q0.0 will to 2s of cycle flashing (bright 1s, out 1s).


OB85-Call up at I/O access error changes to the system used to set CPU process image I/O access errors that occur when the response If you want to call OB85 when an error occurs, it is recommended that select Only for incoming and out going error (and only errors disappear), as opposed to On each individual access (individual access), Does not increase the scanning cycle time.


Method two: write your own delay procedures and set the delay time, when the time comes when executing a stored procedure call, which under the influence of program cycle time, is not particularly accurate, if it is under less stringent conditions this method can be used.


Method three: using interrupt organization block break on to achieve, such as in OB35 calls a stored procedure, implement store, this method is more accurate.


Method four: SFC1 reads the CPU clock, by a clock realized intervals are calculated as the difference of the value stored. (This method S7-200 from those I do not write the third method similar to this programming method)


Method five: interval such as if you use an external trigger signal, also by means of hardware interrupts.

 

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.