You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anyone any information on JSON formatting for a mqtt subscription.
I am testing MQTT and looking to optimize my PLC Code within Codesys by utilizing JSON.
I can publish and subscribe single tags easily but am unable to extract the contents when i send via JSON.
My Raw JSON is
{"FirstPublish":{"ACV":{"HMI_CMD":12,"PLC_CMD":12,"Valve_Actual":null,"Curr_Setpoint":14,"Mode":6,"Status":null,"Valve_Status":null,"Valve_Namur":null,"Ready":null}}}
When i Subscribe to the topic in 'Raw' format i get the correct JSON Raw Data.
When i switch to JSON and focus on 'FirstPublish' i get [object Object] so far correct and as expected.
The next level expected is to just get [Object] or a value.
I have tried various configurations of FirstPublish:ACV, FirstPublish.ACV etc.... without getting any data.
I was expecting to set an attribute with name
ACV.HMI_CMD from Address FirstPublish:ACV:HMI_CMD
ACV.PLC_CMD from Address FirstPublish:ACV:PLC_CMD
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Anyone any information on JSON formatting for a mqtt subscription.
I am testing MQTT and looking to optimize my PLC Code within Codesys by utilizing JSON.
I can publish and subscribe single tags easily but am unable to extract the contents when i send via JSON.
My Raw JSON is
{"FirstPublish":{"ACV":{"HMI_CMD":12,"PLC_CMD":12,"Valve_Actual":null,"Curr_Setpoint":14,"Mode":6,"Status":null,"Valve_Status":null,"Valve_Namur":null,"Ready":null}}}
When i Subscribe to the topic in 'Raw' format i get the correct JSON Raw Data.
When i switch to JSON and focus on 'FirstPublish' i get [object Object] so far correct and as expected.
The next level expected is to just get [Object] or a value.
I have tried various configurations of FirstPublish:ACV, FirstPublish.ACV etc.... without getting any data.
I was expecting to set an attribute with name
ACV.HMI_CMD from Address FirstPublish:ACV:HMI_CMD
ACV.PLC_CMD from Address FirstPublish:ACV:PLC_CMD
Beta Was this translation helpful? Give feedback.
All reactions