Click here to Skip to main content
12,547,591 members (47,719 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++ Windows TCP/IP
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 21-Jan-13 9:57am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.161018.1 | Last Updated 21 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100