GetMobileLocationNForDevice() Function

Like the GetMobileLocationN() function, the GetMobileLocationNForDevice() function retrieves mobile locations. However, it retrieves them for another asset, not the asset that generated the Expression Rule. Specifically, this function retrieves the last N samples of mobile locations, in an array, for the specified asset of the specified model. The elements in the returned array are Strings, of the form: (lat, lng).

Use this function in Expression Rules that compare locations or distances with other assets.

Important! This function is available only if the Axeda® Platform is configured to enable historical functions.
Historical functions retrieve data from the Platform,
which can slow response time for rules processing.
To ensure optimal response time, Axeda strongly recommends that you limit the amount of data these functions retrieve, the frequency that the expression rules that use them run, and the number of assets associated with expression rules that use them. For example, do not request historical data more than once per second.

Format:

Array GetMobileLocationNForDevice(String model, String serialNumber, Number number)

where:

model - The name of model for the asset for which you want to retrieve mobile locations.

serialnumber - The serial number of the asset.

number - The number of values to retrieve.

Example:

The following example returns the last five mobile locations for the asset with serial number "Asset1" and model number "model1".

Then: GetMobileLocationNForDevice("model1","Asset1",5)

 

See Also