Wiki source code of Reference of functions and parameters of the virtual sensor
Last modified by Андрей Калиновский on 2023/04/25 15:23
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | |=Function or reserved parameter|=Description | ||
| 2 | |if(<condition>, <then>, <else>)|if statement. When the condition specified by the logical expression <condition> is met, the <then> operator is executed, otherwise - <else> | ||
| 3 | |time|Date and time (UTC) | ||
| 4 | |t|Time (UTC) in seconds | ||
| 5 | |date|Date (UTC) | ||
| 6 | |cdate(<time>, <time format>)|The function of converting the time of the package recording (the date is converted from a textual representation to a date and time structure type); used when comparing dates and times. The <time format> parameter is case sensitive. Examples. if(date > cdate('2019-01-04', 'yyyy-MM-dd'), 1, 0) if(time > cdate('2019-01-04 05:30:00', 'yyyy-MM -dd HH:mm:ss'), 1, 0) | ||
| 7 | |()|Grouping Operators | ||
| 8 | |*, /, %|Operators for multiplication, division, getting the remainder of a division | ||
| 9 | |+, -|Addition Operators | ||
| 10 | |=, ==, ~!=,|Comparison Operators | ||
| 11 | |&&, and|logical AND | ||
| 12 | |II, or|Logical OR | ||
| 13 | |!, not|Logical NOT | ||
| 14 | |Abs(х)|Returns the absolute value of the number x | ||
| 15 | |Acos(х)|Returns the angle whose cosine is x | ||
| 16 | |Asin(х)|Returns the angle whose sine is x | ||
| 17 | |Atan(х)|Returns the angle whose tangent is x | ||
| 18 | |Ceiling(х)|Round up to whole number | ||
| 19 | |Cos(х)|Returns the cosine of angle x | ||
| 20 | |exp(х)|Returns the number e raised to the x power | ||
| 21 | |Floor(х)|Rounding down to the nearest integer | ||
| 22 | |getbit(x,y)|Returns the y-th bit of x | ||
| 23 | |IEEERemainder(x,y)|Remainder of x divided by y: The number equal to x - (y Q), where Q is the quotient of x / y rounded to the nearest integer (if x / y is equidistant from two integers, an even number is chosen). If x - ( y Q) is zero, +0 is returned if x is positive, or -0 if x is negative. | ||
| 24 | |log(x,y)|Logarithm of number x to base y | ||
| 25 | |Log10(х)|Decimal logarithm of x | ||
| 26 | |max(x,y)|Returns the greater of two specified numbers | ||
| 27 | |min(x,y)|Returns the smaller of two specified numbers | ||
| 28 | |Pow(x,y)|Raising a number x to the power y | ||
| 29 | |Round(x,y)|Rounds the decimal value x to the specified number of decimal places y; values in the middle are rounded up to the nearest even number. | ||
| 30 | |Sign(х)|Returns an integer indicating the sign of the number x | ||
| 31 | |Sin(х)|Returns the sine of angle x | ||
| 32 | |sqrt(х)|Returns the square root of x | ||
| 33 | |Tan(х)|Returns the tangent of x | ||
| 34 | |lat|Returns the latitude value | ||
| 35 | |lon|Returns the longitude value | ||
| 36 | |speed|Returns the value of the "Speed" parameter | ||
| 37 | |sats|((( | ||
| 38 | Returns the number of GPS satellites | ||
| 39 | ))) | ||
| 40 | |glonass|Returns the number of GLONASS satellites | ||
| 41 | |sats+glonass|((( | ||
| 42 | Returns the number of all satellites | ||
| 43 | ))) | ||
| 44 | |prev(option)|Calculates the value of an expression for the previous message in a set | ||
| 45 | |unix(option)|Converts the result of an expression whose type must be a timestamp to Unix time | ||
| 46 | |||
| 47 | === === | ||
| 48 | |||
| 49 | === Bitwise parameter control === | ||
| 50 | |||
| 51 | The GLONASSSoft monitoring platform provides bit-by-bit parameter control, which implies the ability to control not the entire parameter as a whole, but a specific bit. | ||
| 52 | |||
| 53 | This is convenient if the device displays a lot of various data through one parameter: for example, the first bit displays the alarm status (on / off), the second - the driver's door status (open / closed), the third - the state of the headlights, etc. Thus, with the help of bit-by-bit parameter control, it is possible to create several different sensors based on one parameter, for example, with respect to UMK-3xx terminals, it is possible to control the ninth or fifteenth bit of the STATUS parameter (GNSS jamming detector or on/off PTT, respectively). | ||
| 54 | |||
| 55 | To do this, you need to create a virtual sensor with a link in the getbit(x,y) formula, where: x - a link to the sensor from whose parameter you want to get a bit; y - serial number of the desired bit, numbering starts from 0, where 0 is the least significant bit. The result of the function is the value of the bit with the number "y" (0 or 1). | ||
| 56 | |||
| 57 | For example, for UMKa3xx terminals, the STATUS field is displayed in decimal form at the input *A(100), GNSS signal suppression is the ninth bit. | ||
| 58 | |||
| 59 | ~1. Create a virtual sensor with the expression getbit(adc100,9). | ||
| 60 | |||
| 61 | [[image:image-20221007112742-1.jpeg]] | ||
| 62 | |||
| 63 | As a result, we will be able to observe the fact of GNSS jamming. | ||
| 64 | |||
| 65 | |||
| 66 | |||
| 67 | [[image:image-20221007112758-2.jpeg]] | ||
| 68 | |||
| 69 | [[image:image-20221007112813-3.jpeg]] |