10-19-2023 12:32 PM
Dear jephin27,
I tried your VI and I can establish a connection. However, I encounter this error:
"Flattened String To Variant in OpenSerializer.lvlib:Serializer.FlattenedString.lvclass:unmarshalling.vi:3430001->OpenSerializer.lvlib:Serializer.lvclass:UnMarshall.vi:4390003->OpenSerializer.lvlib:Serializer.lvclass:UnMarshall (binary).vi:6550002->MQTT Base.lvlib:MQTT_Base.lvclass:Decode Publish Package.vi:2830001->MQTT Client.lvlib:Client.lvclass:Decode Application Message (Type).vi->DropVi_SimpleClientSubscriber.vi.vi".
Can you help me with this?
Thank you!
10-19-2023 03:24 PM - edited 10-19-2023 03:25 PM
What type is your received data? Decode Application Message (Type).vi works on LabVIEW data types. Use Decode Application Message (Raw).vi to get a byte array that you can decode according to the received data type.
See here for a detailed explanation: https://github.com/LabVIEW-Open-Source/LV-MQTT-Broker/issues/169#issuecomment-950385388
10-20-2023 08:35 AM
Thank you for the answer!
I think that the link solved the question.
The data is float but I had to substitute the "Decode Application Message (Type)" with "Decode Application Message (Raw)".
I also added a conversion from byte array to double passing by a string type (maybe it's dumb and there is a better way to do it).
I attach a screen of this part of the VI.