Code Monkey home page Code Monkey logo

Comments (5)

pbruenn avatar pbruenn commented on July 17, 2024 1

"1" is a string, isn't it ? Does this work:

symbols.Write("MAIN.boolVar", 1);

Yeah, thats a bug because we handle uint8_t just like the other integer types but stringstream interprets it as ascii. I have a fix ready will release soon together with the string handling issue #194

from ads.

tboegi avatar tboegi commented on July 17, 2024

"1" is a string, isn't it ?
Does this work:

symbols.Write("MAIN.boolVar", 1);

from ads.

simonschmeisser avatar simonschmeisser commented on July 17, 2024

No, there is no such function signature ...

from ads.

simonschmeisser avatar simonschmeisser commented on July 17, 2024

Good catch! I switched to using AdsVariable for those types but I wonder if there should not be more overloads like Write(string, bool) to avoid the string conversion all together?

Is there actually a technical difference between those two APIs? Do they result in different data being send to the PLC?

from ads.

pbruenn avatar pbruenn commented on July 17, 2024

Yes, there is a huge difference AdsVariable with handle is much safer! Accessing PLC variables "directly" by index group and offset is pretty dangerous, because you can silently corrupt the memory when the PLC did an online change for example. SymbolAccess was meant to demonstrate how access PLC variables in a generic way. A better version of SymbolAccess::Read/Write would generate a handle and use the handle when accessing the variable on the PLC.

However, the bug about ASCII instead of integer for BOOL values should be fixed with d7ada12

from ads.

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.