Hi there, I'm a newbie when it comes to programming in C# with VS2015. I use S7-1200, all actions related with compability ( full acces, put/get, unchecked optimized block) were performed. The connection with PLC was made succesfully but i can't use other functions like DBRead. I'm always getting the same error as in the topic. I've made a simple DB in my PLC with 8 integer variables. Here's my very simple code:
So the question is what size of my Buffer should be? In my opinion 8 integers equal 16 bytes so do you have any idea what's wrong with the buffer?
Regards,
jacken
Last edit: jacken 2016-11-29
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello again,
I had a short break so sorry for responding just now.
I inserted the breakpoint as you mentioned and the value of Length is equal 19. So that's why this condition (Length<25) is true. I analyzed the RecvIsoPacket() method but couldn't find any solution for my problem. CPU firmware: 4.1.3. I made the same test with ClientDemo but when tried to use Data read/write option there was the following response: "CLI:function refused by CPU (unknown reason)". I don't know if that's what you mentioned about PDU dump but i made a screenshot of PDU when i used the breakpoint. Every byte after position 27 is equal 0. Any suggestions?
Hi,
"Cli:CLI:function refused by CPU" is an error raised by S71200/1500 CPU when a client cannot access either due to "protocol not enabled" or DB optimized.
I know that this post is very old.
But do you remember how you found a solution?
Because i have exactly the same problem.
Length is equal to 19, so i can't read anything...
Thank you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I got rid of the same problem by applying what Davide Nardella suggested. In my case the error message was "Bad data size passed to send/recv buffer is invalid" and length was always 19. Follow instructions on the link http://snap7.sourceforge.net/snap7_client.html#target_compatibility if you have a S71200/1500 device.
HTH
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi there, I'm a newbie when it comes to programming in C# with VS2015. I use S7-1200, all actions related with compability ( full acces, put/get, unchecked optimized block) were performed. The connection with PLC was made succesfully but i can't use other functions like DBRead. I'm always getting the same error as in the topic. I've made a simple DB in my PLC with 8 integer variables. Here's my very simple code:
So the question is what size of my Buffer should be? In my opinion 8 integers equal 16 bytes so do you have any idea what's wrong with the buffer?
Regards,
jacken
Last edit: jacken 2016-11-29
Hi,
maybe the message is wrong :(
the issue is not related to your parameters but to the telegram received.
could you insert a brekpoint at line 2217 of Sharp7.cs ?
I need to know the value of Length.
And, if possible, the dump of PDU[] (only 100 bytes).
Which firmware has your CPU ?
Could you make the same test using ClientDemo.exe ? (you should download Snap7 package)
Last edit: Davide Nardella 2016-11-29
Hello again,
I had a short break so sorry for responding just now.
I inserted the breakpoint as you mentioned and the value of Length is equal 19. So that's why this condition (Length<25) is true. I analyzed the RecvIsoPacket() method but couldn't find any solution for my problem. CPU firmware: 4.1.3. I made the same test with ClientDemo but when tried to use Data read/write option there was the following response: "CLI:function refused by CPU (unknown reason)". I don't know if that's what you mentioned about PDU dump but i made a screenshot of PDU when i used the breakpoint. Every byte after position 27 is equal 0. Any suggestions?
Hi,
"Cli:CLI:function refused by CPU" is an error raised by S71200/1500 CPU when a client cannot access either due to "protocol not enabled" or DB optimized.
Did you read this (the S71200/1500 chapter) ?
http://snap7.sourceforge.net/snap7_client.html#target_compatibility
DB must not be optimized.
GET/PUT must be enabled.
After the modifications remember to download the configuration into the PLC.
I tested Sharp7 with a CPU whit the same firmware and works.
Omg, I didn't download the hardware configuration to my plc. That fixed my problems. Thank you
I know that this post is very old.
But do you remember how you found a solution?
Because i have exactly the same problem.
Length is equal to 19, so i can't read anything...
Thank you
Hi,
I got rid of the same problem by applying what Davide Nardella suggested. In my case the error message was "Bad data size passed to send/recv buffer is invalid" and length was always 19. Follow instructions on the link http://snap7.sourceforge.net/snap7_client.html#target_compatibility if you have a S71200/1500 device.
HTH
finalement j'ai du downgrader le firmware vers 1.8.2 (à partir du 1.8.3 ça ne marche pas)
Merci quand-même