When I created a new label on the admin page and configured it, sending data to the mqtt subject of the new label did not work.
I checked the realtimeData collection of mongo db and confirmed that the sourceDataUpdate field of this collection has been written with the data I just sent, which shows that the sparkplug-mqtt module is working properly.
So I went to debug the cs_data_processor module and found that the data update of the new label did not trigger the change event of the changeStream of cs_data_processor, so I saw this piece of code. It seems that one condition that triggers the change event is that the tag has a value field.
Hello.
When I created a new label on the admin page and configured it, sending data to the mqtt subject of the new label did not work.
I checked the realtimeData collection of mongo db and confirmed that the sourceDataUpdate field of this collection has been written with the data I just sent, which shows that the sparkplug-mqtt module is working properly.
So I went to debug the cs_data_processor module and found that the data update of the new label did not trigger the change event of the changeStream of cs_data_processor, so I saw this piece of code. It seems that one condition that triggers the change event is that the tag has a value field.
json-scada/src/cs_data_processor/cs_data_processor.js
:I noticed that creating a new tag is achieved through the /Invoke/auth/createTag route of server_realtime_auth.
json-scada/src/server_realtime_auth/app/controllers/auth.controller.js
:But the mongooseSchema used by this route does not contain the value field.
json-scada/src/server_realtime_auth/app/models/tag.model.js
:Is the reason for the missing value field because of my wrong way of using it?
Did I miss something?
Thank you!