Click here to Skip to main content
Rate this: bad
good
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
Vin$hi417
Rate this: bad
good
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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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
  Permalink  
Comments
Vin$hi at 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 at 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 at 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 at 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
0 CPallini 345
1 BillWoodruff 324
2 George Jonsson 279
3 Sergey Alexandrovich Kryukov 258
4 OriginalGriff 227
0 OriginalGriff 5,050
1 CPallini 4,225
2 Sergey Alexandrovich Kryukov 3,639
3 George Jonsson 2,911
4 Gihan Liyanage 2,386


Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 21 Jan 2013
Copyright © CodeProject, 1999-2014
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