与报警模块通信 [英] Communicate with Alarm module

查看:91
本文介绍了与报警模块通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个闹钟模块(Adam 6066)。我想从我的c ++程序中与这个模块进行通信。我正在使用Windows平台。我已经阅读了手册,它说它支持Modbus / TCP,TCP,UDP协议。我不知道如何开始。任何建议或示例代码都会有很大的帮助。

I have an alarm module(Adam 6066). I would like to communicate with this module from my c++ program. I am working on Windows platform. I have read the manual and it says it supports Modbus/TCP, TCP, UDP protocols. I am not sure how to start with it. Any suggestions or sample code will be of great help.

推荐答案

MODBUS 是一个相对简单的协议。 Google 快速搜索的前两个条目是两个有用的文档:我有 CRC 实现( C来自第一个的源代码):Modicon

Modbus协议 - 参考指南
[ ^ ]并使用第二个,即:MODBUS APPLICATION PROTOCOL SPECIFICATION [ ^ ]作为参考。
MODBUS is a relatively simple protocol. The first two entries of a Google quick search are two useful documents: I''ve got the CRC implementation (C source code) from the first one: "Modicon
Modbus Protocol - Reference Guide"
[^] and used the second one, namely: "MODBUS APPLICATION PROTOCOL SPECIFICATION"[^] as reference.


Quote:

我已经阅读了手册,它说它支持Modbus / TCP,TCP,UDP协议

I have read the manual and it says it supports Modbus/TCP, TCP, UDP protocols

,这意味着您可以通过套接字与设备通信以读取/写入数据。



正常的程序是通过他们的手册来了解如何配置你的设备,手册也将有示例代码/应用程序如何读/写设备。 br />


您可能需要在应用程序中实现套接字通信程序,以便向设备读取/写入数据。看一下这个文章 [< a href =http://www.codeproject.com/Articles/13071/Programming-Windows-TCP-Sockets-in-C-for-the-Begin\"target =_ blanktitle =New Window> ^ ]关于C ++中的套接字编程。另请参阅手册以了解如何发送/接收数据

which means you can communicate with the device though sockets to read/write data to it.

The normal procedure is go through their manual on how to configure your device, the manual will also have sample code/application how to read/write to the device.

You might need to implement a socket communication program in your application to read/write data to your device. take a look at this article[^] on socket programming in C++. Also refer the manual for how to send/receive data


这篇关于与报警模块通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆