Common Script With Logic Template

Common Script With Logic Template

Version

V1.0

Script name

XIRGO_SCEN_COMMON_WLT_V9

Last updated

2023-01-18

Revision information

Rev. 1

Sensor - data to publish to broker.

Settings - user configurable settings.

Table of Contents


Operating principle.

Outputs, Static signals, Timers can be controlled by various sensors or settings. Settings as SMS control, identification, speed settings, harsh driving while active raises virtual flag, which is checked in output settings.

In Output settings is used AND logic, that means if multiple checkboxes are marked, script will check if all conditions matches.

By creating replicas in single output can change logic from AND to OR.

 

Nr.

Sensor name

Type

description

1.

Motion

Sensor

Motion sensor

2.

IN2

Sensor

IN2 sensor

3.

IN3

Sensor

IN3 sensor

4.

IN4

Sensor

IN5 sensor

5.

IN5

Sensor

IN5 sensor (ignition)

6.

Harsh Cornering

Settings

Virtual sensor from Hash driving

7.

Harsh Accelerating

Settings

Virtual sensor from Hash driving

8.

Harsh Braking

Settings

Virtual sensor from Hash driving

9.

Driver Authorized

Settings

Virtual sensor from Identification. Driver authorization status

10.

Authorization Warning

Settings

Virtual sensor from Identification. Warning if driver have not presented ID tag on specified time.

11.

Static Signal 1

Settings/Sensor

Controllable virtual sensor

12.

Static Signal 2

Settings/Sensor

Controllable virtual sensor

13.

Timer 1

Settings

Virtual sensor from Timer1 settings

14.

Timer 2

Settings

Virtual sensor from Timer2 settings

15.

SMS Control

Settings

SMS control virtual sensor

16.

Speed settings

Settings

Virtual sensor from Speed settings

17.

Wiegand Present

Settings/Sensor

Wiegand protocol iButton

18.

Inside Geozone 1

Settings

Acknowledgement of being in geozone with address 1

19.

Inside Geozone 2

Settings

Acknowledgement of being in geozone with address 2


1. Assign script to Setting template.

Note. Scripts have hierarchy, so if this is the only script assigned - assign it to ‘Script1’ field.

2. Configure script settings.

After assigning a script, the Settings field will appear. Expand it to configure.

A. Enabling interfaces to work with script.

Such interfaces like Outputs, 1-wire, Static signals is a part of device hardware, so if you want them to be controlled by script - need to configure it in ‘Hardware’ settings:

Below is example of configuring Output for script access:

The same can be done with other interfaces, like 1-wire or Wiegand26.

 

B. Configuring SMS settings.

 

It will generate “SMS Control” signal, based on which you can control Outputs, Timers, or other functions.

 

C. Harsh driving settings.

Firstly need to set thresholds, which will generate violation signals:

It will generate “Harsh Cornering”, “Harsh Accelerating”, “Harsh Braking” signals, based on which you can control Outputs, Timers, or other functions.

 

D. Speed settings.

If not using ‘Geofencing’, in configuration can be used just single speed threshold. “Use Geozones” mark should be unticked.

Multiple speeds can be used together with different ‘Geozone groups’. Every address can have it’s own speed threshold.

To use Speed settings with Geozones, at first need to include Geozone group in Geofencing:

To use Speed settings with Geozones, at first need to include Geozone group in Geofencing:

Geozone ID in both ‘Geofencing’ and in Speed settings have to match.

If speed limit in Speed settings is 0 output will turn on when car will be in specified geozone.

Thresholds will generate “Speed Settings” signal, based on which you can control Outputs, Timers, or other functions.

If marked - it will activate signal if speed threshold of any ‘Geozone group’ is reached.

 

E. Identification settings configuration.

Identification can be used with, or without ‘ID lists’. If case if no ‘ID list’ is assigned, device will work with any iButton or RFID card.

ID lists can be assigned in “Identification' menu:

Below you can find an example of Identification settings configuration.

  • Disable Ibutton reading while authorized - Device will not read and parse RFID Tags while driver is authorized. (Recommended to use with Ibutton string and IDlist)

  • Authorized Only When Tag is Presented - Driver will be authorized only while RFID Tag is touching Ibutton reader.

  • Reset Authorization After Ignition is Off - device resets driver ID and authorization status after Ignition off and Authorization expiration timeout.

  • Index Of ID list - number of ID list set in ‘Identification’ settings.

Note. If ID list is enabled, Index of ID list must match with ID list index in list configuration.

  • Use ID list for Authorization - script will check if Tag ID is included in ID list.

  • Timeout for Authorization - Time given for driver to authorize, if driver is still not authorized “Authorization Warning” = True, after authorization “Authorization Warning” = False.

  • Authorization expiration timeout - time until authorization expiration after ignition turned off.

  • Ignition pin - which pin of device will be used as ignition for identification.

  • Ibutton Sensor - Assign additional Ibutton sensor (Recommended to use with Disable Ibutton reading while authorized).

  • Ibutton string format - format how chosen Ibutton sensor will be parsed. (Hex_raw, Hex, Decimal)

  • Read Tag ID option - Read Half ID: reads only lower bits of RFID tag ID. Read Full ID: reads both low and high bits of RFID tag ID.

 

When ‘Identification settings’ are configured, based on them can configure Outputs, Timers, or other functions. Can use following signals:

Driver Authorized - generates signal after tag assigned to reader when Ignition is On.

Authorization Warning - generates signal when authorization time in ‘Identification’ settings has exceeded.

Wiegand Present - generates signal after Wiegand26 tag assigned to reader.

 

F. Timer control settings configuration.

When configuring Timers it is necessary to set starting (Increment) and resetting (Reset to 0) conditions.

It will generate “Timer 1”, “Timer 2” or “Timer 3” signal, based on which you can control Outputs.

 

G. Static signal configuration.

‘Static signal’ is a long lasting virtual signal that can be generated by certain conditions, signal or SMS commands. Then stopped by other conditions. In most cases Static signals are being used for remote immobilization, or some unique scenarios.

Configuration will generate “Static signal 1” and “Static signal 2”, based on which you can control Outputs.

 

H. OUT control configuration.

After enabling ‘Script access; in Out configuration under 'Hardware’, you can create conditions when Outputs should get On and when Off.

Note, that Outputs can not have just one conditions - if you create condition when it should get ON, also need to create a condition when it should get OFF.

Conditions can be added by clicking “Add+” button:

Below is example of immobilization:


Note: After every script update, making “Reserialize” is recommended to ensure, that new settings will be rewritten to the device.