Supported platforms: CODESYS 2.3, CODESYS 3.5
This function generates a hash code to given event.
The hash code is used for fast comparison of events' type and status. Sorting in list view is done with the code.
The 16-bit hash code includes log view sorting order:
Bit 7 (2#x000 0000) |
Selection between type and mask |
1 |
Use bits 0..2 as mask bits (m) and bits 4..6 as order (r), for example 2#1rrr 0mmm |
0 |
Use bits 0..2 as type definitions (t), for example 2#0000 0ttt |
Direction
Bit 3 (2#0000 x000) |
Direction |
1 |
Direction is descending |
0 |
Direction is ascending |
Type definition bits (t)
Bits 0..2 (2#0000 0ttt) |
Type definition |
000 |
None |
001 |
Type of event |
010 |
Source of event |
011 |
Currently active events |
Mask bits (0 = not used) (m)
Bits 0..2 (2#1000 0mmm) |
Mask |
001 |
Status |
010 |
Acknowledge |
100 |
Pop-up |
Order bits (r)
Bits 4..6 (2#1rrr 0000) |
First ordering by |
Second ordering by |
Third ordering by |
000 |
Pop-up |
Acknowledge |
Status |
001 |
Pop-up |
Status |
Acknowledge |
010 |
Acknowledge |
Pop-up |
Status |
011 |
Acknowledge |
Status |
Pop-up |
100 |
Status |
Pop-up |
Acknowledge |
101 |
Status |
Acknowledge |
Pop-up |
Examples:
2#0000 1010 Order by event source, descending order
2#1011 0011 Order by mask, status and acknowledge, order: acknowledge-status, ascending order
|
This function is for library's internal use only. |
Input variable name |
Data type |
Range |
Description |
i_FirstSorting |
BYTE |
|
First sorting order of events in list |
i_SecondSorting |
BYTE |
|
Second sorting order of events in list |
i_pEvent |
POINTER TO EL_Event |
|
Event to sort |
Data type |
Range |
Description |
WORD |
|
Generated hash code for event |
-
Source file Topic000735.htm
Last updated 21-Feb-2025