cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Storing ValueStreams as Datatables after every RestartThing Service

emericboyu
7-Bedrock

Storing ValueStreams as Datatables after every RestartThing Service

Hello everyone,

I'm working on a project about cooling down procedure of our production chain.  I created a thing template with the properties "startTime", "stopTime", "coolDownTime" and "tempC" and I also logged these properties.  For now there are two sensors which are represented as Things in ThingWorx and they inherit the thing template.  They also have a property called "jobId" which defines the job at the cooling down station.  This property changes everytime the thing is restarted with the service "RestartThing"  I also changed the "QueryPropertyHistory" service according to the timestamps of "startTime" and "stopTime", so only the temperature values between the start and stop of the cooling down will be seen as a value stream.  What I want to do is to save the valuestream as a datatable and display it on a mashup after I RestartThing, which is when the cooling down procedure for one job is finished and so for the next job another valustream can be created.  For example, after 3 cooling down procedures there must be 3 valuestreams created and displayed on the mashup seperately.  These datatables must also be reachable through a list widget according to the "jobId" property of the sensors.  Is there a way to do that?

Thank you

2 REPLIES 2
jamesm1
12-Amethyst
(To:emericboyu)

Do you need to keep all of the history of the previous jobs in the value stream? If not, I wouldn't use a value stream at all -- I would create an InfoTable property where you continually add rows as the job is proceeding, and then write the InfoTable and JobId to the DataTable when the job is finished. Then, clear the infotable on when you Restart the thing to begin logging the next job.

I actualy need to save the history of the previous jobs.  The point is to be able to see the temperature graph of all the previous jobs.  In addition these temperature graphs should be selected from a list widget which is build according to the 'jobId' property value of the thing.

Announcements


Top Tags