Hello,
I am using MQTT communication to send and recieve data. I subscribe to a topic and recieve a JSON Payload. The key corresponds to a variable on the controller and the value is the new value the variable is to be set to.
My application may have 10, or 100, or maybe 1000 variables that need to be updatable from the UI.
Is there a way to use the key (which is a string) as a reference to the variable that is to be updated so i can keep to code concise.
Currently my only method of updating the value would be using a case select statement checking if the string value matches the tag. however this would need to be done for each tag.
Any thoughts would be appreciated
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am using MQTT communication to send and recieve data. I subscribe to a topic and recieve a JSON Payload. The key corresponds to a variable on the controller and the value is the new value the variable is to be set to.
My application may have 10, or 100, or maybe 1000 variables that need to be updatable from the UI.
Is there a way to use the key (which is a string) as a reference to the variable that is to be updated so i can keep to code concise.
Currently my only method of updating the value would be using a case select statement checking if the string value matches the tag. however this would need to be done for each tag.
Any thoughts would be appreciated