|
Hello,
I have the same Problem,
can anyone help?
|
|
|
|
|
Hi everyone, for all of you who have timeout problem here is probably your answer. In fact the problem have been already explain here, if you check couple of sujet lower. You need to change your unit identifier to 1...most of the time. To do so, open the modbus tcp source code, go in the createreadheader function and createwriteheader, and change the value of the slave adress from 0 to 1. It maybe another number than 1. But most of the time it's 0 or 1.
It work for me!
Good luck
|
|
|
|
|
Hello can anyone help me to tell how to use this dll in vb. especially on how to manage event
this is what a tried.
Imports ModbusTCP
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim MBmaster As New ModbusTCP.Master("172.18.1.170", 502) Wit
End Sub
Private Sub MBmaster_OnResponseData(ByVal id As Integer, ByVal func As Byte, ByVal data As Byte()) Handles MBmaster.OnResponseData
End Sub
|
|
|
|
|
Stephan,
I would greatly appreciate any help in this area as well.
I'm trying to implement a VB GUI that will import your class properly.
|
|
|
|
|
Hi guys, you just have to add a reference in your project. Then select the tcp_class.dll. From there you should be able to create a Master...if you have any other problem, ask them here! (by the way, check the example that comes with the code, pretty well done).
|
|
|
|
|
hi all,
i'm new progammer in VC ++, i've downloaded the file but don't known what language to open the source code. It's not VC ++ project, anyone please help me.
thanks in advance.
dnqhung
|
|
|
|
|
dnqhung wrote: hi all,
i'm new progammer in VC ++, i've downloaded the file but don't known what language to open the source code. It's not VC ++ project, anyone please help me.
thanks in advance.
Hi, I don't know if it's too late to answer you, but I'll take a shot. Indeed, the code is in Csharp or C#(two ways of saying the same thing). You have two choice, either you use it as a dll as it is, or you find a Csharp IDE to modify it. (Which could be useful due to the unit_identifier problem explain above). If you have Visual Studio Express you should be able to modify it for free, or take a look on google you should find something. Once it is modify to meet your need, recompile it as a dll and then use it in VC++ as a reference.
I hope it'll help you!
|
|
|
|
|
Hi Stephen,
First of all, thanks a lot for the app, that's a good article. I'm using the ModbusTCP for communicating with IFD9506 module to control 80EH model PLC(via RS485). I was able to connect to IFD9506 from PC, but I receive "Slave Timeout" error for every Modbus function.
|
|
|
|
|
Hi,
first thanks for this code.
I have noticed a small problem which perhaps can explain some error reported (exception 2).
In your fonction the "id" is used to set the "Transaction identifier" and you set "Unit identifier"
to 0.
For me you should be able :
1) to set the "Unit identifier" let say the Modbus slave adress,
2) to manage the "Transaction identifier" which may be a frame counter different for each request frame
Regards.
|
|
|
|
|
Hi
I got this error:
Modbus says error: Slave timed out!
every time that I want to Read coil , was getting error.
My PLC is SCADA Pack.
What should I do?
Please help me.
thanks
_____________
Only God !
|
|
|
|
|
Hi, just want to say thanks to the author. Amazing job. Let me tell you, for a fisrt version...pretty bugfree. You should publish you code on other website, cause I had a hard time finding it.
Thanks again. Viva la open source
fauchon.michael@gmail.com
|
|
|
|
|
I use the code ,but it no can modify modbus node ?
flair
|
|
|
|
|
i got error with Illegal data adress!. Then i find to definition about excIllegalDataAdr at ModbusTCP.Master. It's set excIllegalDataAdr=2. Can you explain about excIllegalDataAdr?
|
|
|
|
|
hello!
I have a question about this class!
we have an project,that we called it power system,it use an simens pac3200,so I was one of the programers who must test this pac3200 whether that support the modbus tcp protocal,all I say is to ask
you if I used this class,it could write the register,couldn't it? one of our programmers design one programm that he test it can read(his programming). your class is very good,since I saw this class,I was worried if "the code project" hadn't had.
I wish your answer
|
|
|
|
|
When I downloaded the zip file given above there were no source files inside, only some assorted VS project files, the ModbusTCP.dll and the help file. I'm not sure if what I was expecting (Some sample C++ code on how to use the DLL) is supposed to be there or not.
At any rate, I was wondering if someone would be kind enough to provide me with a short bit of code that demonstrates how to implement this code into a Visual Studio C++ 2005 program. Specifically, binding an event handler to the OnResponseData event. I've done a lot of C programming but I'm fairly new to this managed code malarkey, so if someone's got a very basic example I'd be very much appreciative.
Many thanks,
Travis.
tjhowse [take that] gmail [bots] com
|
|
|
|
|
Hi,
I'm a researcher and I appreciated your code beacuse it is simple and good
for students and simple projects.
I converted the project on VS.NET2005 without problems and it already runs well!
I'd like understand if it is easy add the Modbus RTU(or serial) support using
the new serial class in the .net 2 framework.
(http://www.codeproject.com/cs/system/Serialport_COM.asp)
Please let me know if you have some ideas about it.
Thanks,
Nunzio
|
|
|
|
|
Hello Nunzio,
it is good to see that someone enjoys this code. I think it is better to do an separate class for serial modbus connection because a lot of the serial device is different. For example the serial driver for .net supports event handling. This makes the thread part of the class no longer necessary. On the other hand you have to build an CRC and a different header. IMHO it makes more sence to build a separate class for serial modbus.
Greets
Stephan
|
|
|
|
|
hello, I tried to convert your code INTO vb.net because I need the code for an application on a PDA so that it can communicate on an Ethernet network, but I with have a problem of transform the function of the event especially when one uses it in a structure yew, it asks me to use (raiseevent) but it goes to start an event but not in the structure yew, is what have you a solution for this concern thank you
mah_zouihed
|
|
|
|
|
hello, I tried to convert your code INTO vb.net because I need the code for an application on a PDA so that it can communicate on an Ethernet network, but I have a problem of transform the function of the event especially when one uses it in a structure (if), it asks me to use (raiseevent) but it goes to start an event but not in the structure (if), is what have you a solution for this concern thank you
mah_zouihed
|
|
|
|
|
hello, I tried to convert your code INTO vb.net because I need the code for an application on a PDA so that it can communicate on an Ethernet network, but I with have a problem of transform the function of the event especially when one uses it in a structure if, it asks me to use (raiseevent) but it goes to start an event but not in the structure if, is what have you a solution for this concern thank you
mah_zouihed
|
|
|
|
|
I have got a project where a pc server(Windows 2000 Server) has to communicate (Modbus RTU and Modbus TCP protocols) with 5 load cells/scales and 5 barcode scanners over the RS232, RS485 and Ethernet interfaces(to complicate the matter further are plans to place a small screen at each scale too).
Each loadcell/scale has its own barcode scanner and they are supposed to work in sync, which means the scanner should read the barcode label belonging the the item on the corresponding scale and report the results to the server. I am a C# VS2005 programmer and have no experience of Modbus protocols. If you mail me your email address I send you as attachment a simple drawing of the test model. Greatful for any tip about how to implement the project.
Hope you will make my problem to one of yours!
|
|
|
|
|
I am also very unexperienced in Modbus, but I have to begin with it soon. Maybee the following link might help you for your project:
http://nmodbus.com
|
|
|
|
|
Hello,
I wrote this class exclusive for Modbus TCP so you cant use it for seriell connection. There is another project in the net that uses VS2005 and support both kind of connections. Maybe this is more suitable for your needs.
http://www.nmodbus.com/Default.aspx
mfg
Stephan
|
|
|
|