回复:关于时钟存储器的应用程序

0917

  • 帖子

    86
  • 精华

    0
  • 被关注

    3

论坛等级:游侠

注册时间:2012-12-03

普通 普通 如何晋级?

发布于 2015-02-03 19:51:53

20楼

非常高兴我不经意间看到的程序引起大家很大的兴趣,虽然我对它的应用理解的还是很肤浅。但是各位大侠只是通过这几句语句就推测出怎么用,实在令人佩服。这个我所说的M27.5,的确是用在定时器里的,可以做1秒级的定时器。
A #START // If the Command Bit is OFF, force the
JC TIMI // time accumulator to 32767
CLR // and exit with boolean status = OFF.
SAVE
L 32767
T #ACCUM
BEU
TIMI: AN M 27.5 // If the 1-second ONS pulse flag
JC AFTD // is not ON, skip the count-down
L #ACCUM // If the Accumulator is > Preset,
L #PRESET // force it to the Preset Value
>I
JCN DECR
T #ACCUM // Then decrease the Accumulator
DECR: L #ACCUM // by one (once at a second)
L 1
-I
T #ACCUM
AFTD: L #ACCUM // If the accumulated count is <=0,
L 0 // then the boolean status is set ON
<=I // and the accumulator is forced to
= L 0.0 // ZERO to prevent further negative
JCN OUTP // accumulation that could result in
T #ACCUM // rollover of the 16-bit accumulator
OUTP: A L 0.0 // and consequent wrong timer output.
SAVE
跟大家分享,再次感谢各位大神的回复,让我们这些小虾学到很多。
学习快乐 快乐学习
评论
编辑推荐: 关闭

请填写推广理由:

本版热门话题

SIMATIC S7-300/400

共有54622条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

快扫描右侧二维码晒一晒吧!

再发帖或跟帖交流2条,就能晋升VIP啦!开启更多专属权限!

  • 分享

  • 只看
    楼主

top
您收到0封站内信:
×
×
信息提示
很抱歉!您所访问的页面不存在,或网址发生了变化,请稍后再试。