佚名通过本文主要向大家介绍了cp56time2a时标格式,cp56time2a格式,cp56time2a,关于函的格式,关于报告的格式等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
问题: 关于CP56time2a的格式
描述:
解决方案1:
描述:
协议中要用CP56time2a格式传递时间,找这个格式的定义,先是:
Defined in 7.2.6.18 of IEC 60870-5-101
好吧。找60870-5-101的文档,找到7.2.6.18:
CP56Time2a := CP56{milliseconds,minutes,res1,invalid,hours,res2,summer time,day of month,day of week,months,res3,years,res4}
This binary time is defined in 6.8 of IEC 60870-5-4.
又让找60870-5-4的文档,这个文档我是找不到了。
这是啥格式啊?
解决方案1:
CP56time2a是101/104规约中定义的时间格式,101和104是电力通信规约的一种,2000年左右进行了修订,现在使用的104规约应该就是2000年的版本。
根据以前下载的一个文档的说明,104规约应该是默认的20xx年了,所以xx是从00-99年,所以7bit能表示00-99就可以了。毕竟一种规约能用一百年,已经了不起了。
附截图:
#pragma pack(push, 1)
typedef struct cp56time2a {
u_short msec;
u_char min :6;
u_char res1 :1;
u_char iv :1;
u_char hour :5;
u_char res2 :2;
u_char su :1;
u_char mday :5;
u_char wday :3;
u_char month :4;
u_char res3 :4;
u_char year :7;
u_char res4 :1;
} cp56time2a
#pragma pack(pop)