25- IoT Masterclass, Part3: Programming a Siemens PLC to Publish/Subscribe to MQTT Topics

Поділитися
Вставка
  • Опубліковано 19 жов 2024

КОМЕНТАРІ • 17

  • @mohamadismailbasha6083
    @mohamadismailbasha6083 10 місяців тому +1

    Thanks for the effort put on these videos

    • @blociot
      @blociot  9 місяців тому +1

      Thank you for your feedback 🙏

  • @akhtarshamim2424
    @akhtarshamim2424 10 місяців тому +1

    Thanks Sir

    • @blociot
      @blociot  10 місяців тому

      Thank you for watching 🙌

  • @antoniomanuelgarciarey1509
    @antoniomanuelgarciarey1509 9 місяців тому +1

    Thank you for your tututorial. In OB30 do you convert int data to an array of bytes? It seems too much programming for only transmit an int. I also want to send strings, bit, char... through MQTT to a raspberry but It seems very hard to do with an array of bytes that needs the input publishMsgPayload. I think that in previous versions of MQTT library the message was strings, I have to check ti, that is easier to manage. Thanks!

    • @blociot
      @blociot  9 місяців тому +1

      Thank you for watching.
      That's correct. The publish array is updated in OB30 in this example. You can send any data type but every digit of the number should go to one array element as its ASCII equivalent code. I really don't know why but I wish therr was an additional input in the FB to select the array data type so it would be easier to use the FB. The conversion is not hard. You can take a screenshot of 22:52. For bits, I'd suggest combining them to a byte before sending. For string, you shouldn't need any conversion. Just parse the string and fill up your array by string chars.

  • @Subscribernuern
    @Subscribernuern 10 місяців тому +1

    can you make a video about the new function in Tia Portal V18 Symbolic Access @Runtime in connection with MQTT Client

    • @blociot
      @blociot  10 місяців тому

      Sure! What are you trying to do exactly with that feature?

    • @Subscribernuern
      @Subscribernuern 10 місяців тому +1

      I want to write and read the PLC variables with MQTT and the Symbolicaccess@Runtime via a KPI

  • @gussinger6939
    @gussinger6939 6 місяців тому +1

    can I also use this method in order to send SCL Code to the CPU and run it? Let´s say I write SCL Code in an external editor and then want to test it on a real device. Is that possible?

    • @blociot
      @blociot  6 місяців тому

      Short answer is not directly. But TIA Portal has a feature called Openness which let you do many tasks by scripting. It might be helpful to look at. You can send your data (an SCL code in your case) to the PLC, but therr should be another interface to receive the data and save it as a FB, FC, etc.

  • @AungKyawNyein-qm7jd
    @AungKyawNyein-qm7jd 6 місяців тому +1

    I am getting "Bad socket read/write on client PLC: Invalid arguments provided." message.

    • @blociot
      @blociot  6 місяців тому +1

      Are you trying to publish the data or subscribe to a topic? Do youbget this message during the complie or when triggering the LMQTT block?

    • @AungKyawNyein-qm7jd
      @AungKyawNyein-qm7jd 6 місяців тому

      I just make the 'EN' TRUE and it gives me the error code '8730'. I change 'keepAlive' from '0' to '10' and it give no error. I can subscribe the topic. But, 'publishMsgPayload' does not work, it carry no value. @@blociot

    • @AungKyawNyein-qm7jd
      @AungKyawNyein-qm7jd 6 місяців тому

      It is now working. It is needed to define 'publishMsgLen'.

  • @elkechebourabir5241
    @elkechebourabir5241 5 місяців тому

    Please sir , i followed the same steps as you but when i enable the block.
    An 16#8061 error appears i tried so hard but i can't fix please help me

    • @blociot
      @blociot  5 місяців тому

      8061 is most likely because your PLC cannot find the MQTT broker. Are you using a local MQTT broker or a cloud version? You need to make sure DNS is set up correctly if not using the IP address for the broker. Also, make sure you can ping both PLC and broker on the same network.