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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Storing data in Values stream

AkshayKumar
10-Marble

Storing data in Values stream

Hi,

I am Successfully reading Sensor values to Thingworx, I have kept 5secs for autorefresh widget,

the values are updating every 5secs ,but i want all Values should be stored in Valuestream every second ,In "QueryPropertyHistory" its showing only 2-3 values., i want to see each and every reading that had been sent to Thingworx proprties. How to do it??

please help

Untitled.png

13 REPLIES 13

And I chose "Valuestream",, should i try with "Remote value stream"??

dupatel
19-Tanzanite
(To:AkshayKumar)

Akshayakumar p​ : Can you share your property Data Change type option for Temperature and Humidity. Is it set to Always ?

Hereit is sir

Untitled1.png

"Data change type" is not always sir!

should i set it to always??

supandey
19-Tanzanite
(To:AkshayKumar)

Akshaya, ValueStream is the right option for you. Remote Value Stream has different purpose (i.e when you are setting up federated ThingWorx). How fast is the value changing on the edge device? What is the Data Change Type for the property in the Thing? How often are you scanning for property change on the edge? All of these parameters will affect how many values you are seeing in a given time period in your value stream.

supandey
19-Tanzanite
(To:supandey)

It really depends if you want all values, doesn't matter whether its changing or not to be pushed to the platform then you can set to always. In that case every time scan is performed by the SDK value will be pushed to the platform.

Usually in production environment you are mostly interested when the values do change for e.g. changing from 1 to 2 this will create a event and value will be pushed to the platform with the next scan. If it will change again back to 1 from 2 it will again be pushed to the platform. (Note i am not including yet the Threshold in discussion here, so assuming its  not set.)

So I think you should check how fast you are scanning for value change on the edge side. BTW, the screenshot you have shared appear to show that data change type is set to Always. So with that you will get all the values with every scan.

Which SDK are you working with?

Actually i am using EMS,

now i changed "DataChangeType" to always!,

so that all the values will be stored in Valuestream sir??, can i see them in "QuryPropertyHistory"

supandey
19-Tanzanite
(To:AkshayKumar)

Yes you should be able to see them in the QueryPropertyHistory. Are you using Lua together with the EMS? What scanrate has been set in the configuration file? See Configuring the scanRateResolution for more detail . Note default value is set to 60000ms.

Scan rate has been set to 1000 sir,

actually i am seeing Values in QueryPropertyHistory but its showing only 3 readings.

but i want each and every reading that has been updated in every 5 seconds.

supandey
19-Tanzanite
(To:AkshayKumar)

can you please share your lua configuration for the thing and the ValueStream configuration? Is the property in the ValueStream set to persistent?

sir,I have created Luascript for only Thing, not Valuestreams sir.

i just Created valuestreams incomposer and assigned it to the Thing thats it sir.

here is my Luascript for Thing

scripts.log_level = "INFO"

        scripts.PiThing = {

        file = "thing.lua",

        template = "PiTemplate",

        scanRate = 1000,

        taskRate = 30000

        }

        scripts.rap_host = "127.0.0.1"

        scripts.rap_port = 80

supandey
19-Tanzanite
(To:AkshayKumar)

Thanks for sharing the lua config. Sorry if i was not completely clear, definitely you don't create script for value stream. What i meant was that how is the value stream configured in the ThingWorx Composer which you are using for recording these values.

i just created a valuestream "Pithing_valuestream" and tagged it to a model tag,

assigned this Valuestream to my Thing "PiThing" sir!

Top Tags