Fleetrun
Hecterra
NimBus
Other apps
Wialon for Android/iOS
Logistics
Wialon Local
Wialon Hosting
WiaTag
Configurator
LeaseControl
en
Contents
Expression Parameters
  • sensors
  • sensor_parameters

The sensor parameter can be a compound expression. Due to such parameters, you can create a wide variety of sensors which meet any needs and purposes. In the expression, you can use:

  • parameters from the last message (adc1, in1, and so on);
  • parameters from the previous message (they should be preceded by the sign #, for example, #adc1);
  • bitwise control of a parameter (param199:3, and so on);
  • sensor names (they should be indicated in square brackets, for example, [Fuel level]);
  • constant parameters (const10, const-4.54, and so on);
  • mathematical operation signs listed below.

SignOperation

addition

− 

subtraction

∗ 

multiplication

division

^

exponentiation (for example, ^const2 denotes squaring, ^const0.5 denotes square rooting)

( )

parentheses of priority (for example, in the expression const1.5*(param1−#param1), the parentheses indicate that subtraction should be performed before multiplication)

|

value availability check

parameter conversion

The parameters from the previous message are not available:

  • for the Private mode sensor and its validator,
  • for sensors in notifications,
  • in tooltips for charts,
  • during the retransmission of sensors.
If one of the parameters included in the expression is invalid, the total value of the expression is also invalid. 

Sensor values are calculated in the following order:

  1. calculating the expression in the Parameter field,
  2. conversion of the value according to the calculation table (if configured),
  3. validation (if configured).

Parameter for determining speed by coordinates

The parameter of a sensor which determines speed by coordinates can be as follows:

((lat-#lat)^const2+(lon-#lon)^const2)^const0.5/(time-#time)*const200000

In this parameter, speed is calculated by dividing distance by time. The distance, in its turn, is calculated using the Pythagorean theorem: first, the squared difference in latitude between two successive messages is added to the squared difference in longitude between these messages, and then the square root is extracted from this sum. The result is the distance in degrees. It is divided by the time difference between the successive messages. This gives the speed expressed in degrees per second. To convert the speed value to kilometres per hour, it is necessary to multiply it by the conversion coefficient used for the required latitude. The given parameter uses the coefficient for Moscow, which is 200,000.

The coefficient of converting degrees to kilometres is calculated using the formula

111321*cos(55.75583)/1000*3600=225513.52

where 111,321 is the length of the parallel arc of 1° in longitude on the equator, m; 55.75583  is the latitude of Moscow in decimal format.

If you want to calculate the coefficient for another place, indicate its latitude in decimal format instead of Moscow's, without changing the rest of the values.

If an ignition sensor is configured for the unit, the parameter of speed sensor can be as follows:

((lat-#lat)^const2+(lon-#lon)^const2)^const0.5/(time-#time)*const200000*[Ignition sensor name]

You can use such a sensor only in reports (not in online notifications) because it requires parameters from the previous message.

Parameter for determining relative engine hours

To obtain data on real engine hours, you should create two sensors:

  • sensor of the coefficient of engine hours (determines the intensity of the equipment operation depending on engine revolutions);
  • sensor of relative engine hours.

To create a sensor of the coefficient of engine hours, follow these steps:

  1. Click New.
  2. Enter the sensor name.
  3. Select the Custom sensor type.
  4. As the sensor parameter, specify the expression (param1+#param1)/const2, where param1 stands for the parameter which sends the value of engine revolutions. The parameter of the coefficient sensor is the arithmetic average of engine revolutions within the interval between two successive messages.


  5. In the calculation table, enable the XY pairs option and configure them as follows:

    XYExplanation

    500

    0.33

    One minute of operation at 500 rpm corresponds to 20 seconds of engine operation, which means that the coefficient is 0.33.

    1000

    0.67

    One minute of operation at 1000 rpm corresponds to 40 seconds of engine operation, which means that the coefficient is 0.67.

    1500

    1

    One minute of operation at 1500 rpm corresponds to 60 seconds of engine operation, which means that the coefficient is 1.

    2000

    1.5

    One minute of operation at 2000 rpm corresponds to 90 seconds of engine operation, which means that the coefficient is 1.5.

  6. Click Generate.
  7. Click ОК.

Next, create a sensor of the Relative engine hours type and specify the following parameter for it:

(time-#time)*[Coefficient sensor name]/const3600

This parameter is the time difference between two successive messages which is multiplied by the coefficient of operation intensity and divided by 3600. Division by 3600 is required to convert seconds to hours.

You can use such sensors in reports and counters, but not in online notifications, because they require parameters from the previous message.

Value availability check

The value availability check is used to avoid data loss when the equipment is replaced. To apply this operation, specify the required parameters in the Parameter field, separating them by a vertical bar (|). The system takes into account the first valid value from the specified parameters.

Example. The equipment installed on the unit during the first month sent data in the param1 parameter, and the equipment used since the second month sends the same data in the param2 parameter. To exclude the loss of data, when executing a report for two months you should specify param1|param2 in the Parameter field of the sensor properties. In this case, the system takes the value from the param1 parameter, and if it is invalid, from param2.

The values of other sensors can also be used in the format [Sensor name1]|[Sensor name2] instead of the parameter.

The value availability check doesn't work with digital input parameters, as well as with the sensors created on their base. For example, the function doesn’t work if in1|in2 is specified in the Parameter field.

If you find a mistake in the text, please select it and press Ctrl+Enter.
Thank you for your feedback!
Report a mistake
Text with the mistake Comment
Maximum 500 characters