您现在所在的是:

串口通信

回帖:1个,阅读:1254 [上一页] [1] [下一页]
906
jsythanxi
文章数:1
年度积分:50
历史总积分:906
注册时间:2004/9/2
发站内信
发表于:2006/3/4 11:09:00
#0楼
有没有同行有modbus  time format的读写经验,我需要把时间写入modbus从站,占4个寄存器,谢谢分享!以下是从站数据格式说明。

TIME FORMAT 64 bit

All Times and Dates available to be read or written via MODBUS in the Model 2000
are in the TIME or Modbus TIME format which is a 64 bit number with the following
attributes:-

SSMMHHWDDDmmYYxx

Where

SS Seconds valid numbers in the range 0 to 59
MM Minutes valid numbers in the range 0 to 59
HH Hours valid numbers in the range 0 to 23 (0=midnight)
WD Week Day Number valid numbers in the range 1 to 7 (1=Sunday)
DD Day valid numbers in the range 1 to 31
mm Month valid numbers in the range 1 to 12
YY Years valid numbers in the range 0 to 99 (assumed to be 20xx)
xx Fault/Validation code

Notes
1) The above item will be recognised by the M2000 and windows software as a time and
Date format. It cannot be cast as any other format i.e. a double or float etc.
2) It can sent in any available byte order i.e. 1234 or 4321
3) It can be split in to available register sizes i.e. 1*8 or 2*4 etc.
4) For writing the Time and Date the Week Day does not need to be correct only valid
the M2000 will correct it , so e.g. it could always be written as 1.
5) For writing the Time and Date the Fault/Validation code is ignored i.e. it does not need
to have any value.
6) For reading if the Validation code is set the Time and Date is Valid if it is returned as 0 (zero) then the RTC device in the M2000 is faulty.



[此贴子已经被作者于2006-3-5 19:36:58编辑过]
935
wx008
文章数:15
年度积分:50
历史总积分:935
注册时间:2005/5/20
发站内信
发表于:2006/4/27 15:13:00
#1楼
大家好,我现在在编PLC与VB的通讯,是MODBUS的,现在现成的资料上面,有读PLC寄存器数据的例子,我已经完成了,不过,现在往PLC中写数据就不能了,因为,不知道MODBUS,写寄存器的RTU格式,有人能帮助我下,告诉我:
RTU格式的(MODBUS)写寄存器的格式么?
01  ,  06   ,   **    **  ,  **    **  ,CRC0,CRC1

联系方式:58959352(QQ)   lhd_981@126.com

关于我们 | 联系我们 | 广告服务 | 本站动态 | 友情链接 | 法律声明 | 非法和不良信息举报

工控网客服热线:0755-86369299
版权所有 工控网 Copyright©2024 Gkong.com, All Rights Reserved

62.4004