-
Notifications
You must be signed in to change notification settings - Fork 1
Home
The sample consists of two main components. The sample page is used to display the logbook and filter options. The task logbook drives the logbook sample and uses the ArEvent library in the background. Refreshing can take some time depending on the number of entries in the PLC logbook. The update command only looks for new entries from the last refresh command. The update process can be speed up with the constant LOGBOOK_EXECUTIONS. A higher number will increase speed but also use more CPU resources. The mappView table widget supports the datatypes date, time and date_time. The data types date_time only provides one second resolution which is not high enough for the logbook where multiple entries can occur in a sub second interval. The timestamp therefore was implemented in the PLC task and is connected as string to the table. Sorting is also handled on the PLC for that reason.
The task uses a variable structure to communicate that can also be used to trigger functions external. The structure gLogbook looks as follows:
Level 1 | Level 2 | Level 3 | Level Description | |||
CMD | Used to trigger commands like refresh, ... A command is triggered by setting it to true, when the command is finished the task will reset the command. This indicates that the command is finished. Do not change any parameters or set another command until the previous command is finished. | |||||
---|---|---|---|---|---|---|
Refresh | Refresh all logbook data | |||||
Update | Update logbook data from last refresh | |||||
Create | Create a new entry in the user logbook | |||||
ErrorReset | Reset error | |||||
PAR | Parameters like filter, sorting, ... | |||||
DateNow | Current date and time | |||||
TableConfig | Used to hide unused rows | |||||
EntriesMax | Max number of entries. This is a copy of LOGBOOK_ENTRIES_MAX | |||||
FilterErrorNo | Filter by error number | |||||
FilterErrorText | Filter by error text | |||||
FilterObjectID | Filter by object ID | |||||
FilterSeverity | Filter by severity | |||||
FilterLogbook | Filter by logbook | |||||
FilterDateStart | Filter by date | |||||
FilterDateEnd | Filter by date | |||||
Sorting | Sort date and time asc or desc | |||||
AbortOnEntriesLimit | Stop searching when entry limit is reached. This will speed up update but also not finish counting additional entries. | |||||
AutoUpdate | Auto update table data | |||||
AutoUpdateInterval | Interval for auto updating table data | |||||
CreateErrorNo | Error number for new entry | |||||
CreateErrorText | Error text for new entry | |||||
CreateSeverity | Severity for new entry | |||||
Createogbook | Logbook name for new entry. Only user created logbooks or the logbook 'user' can be used. | |||||
DAT | Logbook data | |||||
Entries | Entry details as arrays | |||||
EventID | Event ID, also used as error number when no error number is specified | |||||
Timestamp | Timestamp with date and time and miliseconds | |||||
DTsec | Date and time in seconds | |||||
DTmsec | Additional miliseconds | |||||
Severity | Event severity | |||||
Code | Event code | |||||
FacilityCode | Facility code | |||||
LogbookText | Logbook text | |||||
ErrorNo | Error number | |||||
ObjectID | Object ID | |||||
Error text | ||||||
EntriesTotal | Number of entries found | |||||
CntSeverity | Entries counter for severity | |||||
CntLogbook | Entries counter for each logbook | |||||
ERR | Information about errors | |||||
State | State where the error occurred |
The sample can be pre-configured through the following constants located in mappLogbook->LogVariables.var
Constant | Default | Text |
---|---|---|
LOGBOOK_EXECUTIONS | 10 | Number of executions per cycle |
LOGBOOK_ENTRIES_MAX | 100 | Maximum number entries that can be displayed |
LOGBOOK_FACILITIES_MAX | 12 | Maximum number facilities |
LOGBOOK_TEXT_LEN | 100 | Maximum length error text and other strings |
- The sample is not multi client capable
- Fixed desc sorting
- Update to Automation Studio 4.12 and mapp 5.24
- Added object ID (origin)
- New update table command
- New create entry command
- Add max entries to parameter structure
- Show table during run
- Renamed facility to logbook and logbook name
- Fixed special characters not showing up correct
- Fixed filter checkboxes dont remember state
- Fixed last entry is not always record ID 1
- Option to stop searching when entry limit is reached
- Option to abort current update run
- Smaller bug fixes
First public release