GetMobileLocationN() function

The GetMobileLocationN() function retrieves the last N samples of locations for the asset, as an array, where N is an integer up to 50. The returned array elements are strings of the form: (lat, lng), where lat is the Latitude coordinate of the location and lng is the Longitude coordinate of the location. You can pass this array to the DistanceToBoundingGeometry() function.

 

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 GetMobileLocationN(Number number)

where:

number - number of values to retrieve, a positive integer from 1 to 50.

 

This function does not accept negative numbers.
 

Example of use:

The following example returns the last five locations for the asset:

GetMobileLocationN(5)

To calculate the distance of the asset from the bounding geometry, use the DistanceToBoundingGeometry function with this function. For example:

DistanceToBoundingGeometry(GetMobileLocationN(10), location)