#4 Errors adding SparkPlugB to existing project?


I have successfully utilized the mqttsparkplugb-example project to connect to a mosquitto broker and can see the data being updated using MQTT.fx.

However, when I try using to follow the example of adding SparkPlugB to an existing Codesys project, I get 3 compile errors I cannot figure out. Can you point me in the direction of what I may have done or how to get by these errors?

1 Attachments


  • i-campbell

    i-campbell - 2020-12-22

    Hi Brett, fantastic to hear you are testing out the library.

    It seems the Device Description for your PLC has given an older Component Manager Library that does not have the CMAddComponent2. Perhaps the supplier has now a 3.5.16.x runtime?

    If not, can you go to Library Manager => Placeholders and see if you can choose a newer version of ComponentManager library?

    If that doesn't work, I would suggest downgrading the MQTT library to as it does not use the NBS library which is giving you the error.

    If you are still stuck, please attach or link to a projectarchive.

  • brettschneider

    brettschneider - 2020-12-24

    Thank you. I'll give that a shot.

  • h-hermsen

    h-hermsen - 2020-12-27

    We will release an intermediate version v1.3.x as a tag for easy public download very soon. Hope this helps, stay tuned and if you have questions let us know!


    Last edit: h-hermsen 2020-12-27
  • brettschneider

    brettschneider - 2020-12-28

    I was able to get my test project to compile by choosing a newer version of the ComponentManager library. Today I was able to get my hands on the hardware. Unfortunately in the download process I get a new set of errors, which I have attached. I've also attached the project archive. As you can see in the image, my device only has runtime. I'm working with them to see if they can upgrade to 3.5.16.x Is this a deal killer? I appreciate your help.

  • i-campbell

    i-campbell - 2020-12-28

    Ah, yes the MQTT library we use from CODESYS needs at a minimum Our library currently is developed in, and there were some bug fixes in this compile version which means, the way we have coded it, we need to reprogram it to get it to work any earlier than I have a branch which works in, but decided the effort to maintain this SP14 version can also be solved with the simple passage of time. (i.e. Device Manufacturers will eventually no longer use earlier versions.)

    I do not think SP11 supports TLS either, so if you wanted to use encryption you would need to upgrade anyway.

    Please keep us posted on your progress.

  • h-hermsen

    h-hermsen - 2020-12-28

    An upgrade of the runtime version is mandatory so it would be prudent to ask for the latest version which is currently SP16. For further info see:
    in section "Additional requirements".


    Last edit: h-hermsen 2020-12-28

Log in to post a comment.