Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hi,
Actually, I have a use-case in which multiple tags are coming one after one from Azure IoT Hub in one JSON property which is overwriting every time with the property value and timestamp . The property name is populating in some other string property.
and my subscription is running on that JSON property.
I have to dynamically update all the properties as per JSON data arrives but sometimes what happens that the data of one property gets updated to some other property and hence it results in false data for all the properties.
As per my understanding, if somehow I can make this subscription like it will not execute next time until the current execution will not complete then maybe it can solve the issue of assigning false data to properties.
Can somebody help with this?
Thanks in advance.
Solved! Go to Solution.
Hello @ranjank,
If you have control over the edge side, you should probably try to put propertyName and Status values into the Value JSON, similar to what you have with SourceTimestamp -- this is the only way I can think of to avoid this issue. I don't believe that synchronizing the subscriptions (to ensure that they don't run in parallel) will help, because their order is not strictly defined.
Regards,
Constantine
Hi @ranjank.
It sounds like you may have a coding issue. However, we're not understanding why a subscription is necessary. If your configuration is set up correctly, you should be receiving updates from the Azure IoT Hub automatically.
How frequently are you receiving updates from your devices? How many devices are sending updates?
Regards.
--Sharon
Hi @slangley ,
We are getting remote properties like propertyName and Value (i.e. its value) in below format
{
"event": {
"origin": "ABCDevice",
"payload": "{"NodeId":"nsu=KEPServerEX;s=temperature","ApplicationUri":"urn:ABC:Kepware.KEPServerEX.V6:UA%20Server","propertyName":"temperature","Status":"Good","Value":{"Value":45,"SourceTimestamp":"2020-05-01T12:31:01.4608889Z"}}"
}
}
After binding remote property in ThingWorx it will look like:-
NodeId-------->nsu=KEPServerEX;s=temperature
ApplicationUri---> urn:ABC:Kepware.KEPServerEX.V6:UA%20Server
propertyName----> temperature
Status-----> Good
Value-------> {"Value":45,"SourceTimestamp":"2020-05-01T12:31:01.4608889Z"}
and since there are more than 25 tags (per thing) are coming one by one and overwriting "propertyName" and "Value" we simultaneously we have put the subscription on the Data change event of "Value" property to dynamically create and update the values of property coming in "propertyName".
Azure IoT Hub pushes all the tags simultaneously after every 30 seconds.
Hello @ranjank,
If you have control over the edge side, you should probably try to put propertyName and Status values into the Value JSON, similar to what you have with SourceTimestamp -- this is the only way I can think of to avoid this issue. I don't believe that synchronizing the subscriptions (to ensure that they don't run in parallel) will help, because their order is not strictly defined.
Regards,
Constantine
Thank you for your response.
Our azure expert changed the format of JSON message and then after some modification in subscription we got our desired result.
Cheers!!
Hi @ranjank.
If one of the previous responses answered your question, please mark the appropriate one as the Accepted Solution for the benefit of others with the same question.
Regards.
--Sharon