Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

CANopen slave device: Boolean PDO objects not working

2022-03-11
2022-03-11
  • johnhastech

    johnhastech - 2022-03-11

    Hi There,

    I have been working on a project to make a PLC a CANopen slave. It's been working very well so far, but I have found either an issue or something I'm not doing right.

    When mapping objects to PDOs, boolean values are not working as expected. No errors are reported by the compiler, however, in runtime these PDO objects do not work properly. Setting a boolean RPDO object to TRUE has no effect in the slave application, and boolean TPDOs written by the slave application do not change state either. Until now, my work around is to make boolean objects an unsigned8 type. In this way, the TPDO/RPDOs work as expected using the least significant bit.

    This is an ok solution, but it would be better if a boolean object could work properly in the PDOs.

    I have attached a pdf with screen shots of my CANopen slave configuration for a boolean object. Please can anyone point out where I may be going wrong, or if this is a known bug?

    I'm using Codesys V3.5 SP11 Patch 0. If there is a fix for this in later versions, I can migrate the code.

    Many Thanks,
    John

     
  • johnhastech

    johnhastech - 2022-03-11

    I have just noticed that I have duplicated the same object twice. I will check if this is the issue!

     

Log in to post a comment.