IN port variable in IEC 61131-3 app not getting cleared?

I’m trying to toggle an output based on the content of an MQTT message. I’m using an IEC 61131-3 app with a simple EQ logic block. But I am getting some weird behaviour where the content of the SubMessage (an OUT port variable) isn’t always properly cleared for some values (and contains some trailing characters that I am not expecting) mosquitto_pub -t “MySubTopic” -m "d1on " ----> “d1on ic” is shown (where is the trailing ic coming from) mosquitto_pub -t “MySubTopic” -m “someValue” ----> “someValuec” ends up in variable (where is the trailing c coming from) mosquitto_pub -t “MySubTopic” -m “some” ----> “somebTopic” ends up in variable (where is the trailing bTopic coming from) mosquitto_pub -t “MySubTopic” -m “abc” ----> “abc” ends up in variable (seems to be ok because it is only 3 characters) mosquitto_pub -t “MySubTopic” -m “abcd” ----> “abcdbTopic” ends up in variable (wjere is the bTopic coming from) mosquitto_pub -t “MySubTopic” -m “12345” ----> "12345Topic " ends up in variable It is as if some kind of buffer isn’t cleared and the variable always wants to contains "MySubTopic " but gets partly overwritten… any idea what could be causing this ? Screenshot 2020 03 20 14.08.23 Screenshot 2020 03 20 14.07.57 mosquitto_pub -t “MySubTopic” -m “some” ----> “somebTopic” ends up in variable Screenshot 2020 03 20 14.08.09

Hi Davy, I am guessing that SubMessage is an IN Port variable that is being written to by the MqttClient app … is that correct? If so, then the problem is probably caused by either the MqttClient app, or by something upstream of that app, which is causing the unexpected characters to appear in the String. I think you mentioned in a later message that you have made some progress with your application. So, is this still an issue? ~ Martin.