Tutorial for the Edge MicroServer > Creating and Pushing Property Changes
Creating and Pushing Property Changes
As your device collects data, property values change. Changes in property values can come from device interrupts and from polled values. The EMS lets you know when synchronization with the ThingWorx Platform is complete. After that, the EMS can start pushing property values to the platform, whether for itself or on behalf of an LSR device.
Push Types
You can specify when each property should be pushed up to the ThingWorx Platform from ThingWorx Composer. Navigate to the Properties page of a Thing that represents an EMS device.
For all properties, the default push type is NEVER The other valid values are ALWAYS and VALUE. What you need to know:
A pushType of NEVER does not push data to the ThingWorx Platform instance, so when a property with pushType=NEVER is queried on the ThingWorx Platform instance, the ThingWorx instance queries the software of the edge device for the data value.
A pushType of ALWAYS pushes the data every time the property is read at the edge device, which is determined by the scanRate parameter. If the scanRate is not set on the property, the scanRate from the Lua Script Resource configuration file is used. If not defined in either location, a default of 60000 milliseconds (1 minute) is used. The Edge device pushes all properties that have a pushType of ALWAYS and the same scan rate in one call, rather than make individual calls per property.
For NUMBER or INTEGER property types, a pushType of VALUE pushes data to the ThingWorx Platform only when the data value change exceeds the dataChangeThreshold setting.
Retrieving History of Property Values
To retrieve the history of value changes for a given property, you can use the QueryPropertyHistory() service from ThingWorx Composer. Log in to Composer, navigate to your Thing, and select Services. Locate the QueryPropertyHistory service, and select to run it (Execute icon). Enter the name of the property and any other criteria for the search. To minimize the time for the search and the load on the server, limit the query as much as possible.
Was this helpful?