登录
首页 串口通信 串口通信
回帖 发帖
正文

主题:modbus 时间格式数据

点击:1309 回复:1

有没有同行有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
06-03-04 11:09
大家好,我现在在编PLC与VB的通讯,是MODBUS的,现在现成的资料上面,有读PLC寄存器数据的例子,我已经完成了,不过,现在往PLC中写数据就不能了,因为,不知道MODBUS,写寄存器的RTU格式,有人能帮助我下,告诉我:
RTU格式的(MODBUS)写寄存器的格式么?
01  ,  06   ,   **    **  ,  **    **  ,CRC0,CRC1
联系方式:58959352(QQ)   lhd_981@126.com
06-04-27 15:13

工控新闻

更多新闻资讯