Click here to Skip to main content
15,888,031 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

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.
 
Share this answer
 
Quote:
I have read the manual and it says it supports Modbus/TCP, TCP, UDP protocols
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
 
Share this answer
 
Comments
Vin$hi 22-Jan-13 10:02am    
The manual has sample code in Java and C# .net but nothing in c++. So, if i use socket programming to communicate with the device it should work right?
Mohibur Rashid 22-Jan-13 20:11pm    
you will have to know how to convert other programming language to your preferred language and no one will teach you that
Jibesh 22-Jan-13 20:17pm    
Yes its just the string commands to send across. If you refer the manuals and C# or Java samples you can do that effortlessly. and again if you have any trouble CP is ready to help you so no worries Good Luck.
Vin$hi 23-Jan-13 9:54am    
Thank you. That is really motivating. I will work on this and if i have any doubts will post it here.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900