Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
cms:units:sensors:param [25/06/2018 10:16]
tagr [Converstion of Parameters]
cms:units:sensors:param [24/09/2018 12:12] (current)
tagr
Line 2: Line 2:
 ====== Sensor Parameter ====== ====== Sensor Parameter ======
  
-Parameter is a required [[props|sensor property]]. Most of sensors are based on a parameter coming in messages. ​+Parameter is a required [[props|sensor property]]. Most of the sensors are based on a parameter coming in messages. ​
  
 Parameters can be of any names. These names are predefined in the [[https://​gurtam.com/​en/​gps-hardware/​auto|device configuration]],​ for example, //param199, param240, TEMP, pwr_int, gsm, can6//, and the like. Read device specification to find out which parameters are available and what they measure. In the //​[[user/​msg/​msg|Messages]]//​ panel you can also request messages from the unit and view the available parameters in the corresponding column. ​ Parameters can be of any names. These names are predefined in the [[https://​gurtam.com/​en/​gps-hardware/​auto|device configuration]],​ for example, //param199, param240, TEMP, pwr_int, gsm, can6//, and the like. Read device specification to find out which parameters are available and what they measure. In the //​[[user/​msg/​msg|Messages]]//​ panel you can also request messages from the unit and view the available parameters in the corresponding column. ​
Line 15: Line 15:
  
 ^**speed**| speed of motion| ^**speed**| speed of motion|
-^**altitude**| altitude above sea level (may be not supported by some devices)|+^**altitude**| altitude above sea level (maybe not supported by some devices)|
 ^**sats**| satellites count| ^**sats**| satellites count|
 ^**course**| course (direction of motion)| ^**course**| course (direction of motion)|
Line 37: Line 37:
 Usually, the data from digital inputs and outputs are presented in messages in the following format: I/O = 0/0, where I refers to inputs, O — outputs. If I/O = 0/0, it means all bits (inputs and outputs) are inactive. If a value in any of them is not zero, it means that one input/​output or several of them are active. To define which exactly, hexadecimal number (which you see in a message) should be converted into a bit number. ​ Usually, the data from digital inputs and outputs are presented in messages in the following format: I/O = 0/0, where I refers to inputs, O — outputs. If I/O = 0/0, it means all bits (inputs and outputs) are inactive. If a value in any of them is not zero, it means that one input/​output or several of them are active. To define which exactly, hexadecimal number (which you see in a message) should be converted into a bit number. ​
  
-For instance, when ignition was activated, we received the message with the parameter I/O = 10/0. To get the bit number (input) in which the value of the sensor is shown, it is necessary to enter the received value in the calculator in the mode of hexadecimal values (HEX). That is, enter 10 and switch to the binary mode (BIN). We get a new number - 10000. Now we have to calculate in which position 1 has appeared. The calculation is done from right to left. In the given case 1 is in position 5, i.e. the ignition sensor is connected to the fifth port. Since the changed number is before the fraction (I/O), it is the input. Consequently,​ the parameter name is in5 (digital input 5).+For instance, when the ignition was activated, we received the message with the parameter I/O = 10/0. To get the bit number (input) in which the value of the sensor is shown, it is necessary to enter the received value in the calculator in the mode of hexadecimal values (HEX). That is, enter 10 and switch to the binary mode (BIN). We get a new number - 10000. Now we have to calculate in which position 1 has appeared. The calculation is done from right to left. In the given case 1 is in position 5, i.e. the ignition sensor is connected to the fifth port. Since the changed number is before the fraction (I/O), it is the input. Consequently,​ the parameter name is in5 (digital input 5).
  
 For a sensor, it is also possible to specify the parameter name as //in// or //out// to indicate the sum of all inputs and outputs, respectively. For a sensor, it is also possible to specify the parameter name as //in// or //out// to indicate the sum of all inputs and outputs, respectively.
Line 89: Line 89:
  
 //​Explanation://​\\ //​Explanation://​\\
-The traditional formula to calculate the speed of movement is '​distance divided by time'. To calculate the distance, we apply Pythagorean theorem: squared difference of latitudes in neighboring messages plus squared difference of longitudes in neighboring messages, and then the square root is extracted from this sum. So, we get the distance (in degrees). This value is divided by the difference of time in two neighboring messages. As the result, we have the distance in degrees per second. To convert this to the more habitual kilometers per hour (or miles per hour), we apply a special coefficient. It varies depending on geographical position. In the example above it is equal to 200000 and applicable to Moscow. ​+The traditional formula to calculate the speed of the movement is '​distance divided by time'. To calculate the distance, we apply the Pythagorean theorem: squared difference of latitudes in neighboring messages plus the squared difference of longitudes in neighboring messages, and then the square root is extracted from this sum. So, we get the distance (in degrees). This value is divided by the difference of time in two neighboring messages. As the result, we have the distance in degrees per second. To convert this to the more habitual kilometers per hour (or miles per hour), we apply a special coefficient. It varies depending on geographical position. In the example above it is equal to 200000 and applicable to Moscow. ​
  
 If you have the ignition sensor, the parameter can be set in the following way:  If you have the ignition sensor, the parameter can be set in the following way: 
Line 109: Line 109:
 </​code>​ </​code>​
  
-That is, time difference in neighboring messages multiplied by the coefficient of intensity of work and divided by 3600. The division by 3600 is applied to convert seconds into hours. ​+That is, time difference in neighboring messages multiplied by the coefficient of the intensity of work and divided by 3600. The division by 3600 is applied to convert seconds into hours. ​
  
 Then, create the coefficient sensor that will define the intensity of work depending on engine revolutions. Dependency scheme can be the following: ​ Then, create the coefficient sensor that will define the intensity of work depending on engine revolutions. Dependency scheme can be the following: ​
  
-  * 1 minute work with intensity of 2000 rpm correspond ​to 90 seconds of engine work => coefficient 1.5 +  * 1 minute work with the intensity of 2000 rpm corresponds ​to 90 seconds of engine work => coefficient 1.5 
-  * 1 minute work with intensity of 1500 rpm correspond ​to 60 seconds of engine work => coefficient 1 +  * 1 minute work with the intensity of 1500 rpm corresponds ​to 60 seconds of engine work => coefficient 1 
-  * 1 minute work with intensity of 1000 rpm correspond ​to 40 seconds of engine work  => coefficient 0.67 +  * 1 minute work with the intensity of 1000 rpm corresponds ​to 40 seconds of engine work  => coefficient 0.67 
-  * 1 minute work with intensity of 500 rpm correspond ​to 20 seconds of engine work  => coefficient 0.33+  * 1 minute work with the intensity of 500 rpm corresponds ​to 20 seconds of engine work  => coefficient 0.33
  
 Suppose, the //param1// sends engine revolutions. Then the coefficient parameter is the following: ​ Suppose, the //param1// sends engine revolutions. Then the coefficient parameter is the following: ​
Line 124: Line 124:
 </​code>​ </​code>​
  
-That isthe arithmetic average of engine revolutions between neighboring messages. ​+That is the arithmetic average of engine revolutions between neighboring messages. ​
  
 To convert revolutions into coefficient,​ adjust the calculation table for this sensor: ​ To convert revolutions into coefficient,​ adjust the calculation table for this sensor: ​
Line 137: Line 137:
 ==== Example 3: Value Availability Check ==== ==== Example 3: Value Availability Check ====
  
-There is equipment installed on the vehicle, ​wchich ​sends some parameter (for example, in1). Then the equipment gets out of order. A new one is installed. The new equipment sends the same data in another parameter (for example, in2). To exclude data loss during report generation, it is necessary to use value availability check in the //​Parameter//​ field upon creating a sensor. The old equipment worked all December, the new one — all January, and we need a report for these two months. If the value availability check is used during the parameter indication (//​in1|in2//​ entered as sensor parameter), then the system takes a value from the //in1// parameter, and if the //in1// value is invalid (for example, the equipment is broken), then the system takes a value from the //in2// parameter. In other words, when using the value availability check, the system takes into account the first valid value of the parameter received.+There is equipment installed on the vehicle, ​which sends some parameter (for example, in1). Then the equipment gets out of order. A new one is installed. The new equipment sends the same data in another parameter (for example, in2). To exclude data loss during report generation, it is necessary to use value availability check in the //​Parameter//​ field upon creating a sensor. The old equipment worked all December, the new one — all January, and we need a report for these two months. If the value availability check is used during the parameter indication (//​in1|in2//​ entered as sensor parameter), then the system takes a value from the //in1// parameter, and if the //in1// value is invalid (for example, the equipment is broken), then the system takes a value from the //in2// parameter. In other words, when using the value availability check, the system takes into account the first valid value of the parameter received.
  
 ====== Textual Parameters ====== ====== Textual Parameters ======
  
-Most parameters are designed to send numeric data, however, in some cases they may provide textual data. This can be, for example, a name of a status (business/​private),​ some state (free/​waiting/​busy,​ on/off), time passed since a certain event, etc. +Most parameters are designed to send numeric data, however, in some casesthey may provide textual data. This can be, for example, a name of a status (business/​private),​ some state (free/​waiting/​busy,​ on/off), time passed since a certain event, etc. 
  
 Sensors with textual parameters do not require configuration of calculation tables. Textual data is displayed as it is. However, the application of text-based sensors is limited — their values can be shown only in [[user/​monitor/​monitor#​additional_information_about_the_unit|additional information about the unit]], in [[user/​msg/​data|messages panel]], in [[user/​tools/​player|track player]], and in [[user/​tools/​hittest|track hittest]]. Sensors with textual parameters do not require configuration of calculation tables. Textual data is displayed as it is. However, the application of text-based sensors is limited — their values can be shown only in [[user/​monitor/​monitor#​additional_information_about_the_unit|additional information about the unit]], in [[user/​msg/​data|messages panel]], in [[user/​tools/​player|track player]], and in [[user/​tools/​hittest|track hittest]].
  
-===== Converstion ​of Parameters =====+===== Conversion ​of Parameters =====
  
 The conversion of parameters can only be applied to the parameters that are received directly from the hardware. The cases of application are described below. The conversion of parameters can only be applied to the parameters that are received directly from the hardware. The cases of application are described below.
Line 168: Line 168:
 **Conversion of textual parameters** **Conversion of textual parameters**
  
-If there is a textual parameter in the sensor formula, it is converted into 64-bit integer. By default, it is interpreted as decimal, however, positional notation can be specified after colon. For example, there is a parameter called //​text_param//​ and it has the value //100//, then:  ​+If there is a textual parameter in the sensor formula, it is converted into 53-bit integer. By default, it is interpreted as decimal, however, positional notation can be specified after colon. For example, there is a parameter called //​text_param//​ and it has the value //100//, then:  ​
  
 <​code>​ <​code>​
Line 184: Line 184:
 time:d = 87 time:d = 87
 </​code>​ </​code>​
- 
- 
Follow us on Facebook Gurtam Wialon Twitter Gurtam Wialon info@gurtam.com   |   Copyright © 2002-2018 Gurtam