Giter Club home page Giter Club logo

Comments (5)

kyle-github avatar kyle-github commented on July 22, 2024

This might be an issue with 3-address forms. Also, it looks like reading a bit is different from reading a word. The commands may be different.

from libplctag.

kyle-github avatar kyle-github commented on July 22, 2024

This is going to require separating out the protocols into CIP and PCCC most likely. It is also not clear that the existing API would easily allow for this as there is no inherent boolean type supported.

Given the ubiquity of bool/coil, perhaps it makes sense to extend the API.

from libplctag.

amacierzynski avatar amacierzynski commented on July 22, 2024

Is that mean that we will not be able to read data from Boolean data types from our MicroLogix 1400, or this is only for Integers as you put as an example in the post?

Regards,
Adam

from libplctag.

kyle-github avatar kyle-github commented on July 22, 2024

Unfortunately in my tests, using the 0x0f/0x68/0x67 commands shows that the PLC/5, at least, returns an error if there is a third address element. It will not send back the one bit. I just did some more checking and found that this applies to both N and B data files at least.

You can read a boolean file, B, but cannot give it a third address element: B3:4.2 (which does not make sense). When you read a boolean element, you want to specify the data file and the element, but not a third element: B3:4. The PLC will return a 16-bit word with all the bits.

TL;DR you can read the data from integers and booleans but you will have to mask the bits off yourself.

I have not made any changes to the library to support bit reads and writes yet. I have to finish more of the refactoring in the 2.0 version of the library.

from libplctag.

kyle-github avatar kyle-github commented on July 22, 2024

Closing in favor of #82. Boolean support is not good for most types of PLC.

from libplctag.

Related Issues (20)

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.