The GetCurrentMobileLocationForDevice() function retrieves the latest mobile location reported by the specified asset, not the asset that generates the Expression Rule. The mobile location is reported in the form: (lat, lng). Use this function in Expression Rules that compare locations or distances with other assets.
Array GetCurrentMobileLocationForDevice(String model, String serialNumber)
where:
model
- The name of model
for the asset for which you want to retrieve mobile locations.
serialnumber - The serial number of the asset.
The following example returns the current location for the specified asset
GetCurrentMobileLocationForDevice("model1","device1")
In the following example, if the asset (device1) is more than five miles away from the asset that generated the Expression Rule, create an alarm.
If: DistanceToBoundingGeometry(GetMobileLocationN(5), GetCurrentMobileLocationForDevice("model1","device1") > 5
Then: CreateAlarm("outOfBounds",
10)