Click here to Skip to main content
15,920,508 members
Articles / Programming Languages / XML
Tip/Trick

Modbus TCP class

Rate me:
Please Sign up or sign in to vote.
4.89/5 (84 votes)
23 May 2014CPOL 1.7M   60.4K   154   171
A Modbus TCP class.

The project has moved to GIT

https://github.com/stephan1827/modbusTCP

Please download and ask questions from there.

License

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


Written By
Systems Engineer
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
BugTCP Network Bug Pin
Dread_Sharp16-Nov-11 21:20
Dread_Sharp16-Nov-11 21:20 
GeneralRe: TCP Network Bug Pin
Member 841032817-Nov-11 2:07
Member 841032817-Nov-11 2:07 
GeneralRe: TCP Network Bug Pin
Dread_Sharp17-Nov-11 3:43
Dread_Sharp17-Nov-11 3:43 
QuestionNo connection could be made because the target machine actively refused it Pin
ChiWaiLam6-Oct-11 1:00
ChiWaiLam6-Oct-11 1:00 
AnswerRe: No connection could be made because the target machine actively refused it Pin
Member 841032817-Nov-11 2:09
Member 841032817-Nov-11 2:09 
QuestionMODBUS TCP Server in ASP.net Pin
arulchris8-Sep-11 21:50
arulchris8-Sep-11 21:50 
GeneralHelp with address mapping Pin
sandeepbaynes17-May-11 19:17
sandeepbaynes17-May-11 19:17 
Questionnewbie interested in Modbus TCP/IP Pin
autocatch3-May-11 16:27
autocatch3-May-11 16:27 
AnswerRe: newbie interested in Modbus TCP/IP Pin
Stephan Stricker4-May-11 8:36
Stephan Stricker4-May-11 8:36 
GeneralRe: newbie interested in Modbus TCP/IP Pin
autocatch4-May-11 13:30
autocatch4-May-11 13:30 
GeneralBig Bug Pin
Dread_Sharp29-Mar-11 3:36
Dread_Sharp29-Mar-11 3:36 
GeneralRe: Big Bug PinPopular
Stephan Stricker6-Apr-11 5:05
Stephan Stricker6-Apr-11 5:05 
GeneralMy vote of 5 Pin
JongchanAhn24-Mar-11 22:26
JongchanAhn24-Mar-11 22:26 
GeneralRe: My vote of 5 Pin
Entrase11-Dec-15 22:11
Entrase11-Dec-15 22:11 
Generalconnection lost error Pin
ttusharbb23-Jan-11 18:28
ttusharbb23-Jan-11 18:28 
Generalerror Pin
ttusharbb23-Jan-11 1:08
ttusharbb23-Jan-11 1:08 
GeneralRe: error Pin
Dread_Sharp29-Mar-11 3:22
Dread_Sharp29-Mar-11 3:22 
Generalproblem for "illegal data adress" error Pin
houzc200910-Nov-10 1:52
houzc200910-Nov-10 1:52 
GeneralRe: problem for "illegal data adress" error Pin
Michael Fauchon17-Nov-10 17:54
Michael Fauchon17-Nov-10 17:54 
GeneralRe: problem for "illegal data adress" error Pin
houzc200917-Nov-10 22:46
houzc200917-Nov-10 22:46 
Generalproblem with cross thread Pin
donelbaron5-Nov-10 3:25
donelbaron5-Nov-10 3:25 
GeneralRe: problem with cross thread Pin
Michael Fauchon17-Nov-10 17:56
Michael Fauchon17-Nov-10 17:56 
GeneralNo connection could be made because the target machine actively refused it. Pin
nsoutinho15-Oct-10 0:17
nsoutinho15-Oct-10 0:17 
Hi Stephanstricker! Thanks for your excelent work! Im having a problem to comunicate with my tcp modbus slave. It has the port 502 open and it keeps showing the error: "No connection could be made because the target machine actively refused it." On the other hand I used a simple application like the Modbus Test Pro software from "www.rogue-engr.com" and its able to communicate woth the slave on the same port 502 and same IP address.
I have tryed to change the port in your code to be the Web-http port configured in the slave that is 80 and it finally changes the interface to show all the other buttons, however it says another error that is "Slave timde out" and keeps opening the same error window filling up the screen with lots of equal error windows. Do you have any idea of what could be the problem? Thanks a lot for your help! Best Regards! Nuno Soutinho
GeneralRe: No connection could be made because the target machine actively refused it. Pin
larsberghahn26-Jan-11 0:27
larsberghahn26-Jan-11 0:27 
GeneralTimeout Error Solved Pin
Michael Fauchon25-Aug-10 5:55
Michael Fauchon25-Aug-10 5:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.