Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hi All,
I'm new in Thingworx, i facing a problem below:
I want to create a Thing/Services that contain the information below
1. Input parameter named "machine_Run", base type "Boolean"
2. A variable named "total_Qty", is integer/long
3. With the condition machine_Run = 1, "total_Qty" will keep on increase (total_Qty = total_Qty +1; every sec +1 if possible)
4. When machine_Run changed from 1 to 0, will insert a single record into SQL (DateTime and total_Qty)
5. Is it possible to make the Thing/Services to run in background?
Solved! Go to Solution.
Then if it's for live update, you should go with the timer.
To present the data, use "Push Properties" on the mashup this way the quantity will update live with data from the server, no Pull needed.
You can create a Timer thing which triggers every Second and does the total_Qty+1 execution. But take care, TW it's not a real time system then timer events can or can't be executed "on time".
But one moment, why don't you just record starting time, and differentiate seconds between starting time and ending time?
Carles Coll. Thanks for your suggestion.
It is a good idea on create a timer thing and trigger total_Qty + 1 execution.
Agree, this TW is not a real time system.
I just want to develop a demo system to my client.
While the machine is running, the production count will increase. And the production count will stop if the machine is stopped.
Do you have better idea on how to present it in TW?
Then if it's for live update, you should go with the timer.
To present the data, use "Push Properties" on the mashup this way the quantity will update live with data from the server, no Pull needed.
This should be a good method, thanks.
Do you mind to share me some information regarding the "Push Properties"? I tried to understand from the knowledgebase below, but i cant.
Hi Tan,
The clue it's on this part of the document ( you should be at least at TW 7.2 ):
Enabling Automatic Property Updates:
Thanks! Carles Coll