发布于 2004-04-04 19:17:13
0楼
采样时间一秒应该用定时吧,
Special Memory Byte 0 (SM0.0 - SM0.7) provides eight bits that are updated by the S7-200 CPU at the end of each scan cycle. You can use these bits to invoke functions in your program.
SM Bits(Read Only) Des cription
SM0.5 This bit provides a clock pulse that is on for 0.5 seconds and then off for 0.5 seconds for a cycle time of 1 second. It provides an easy-to-use delay or a 1-second clock pulse.
用上升或下降沿就可以有1秒定时了。
然后就是高速计数HSC(如不会用F1、搜索HSC)
再后就是加减乘除了吧。