05-25-2023 10:34 AM
This is going to be short and sweet. I had a detailed post that, by the time I posted it, produced an error (I think something timed out).
I am using the MQTT Client from LabVIEW Open Source Project to share data between LabVIEW and .NET. I tried to use the pub sub example. It works when publishing and subscribing within LabVIEW, but would not decode payloads that were published outside of LabVIEW. I discovered that Publish.vi adds bytes to the payload and Decode Application Message (Type).vi removes those bytes from the payload. I did not know how to deal with the extra bytes within .NET, so I replaced Publish.vi with Publish (Raw Payload).vi and Decode Application Message (Type).vi with Decode Application Message (Raw).vi.
This post is for future users (including me) who need MQTT payloads to work between multiple programming languages.
06-13-2023 03:55 AM
04-30-2024 03:07 AM
Yes, this is a good changes. My publish & subscribe works well, or else error generated.
01-14-2026 12:02 PM
Can you provide an example or point me to an example where I can publish to a given topic and also include the command example similar to MQTT Explorer as my command does work there but not in the labview environment unfortunately.
01-14-2026 08:47 PM
Hi Rehan,
You may refer to my SS, will give you an idea using LabVIEW MQTT library for publish method.
Install MQTT from VIPM
01-19-2026 10:56 AM
Yan,
I tried without success. where am I going wrong? It's a simple topic and value that I just want to send once. It works using MQTT Explorer but not in a vi.
Thanking you in advance for your help.
01-19-2026 12:45 PM
After searching I also found:
MQTT Driver for LabVIEW - NI Community
GitHub - cowen71/mqtt-LabVIEW: AN MQTT Driver implementation for LabVIEW
01-20-2026 04:43 AM
Hi!
Check this:
The Publish VI flattens each input datatype to a string, which contains information about the datatype, as well as the data itself. This results in the extra characters.
The flattening by default is done by the open source Serializer class, but you can use your own serializer.
There's already a plain text serializer, which works almost as expected, but surround strings with double-quotes.
I'd derive a class from this one, which does not add double quotes.
Finally, there's the Publish (Raw Payload) VI, which takes a byte array and sends them exactly as they are. However, you have to deal with converting everything to byte array, so I'd suggest to create an own serializer class.
01-20-2026 08:11 PM