OSCAT BASIC OtherFunctions - RWTH-EBC/AixOCAT GitHub Wiki
4. Other Functions
4.1. ESR_COLLECT
Type Function module
Input ESR_0 7: ESR_DATA (ESR inputs)
RST: BOOL (asynchronous reset input)
Output ESR_OUT : ESR_DATA (Array with the ESR protocol)
IN/OUT POS: INT ( Position of of latest ESR protocol in the array)
ESR_COLLECT collects ESR data from up to 8 ESR modules and stores the
log in an array. The output POS indicates the position at which in the array
ESR_OUT is currently the last message is ESR. Collects the module more
than 64 messages so the messages are discarded and restarted at positi-
on 0. With the asynchronous reset input, the device can be reset at any
time. By resetting, all the collected data will be deleted and the pointer is
moved to -1. The module collects data in the output array ESR_OUT and
moves POS the last position of the array that contains data. When there
are no messages POS remains to -1. If the output data are read, the varia-
ble POS has to be set to -1, or if only readed a part POS can be set to the
last valid value.
The following example demonstrates how ESR_COLLECT is connected with
ESR modules.
The output ESR_OUT is made up as follows:
.
TYPE
.ADRESS .DS .TS .DATA [07]
1 Label Date TIME Status, 1 Byte ESR Error
2 Label Date TIME Status, 1 Byte ESR Status
3 Label Date TIME Status, 1 Byte ESR Debug
10 Label Date TIME not used Boolean input low transition
11 Label Date TIME not used Boolean input high transi-
tion
20 Label Date TIME Byte 0 - 3 Real Value Real Value change
The ESR data includes the following:
ESR_DATA.TYP Data type, see table above
ESR_DATA.ADRESS up to 10 characters long String Identifer
ESR_DATA.DS Date stamp of type TIME DATA
ESR_DATA.TS Timestamp of type TIME (PLC Timer )
ESR_DATA.DATA up to 8 bytes of data block
4.2. ESR_MON_B8
Type Function module
Input S07: BOOL (signal input)
DT_IN: DATE_TIME (time-date-input stamp for time-stamp)
Output ESR_FLAG: BOOL (TRUE, if ESR data are available)
IN/OUT ESR_OUT: ESR_Data (ESR_data ouput)
Setup A07: STRING(10) (designation of the inputs)
ESR_MON_B8 monitors up to 8 binary signals to change, and provides
them with a timestamp and a name. The collected messages are bufered
and passed to a protocol module on ESR_OUT. The output ESR_FLAG is set
to TRUE when messages are present.
The ESR data at the output consist of the following items:
.TYPE 11 rising edge , 10 falling edge
.ADRESS Byte address of ISR data recording
.LINE Line number (input) of the ESR data recording
.DS Date stamp of type DATE_TIME
.DT Timestamp of type TIME (PLC- Timer )
.Data Data block blank of 8 bytes
An application example for the module is in the description of ESR_COL-
LECT.
4.3. ESR_MON_R4
Type Function module
Input R0 3: REAL (signal input)
DT_IN: DATE_TIME (time-date-input stamp for time-stamp)
Output ESR_FLAG: BOOL (TRUE, if ESR data are available)
IN/OUT ESR_OUT: ESR_Data (ESR_data ouput)
Setup A03: STRING(10) (signal address of the inputs)
A03: STRING(10) (signal address of the inputs)
ESR_MON_R4 monitors up to 4 analog signals for changes and provides
them with a time s stamp and the address of the input signal. The collec-
ted messages are bufered and passed to a protocol module on ESR_OUT.
The output ESR_FLAG is set to TRUE when messages are present. A
change of an input is recorded only when the input has changed more
than the in threshold S predetermined value.
.TYPE 20 Floating point
.ADRESS Byte address of ISR data recording
.LINE Line number (input) of the ESR data recording
.DS Date stamp of type DATE_TIME
.DT Timestamp of type TIME (PLC- Timer )
.Data Data Block 4 byte real value
An application example for the module is in the description of ESR_COL-
LECT.
4.4. ESR_MON_X8
Type Function module
Input S07: Byte ( status Inputs )
DT_IN: DATE_TIME (time-date-time stamp for input)
Mode : Byte (designate the type of processing of messages)
Output ESR_FLAG: BOOL (TRUE when messages are present)
IN/OUT ESR_OUT: array [07] of ESR_DATA (collected messages)
Setup A07: STRING (10) (signal address of the inputs)
ESR_MON_X8 collects status messages of up to 8 ESR compatible modu-
les, provides them with a Timestamp , date stamp , input number and a
module address. The collected messages are bufered and passed to a
protocol module. If messages for transmission are present, this is indica-
ted by the signal ESR_FLAG. At input DT_IN the current time, which is used
for the timestamp of the messages should be provided. The MODE input
determines which status messages should be passed.
● Mode = 1, only error messages are processed.
● Mode = 2, status and error messages are processed.
● Mode = 3, error, status and debug messages are processed.
When the MODE input is not wired, automatically all messages are proces-
sed.
The ESR data at the output consist of the following items:
.TYP 1 = error, 2 = State, 3 = Debug
. ADRESSByte address of ESR data recording .LINE Line number (input) of the ESR data recording .DS Date stamp of type DATE_TIME .DT Timestamp of type TIME (PLC Timer ) .Data Data Byte 0 contains the status message An application example for the module is in the description of ESR_COL- LECT.
4.5. OSCAT_VERSION
Type Function: DWORD
Input IN : BOOL (if TRUE the module provides the release date)
Output (Version of the library)
OSCAT_VERSION iprovides if IN = FALSE the current version number as
DWORD. If IN is set to TRUE then the release date of the current version as
a DWORD is returned.
Example: OSCAT_VERSION(FALSE) = 201 for version 2.60
DWORD_TO_DATE(OSCAT_VERSION (TRUE)) = 2008-1-1
4.6. STATUS_TO_ESR
Type Function: ESR_DATA
Input STATUS : BYTE (status byte)
ADRESS: Byte (address, bytes)
LINE: Byte (input number)
DT_IN: DATE_TIME (time-date-input)
TS: TIME (time for timestamp)
Output ESR_DATA (ESR data block)
STATUS_TO_ESR generates a record from the input values.
A STATUS in the range between 1 99 is an error message and will be mar-
ked as Type 1. Status 100 199 is characterized as type 2 and 200 255
is marked as Type 3 ( Debug I nformation).
The ESR data at the output consist of the following items:
.TYPE 1 = error, 2 = State, 3 = Debug
.ADRESS Byte address of ISR data recording
.LINE Line number (input) of the ESR data recording
.DS Date stamp of type DATE_TIME
.DT Timestamp of type TIME (PLC-timer)
.Data Data block of 8 bytes