回复:请教:关于300定时器的PV附值问题?

xxyy

  • 帖子

    116
  • 精华

    2
  • 被关注

    2

论坛等级:游民

注册时间:2004-02-05

普通 普通 如何晋级?

发布于 2005-07-18 10:40:50

0楼

参见如下帮助:
Format of the Data Type S5TIME (Time Duration)

When you enter time duration using the S5TIME data type, your entries are stored in binary coded decimal format. The following figure shows the content of the time address with a time value of 127 and a time base of 1 s.

When working with S5TIME, you enter a time value in the range of 0 to 999 and you indicate a time base (see the following table). The time base indicates the interval at which a timer decrements the time value by one unit until it reaches 0.

Time base for S5TIME


Time Base
Binary Code for Time Base

10 ms
00

100 ms



s

10

10 s
11



You can preload a time value using either of the following syntax formats:

L1) W#16#wxyz

Where w = time base (that is, the time interval or resolution)

Where xyz = the time value in binary coded decimal format

L1) S5T#aH_bbM_ccS_dddMS

Where a = hours, bb = minutes, cc = seconds, and dd?爉illiseconds

The time base is selected automatically and the value is rounded to the next lower number with that time base.

The maximum time value that you can enter is 9,990 seconds, or 2H_46M_30S.


1) = L only to be specified in STL programming
因此在HMI里变量为整形数设置时间,在CPU程序里做相应转换,若时间单位为秒,则最高四位设置为0010,其他的12位用该变量转换为相应的BCD码格式,然后将这16位整合即可。
评论
编辑推荐: 关闭

请填写推广理由:

本版热门话题

SIMATIC S7-300/400

共有54617条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

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

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

  • 分享

  • 只看
    楼主

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