Skip to main content
1-Visitor
September 19, 2019
Question

download historical sensor data

  • September 19, 2019
  • 12 replies
  • 7259 views

Come faccio a scaricare i dati storici del sensore nell'applicazione Creo Product Insight da un server ThingWorx.

Grazie

12 replies

21-Topaz I
September 24, 2019

Hello  @titurbina,

I hope the translation of google is so far  ok:

"How do I download historical sensor data into the Creo Product Insight application from a ThingWorx server."

===========

Could you, you please, provide more details about the intention the goal what you want to achieve?

So far, I understand you have a value stream data, right?

Let say it represents a measurement for an  angle of mechanism part for some time range. 

Also, in Creo Parametric you have an mechanism which should  use this angle as measurement.

So now I suspect you want to use this data /historical data associated to the measurement of your mechanism in Creo Parametric (in Creo Dimension on a pin join)

When you configure /setup Creo Insight you are prompted  to select a thing having a value stream (let say with angle property) . so, what I believe you can do  - > is to copy your historical data to this value stream. To copy a data to a stream I think the simplest way is to  use custom service  which read you historical data and will write to the value stream.

Unfortunately, I have currently Installation of Thingworx server without  Creo If there is more details required  - in this case  I need to check it more deeper and , of course , to  install the Creo Inside to my current environment.

Thanks

21-Topaz I
September 27, 2019

Hi @titurbina ,

 

I am sorry for the delay! Now I installed the Creo Insight on Thingworx 8.4  and tested with Creo Parametric 5.0.4.0.

So I used on the server side as mentioned Thingworx (ThingWorx 8.4.0-b2013)

CreoInsightDashboardExtension 8.3.0
CreoProductInsightThingworxExtension 8.3.0
ThingWorx_Analytics_Builder_Extension 8.4.0
ThingWorx_Analytics_Console_Extension 8.4.0

========

The first point I want to mention is that you need license for Creo Parametric to be able to use the sensor menu:

PRODUCT_INSIGHT.

You can check if you have this license when you call in Creo Parametric the menu  #File>Help>System Information

 

2019-09-27_13-20-50.gif

- you mentioned in your feedback that you have historical data. The question is in what of format do you have the historical data.

This data could be a Thingworx thing which have some value stream where data is recorded or this data is another file excel or csv file.  For the both option there should be no problem to use this data in Creo Insight but also you can transform the data form Thingworx value stream to excel and vice versa.

Let check it first only for the Creo Parametric Interface. When you have the PRODUCT_INSIGHT license option you will be able to see the following menu items:

 

2019-09-27_13-27-22.gif

To this point you can see the video as mention by @cmorfin  or mentioned in the post.

Important is that when you define a sensor - this is a part with name (let say sensor_1.prt). You will be able to define a part as sensor if you have the  PRODUCT_INSIGHT option.

 

2019-09-27_13-33-49.gif

So later as already shown in the video you can load the sensor.

In the example model I used I have 2 sensors:

 

2019-09-27_13-43-10.gif

 

1.) If I have the data in csv format I could load the data to Creo parametric .

 

2019-09-27_12-06-14.gif

 

The question here is  -what is  the correct format?

Here I have a part with the name "SENSOR_1.PRT" and sensors (mdl of sensor_1.prt parameters) named "ANGLE" and "TEMP"

The data should be csv format ( there are a lot of ways to convert any data to CSV and also excel directly could save to it  or read it )

 

In this case the file should have the following syntax:

 

 

Set Name,SENSOR_1/TEMP,SENSOR_1/ANGLE
2019-09-27T07:00:30.126Z,229.661615,1.516545
2019-09-27T07:00:31.126Z,-174.518596,36.837679
2019-09-27T07:00:32.126Z,-95.971392,24.702305
2019-09-27T07:00:33.126Z,69.389865,81.987879
2019-09-27T07:00:34.126Z,197.526367,51.298425
2019-09-27T07:00:35.126Z,181.306855,65.065420
2019-09-27T07:00:36.126Z,225.430527,1.770463
.... further lines
....
2019-09-27T07:00:48.126Z,-163.583834,3.932845
2019-09-27T07:00:49.126Z,-182.624593,22.908542

 

 

The same data  here below  in Excel:

 

2019-09-27_14-02-07.gif 

 

 

So in this format for this particular sensor definition you could load the data to Creo Parametric (without connection to the server!) And could for example used it to set different states of the measurements (something similar to family table) example:

 

 

2019-09-27_12-05-17.gif

 

2.) the second option is if you have the data already in Thingworx as  value stream property. You can download the data from thingworx. For example for the sample sensors above I defined the a thing using logged property with value stream. Then I could print an output of the entities in a particular time range using the QueryPropertyHistory service:

 

 

2019-09-27_14-10-54.gif

 

Now I could connect this Thing with data  - in this case I generated the data by some funciton using random inputs (... but this could be also your historical data). 

To connect the data we need to use the "TW.AnalysisServices.AnalysisMainMashup" mashup. We can simple start this mashup in Thingworx in preview mode.

How to create Analysis provider and how to get this mashup is shown in the video mention above.

The essential part here to create an event for  this thing.

 

2019-09-27_14-20-58.gif

 

Now you can receive a data from the value string of the properties "ANGLE" and "TEMP" of  TES_stream - Things - for particular time range into Creo:

 

2019-09-27_14-24-55.gif

 

Then you can load data from the server and run it:

 

2019-09-27_14-32-58.gif

 

We can run only a data set or run all sets from the table.

We have the option save the data to csv format and work later with Excel but there is also an option to export the data to server and possibly to override an existing data, but this required another type event where the source is Creo and target Thingworx. I tested this option, but I could not get it working so may be if someone have idea how to setup the event in the analytics manager will be great.  Actually we can also import such data directly to a thing in Thigworx by some customized services (and csv parser extension)

21-Topaz I
October 11, 2019

Hi @titurbina ,

 

I am not sure if I understand correctly your request because I think it repeat simple partially the same question what I tried to answer in the post above. Did you check all points I provided in my previous post? 

So, no  let me , please,  try here to answer it so far I understood it:

- you are working only in CreoInsight -  we will not consider here the connection to the Server.

1.) you need define a sensor. You need to open the part which should be used as sensor and then to click the Creo commands  File>Prepare>Model Properties > and select the sensor Item change:

 

2019-10-11_12-52-20.gif

 

So here this will open a dialog box where you can:

a.) specify an xml file - >and this is your first question. There is no such definition as template by default. So, means you can save you own sensors in this format to use it later for definition. But if you create your first definition you have to omit this step.

b.) then if you do not provide a xml file Creo will open simple a parameter box. And the definition of your sensor is SIMPLE PARAMETER DEFINITON as we are familiar with Creo Parameter Definition in a Part :

 

2019-10-11_13-08-59.gif

 

And when you defined the parameters for the sensor - you can save/ export them as xml file which could be used furher for the same sensor defintion.

This is all! It is very simple!

Here is the format for sample definition of 2 parameters with untis:

 

 

 

<?xml version="1.0" encoding="UTF-8"?>
<CreoParamSet>
 <Parameter Name="ACCELERATION">
 <Unit>mm / sec^2</Unit>
 <Value>0.000000e+00</Value>
 </Parameter>
 <Parameter Name="TEMPERATURE">
 <Unit>K</Unit>
 <Value>0.000000e+00</Value>
 </Parameter>
</CreoParamSet>

 

 

 

2.) now when we have the sensor definition, then  we need to have some values - To get such values we  need to use csv file.

Of course ,  we need to define this sensor file . The format is very simple:

 

Set Name,<SENSOR PART NAME>/<Parameter1>,<SENSOR PART NAME>/Parameter 2, .....<SENSOR PART NAME>/Parameter N
time stamp 0, value0 of parameter 1,value 0 of parameter 2, ....,value 0 of parameter N
......
......
time stamp m, value m of parameter 1,value m of parameter 2, ....,value m of parameter N

 

so and here an example of this file for the mentioned parameter definition above. For simplification of the creation I used the  same  values for different time stamps - (the time stamps  should be different to have consistent data if we want later to transfer it to Thingworx - same value of sensor means it will not change over particular time range 😞

 

Set Name,SENSOR_1/ACCELERATION,SENSOR_1/TEMPERATURE
2019-09-27T07:00:30.126Z,1.111,5.5555
2019-09-27T07:00:31.126Z,1.111,5.5555
2019-09-27T07:00:32.126Z,1.111,5.5555
2019-09-27T07:00:33.126Z,1.111,5.5555
2019-09-27T07:00:34.126Z,1.111,5.5555
2019-09-27T07:00:35.126Z,1.111,5.5555
2019-09-27T07:00:36.126Z,1.111,5.5555
2019-09-27T07:00:37.126Z,1.111,5.5555
2019-09-27T07:00:38.126Z,1.111,5.5555
2019-09-27T07:00:39.126Z,1.111,5.5555
2019-09-27T07:00:40.126Z,1.111,5.5555
2019-09-27T07:00:41.126Z,1.111,5.5555
2019-09-27T07:00:42.126Z,1.111,5.5555
2019-09-27T07:00:43.126Z,1.111,5.5555
2019-09-27T07:00:44.126Z,1.111,5.5555
2019-09-27T07:00:45.126Z,1.111,5.5555
2019-09-27T07:00:46.126Z,1.111,5.5555
2019-09-27T07:00:47.126Z,1.111,5.5555
2019-09-27T07:00:48.126Z,1.111,5.5555
2019-09-27T07:00:49.126Z,1.111,5.5555

 

And then we can load the data to sensor and use it lo run all or only specific parameter set:

(in this example we have always the same value, but we can edit them and set different measurment values  and then if we use some relation we can see a change when we run a set!)

 

2019-10-11_13-31-32.gif

I hope now is clear. If not then , please, let me know!