|
is it possible to open more than connection at a time
|
|
|
|
|
Yes, just create another instance of the master function block.
Stephan
|
|
|
|
|
Hello Stephen,
I tried using the example in a different context, Instead of havin btnReadHoldReg_Click(..) invoke the callbacks I have an example that works on timers. Lets call this function ReadHoldReg_Click().
It works for a while, but then the "values" array becomes NULL and there is nothing to copy and an exception is thrown. Since my example is too big to debug I am trying to modify your example to work on "ticks" rather than "clicks" to see if the same undesired behavior can be somehow provoked.
Originally I tried using a Modbus driver from a different source, but this never worked. The connection dropped after a while and the reconnection sequence did not work for me.
https://groups.google.com/forum/#!topic/nmodbus-discuss/Tb834C5wnpU[^]
Has anyone experienced the "values" array in the frmStart.cs module going NULL?
....
grpData.Text = "Read holding register";
globaldata = values;
regards
Colm
modified 26-Jul-13 9:38am.
|
|
|
|
|
For connecting to siemens S1214 I had to change port from 501 to 102 but now the fild below remain white ever.
In this way I (hope) have estabilished the connection, now i'd like read and write!
pls help me thanks!
|
|
|
|
|
The standard port for modbusTCP is 502. Where did you change that port (Windows or Siemens) and what field exactly remains white?
Stephan
|
|
|
|
|
I've resolved everything and i've also build a solution for read , bool, int, real and string.
For develop this .dll i used the LibNoDave.dll library.
Soon i hope to post my release.
PS: the port that I use is 102
|
|
|
|
|
This is what I'm looking for,
Thanks
|
|
|
|
|
|
Hi,
I am trying communication between my PC and Siemens PLC with MODBUS TCP. PLC is a server, and I set "P#M100.0 BYTE 200" to holding register. I am using first 100 bytes for reading with no problem, but writing to the second 100 bytes doesn't work. I am using WriteMultipleRegister(6, 100, data), everything looks OK and no error msg, but value didn't change on the PLC side.
Could anyone please help?
Thanks a lot in advance.
Anne
|
|
|
|
|
Anne,
Can you please download wireshark and add some traces? This will tell us what data is sent and the response from the plc.
Stephan
|
|
|
|
|
Hi Stephen,
Thanks for your reply.
As you suggested, I tried wireshark, and was using your MODBUS tester to test the communication. It seems that for writing multiple registers, the start address couldn't go over 84. If start address is bigger than 84, for example 85, PLC will give out exception.
I saved the file and screen copy, but not sure how to attach it to this message.
and I am new to it, maybe did something silly.
Thanks,
Anne
|
|
|
|
|
Anne,
somewhere in the Siemens PLC there must be a configuration where you define the size of your Modbus buffer. It seems that you buffer is 84 plus the amount of data you try write. When you write to addresses below 84 do you see the values in the Siemens PLC?
Stephan
|
|
|
|
|
I am kind of get it. In my case, if the second 100 bytes are for writing, then the start address should be 50 instead of 100.
Is it right?
thanks,
Anne
|
|
|
|
|
did you resolve the problem!?
If yes could you contact me at andrea.feduzzi@gmail.com or post below.
I use siemens s1200 series
thanks
|
|
|
|
|
Hi thanks for the code but i am having a slight problem
Connection to the PLC is succesful but i cant seem to write coils.
I am using your test application.
Problem:
The Start address is at 0
The Size is 8 Bytes
I can write the first coil but when i try to write the second one it does not work
I have tried writing multiple coils but still it does not work. May I no why this is happening and how i can solve it
|
|
|
|
|
What error message do you get? Can you create a network trace with Wireshark?
|
|
|
|
|
I have Visual Studio 2008 and Framework 3.5 SP1
after convertion, a have error
'no overload for 'MBmaster_OnResponseData' matches delegate 'ModbusTCP.Master.ResponseData'
and others
which Framework or version VS should be correct for compile without convertion?
|
|
|
|
|
The framework that I used was 2.0 but it should work with newer frameworks as well. The message that you get sounds like the number of parameters that you define ResponseData function is not correct.
Stephan
|
|
|
|
|
I am not familiar with the visual studio tools, but I expect to be able to figure it out.
However, I cannot open the solution with the free download Visual Studio Express (VB and C# installed)
Can someone please give me a step by step on how to get started.
Thanks.
|
|
|
|
|
The source code should work with VS2010. What exactly happens when you try to open it?
|
|
|
|
|
Ah, I fixed it. I was confused about which tool to use, and ended up with the 2012 desktop version, which works really well.
Thank you !
|
|
|
|
|
Hi,
Thanks for this amazing API. Btw, I am able to write, but unable to read. No error message given. Did someone have that bug too?
Thanks.
Alex
|
|
|
|
|
If you dont see an error message everything should be fine. Can you create a Wireshark trace from the data exchange and post it here?
|
|
|
|
|
I am testing function code 23 using synchronous mode. I can get the command to work but am having some difficulity getting my code set up to check for exceptions, I wanted to make sure the command was executed sucessfully before processing the results. I was hoping to find a simple code sample that would show the proper way to check for exceptions.
|
|
|
|
|
Stephan, I tested your software in VisualStudio2008 and after some conversion processed by the environment, I compiled and worked perfectly without modifications.
I tested this software with a Modbus/TCP simulator from a company called EmbeddedIntelligence.
Excellent job.
|
|
|
|