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.
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)
Parameter for determining speed by coordinates
The parameter of a sensor which determines speed by coordinates can be as follows:
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
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:
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:
- Click New.
- Enter the sensor name.
- Select the Custom sensor type.
- 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.
In the calculation table, enable the XY pairs option and configure them as follows:
X Y Explanation
One minute of operation at 500 rpm corresponds to 20 seconds of engine operation, which means that the coefficient is 0.33.
One minute of operation at 1000 rpm corresponds to 40 seconds of engine operation, which means that the coefficient is 0.67.
One minute of operation at 1500 rpm corresponds to 60 seconds of engine operation, which means that the coefficient is 1.
One minute of operation at 2000 rpm corresponds to 90 seconds of engine operation, which means that the coefficient is 1.5.
- Click Generate.
Next, create a sensor of the Relative engine hours type and specify the following parameter for it:
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.
Suppose, 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, for example, 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.