Giter Club home page Giter Club logo

Comments (8)

ConstRico avatar ConstRico commented on July 20, 2024

p, err := Serialize(
class, instance, msg_data,
)
in GenericCIPMessage method is right.

from gologix.

danomagnum avatar danomagnum commented on July 20, 2024

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.

ConstRico avatar ConstRico commented on July 20, 2024

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.

danomagnum avatar danomagnum commented on July 20, 2024

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.

ConstRico avatar ConstRico commented on July 20, 2024

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.

danomagnum avatar danomagnum commented on July 20, 2024

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.

danomagnum avatar danomagnum commented on July 20, 2024

https://github.com/danomagnum/gologix/releases/tag/v0.21.0-beta

from gologix.

ConstRico avatar ConstRico commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.