2010年2月22日

CentOS5.4 Linux下Modbus TCP IP协议C++的一个小例子

摘要: ////////////////////////////////////////////////////////////////////////////* ReadCoils函数: 读继电器的状态 , 成功返回ture。 send 数据长度=12 recv 数据长度=... 阅读全文

posted @ 2010-02-22 17:02 johnphan 阅读(989) 评论(0) 推荐(0) 编辑

说明变量不能太吝啬了short int 与int 不能用错了。

摘要: 用iret保存各种初始化网络接口函数的返回状态 例如:connect()等函数的返回状态 。0正常,-1出错。 说明吝啬一点:unsigned short int iret ; 结果就出问题了。 -1成了65535了。改成:int iret; 结果就正确了。 ... 阅读全文

posted @ 2010-02-22 16:15 johnphan 阅读(139) 评论(0) 推荐(0) 编辑

导航