回复:请问时间转换方法

sdljj

  • 帖子

    172
  • 精华

    0
  • 被关注

    3

论坛等级:游士

注册时间:2007-08-18

普通 普通 如何晋级?

发布于 2007-09-10 10:15:59

0楼

LD SM0.0 // Every scan cycle,
TODR VB4040 // read the real-time clock.
HTA VB4041, VB500, 2 // Convert the month to ASCII
// and display on the TD 200.
MOVB 16#2D, VB502 // Load a "-" for display.
HTA VB4042, VB503, 2 // Convert the day of the month
// and display.
MOVB 16#2D, VB505 // Load a "-" for display.
HTA VB4040, VB506, 2 // Convert the year to ASCII
// and display.
MOVW 16#2020, VW508 // Load two blanks.
MOVW 16#2020, VW510 // Load two blanks.

LD SM0.0 // Every scan cycle,
HTA VB4043, VB512, 2 // convert the hour to ASCII
// and display on the TD 200.
MOVB 16#3A, VB514 // Load a ":" for display.
HTA VB4044, VB515, 2 // Convert the minutes to ASCII
// and display on the TD 200.
MOVB 16#3A, VB517 // Load a ":" for display.
HTA VB4045, VB518, 2 // Convert the seconds to ASCII
// and display on the TD 200.
显示格式:
年-月-日 时-分-秒
求知上进.
评论
编辑推荐: 关闭

请填写推广理由:

本版热门话题

SIMATIC S7-200

共有33259条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

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

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

  • 分享

  • 只看
    楼主

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