Comments (8)
p, err := Serialize(
class, instance, msg_data,
)
in GenericCIPMessage method is right.
from gologix.
GetAttrSingle was a straightforward fix.
I had to rework the GenericCIPMessage function signature. It is now
func (client *Client) GenericCIPMessage(service CIPService, path, msg_data []byte) (*CIPItem, error)
Which will allow messages with and without an attribute on the path. This means you have to do one more function call though (or hard code the bytes of the path).
path, err := gologix.Serialize(gologix.CIPClass(0x04), gologix.CIPInstance(0x303), gologix.CIPAttribute(0x03))
...
r, err := client.GenericCIPMessage(0x14, path.Bytes(), []byte{ service data goes here})
What is service 0x14? I don't have a definition for it.
from gologix.
I agree with your perspective. However, the fundamental issue lies in the fact that PathLength does not consider the length of CIPAttribute. This problem is present in all methods.
Hah, 0x14 is actually GetAttrSingle. But I want to PathLength is dynamic, so I decide to use GenericCIPMessage.
Perhaps I can create a new branch to fix this issue and then submit a Merge Request to you. What do you think?
from gologix.
Oh ok. GetAttributeSingle is 14 in decimal (0x0E) (unless there are two getattributesindle services - which wouldn't surprise me).
Take a look at the latest commit (fdf9aca). I think it addresses the issues - I got rid of the hard-coded path length and calculate them appropriately (hopefully). I also fund a bug in the length calculation for the CIPAttribute type also so that was a good fix.
from gologix.
Looks good! Will you be releasing a new version soon? I referenced your code as go library, I cannot verify it unless you release a new version now.
from gologix.
I will do the new release now. Usually takes a little bit for the google module cache to update but then you'll be able to get the new version.
from gologix.
https://github.com/danomagnum/gologix/releases/tag/v0.21.0-beta
from gologix.
Thank you for your prompt response! All features are now in effect, if there are other needs, I believe we can address them in our local code.
BTW, the current methods are not as user-friendly as they were before, especially for someone new to CIP. However, this is not a significant issue.
from gologix.
Related Issues (17)
- Support batch writing of values? HOT 3
- Issue on Header when using ReadMulti() HOT 46
- Mult-Read Doesn't Support Arrays
- Server does not reply to bad requests or requests that end up with server side errors.
- ReadMulti() potential problem due to struct having some non-gologix tags HOT 1
- [QUESTION] How I can get the Tag variable type from the PLC? HOT 2
- client.GetAttrList for Identity Object returns expected results only for L7x controllers HOT 5
- Connection reset by peer, using ETHERNET-MODULE for Class 1 Ethernet/IP connection HOT 13
- how to add field in struct by ReadMulti function? HOT 2
- Modification Request? HOT 3
- Concurrency issue HOT 3
- Unused switch statement here HOT 1
- Support reading more than the message size with one read call.
- Support more class 3 services
- [Bug] Cannot read string using ReadList() / ReadMulti() HOT 3
- [Question] Timeout HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gologix.