Вы находитесь на странице: 1из 10

Black Box and Data Logger 2DB100151

UserManualBlackBoxDat

GmbH Manager aLogger_V1.1.doc

Sonnenbergstrasse 460 User Manual


CH- 5236 Remigen Switzerland
Dept. Project Date Author Approved Revision Page
AMCOS 26.10.2010 Hartmann Klaus Rütten 1.1 1 / 10

Project: Black Box and Data Logger Manager

Subject: User Manual

Platform: AMC
Subsystem: AMCOS

Contents
1 Introduction ..............................................................................................................................2
1.1 Purpose.............................................................................................................................2
1.2 Summary...........................................................................................................................2
2 Developer Manual AMCOS / Application Level .........................................................................2
2.1 Include Functions to the Project ........................................................................................2
2.2 Define Ring Buffer Size .....................................................................................................2
2.3 Monitoring the Ring Buffer Size .........................................................................................3
2.4 Log User Entry ..................................................................................................................4
2.4.1 Log User Entries With Limited Data Size ....................................................................4
2.4.2 Log User Entries With Unlimited Data Size ................................................................5
3 User Manual Level ...................................................................................................................6
3.1 Faults ................................................................................................................................6
3.2 Alarms ...............................................................................................................................6
3.3 The Data Logger Manager User Interface .........................................................................7
4 PC Tool <BlackBox_Upload> ...................................................................................................8
4.1 Installing <BlackBox_Upload> ...........................................................................................8
4.2 Starting <BlackBox_Upload>.............................................................................................8
4.3 <BlackBox_Upload> Command Line Parameters ..............................................................8
4.4 Known limitations ............................................................................................................10

Revision History

Date Revision Author Comment


28.02.10 1.0 Peter Hartmann First version; delivered
26.10.10 1.1 Klaus Rütten Typing error corrections; summary and examples
added

Für dieses Dokument und den darin dargestellten Gegenstand behalten wir uns alle Rechte vor. Vervielfältigung, Bekanntgabe an
Dritte oder Verwendung ausserhalb des vereinbarten Zwecks sind nicht gestattet. Copyright BootUp GmbH.
Black Box and Data Logger 2DB100151
UserManualBlackBoxDat

GmbH Manager aLogger_V1.1.doc

Sonnenbergstrasse 460 User Manual


CH- 5236 Remigen Switzerland
Dept. Project Date Author Approved Revision Page
AMCOS 26.10.2010 Hartmann Klaus Rütten 1.1 2 / 10

1 Introduction

1.1 Purpose
This User Manual is intended to be used from two different groups of users.
One group are the developers of AMCOS and their applications. The other group are the users of
the systems using the AMCOS based platform, e.g. service.

1.2 Summary
The 'AMCOS Black Box' is a kind of flexible logging system, which allows the recording of log
messages to a permanent storage place (dedicated FLASH) on the AMC board. During system
operation the data to be logged is automatically collected, time-stamped, identified and stored. This
chronological journal holds all faults, alarms, events, parameter modifications and system relevant
entries (e.g. software version builds). An open programming interface allows user-defined
(application related) entries to be logged, too. As the on-board storage capacity is limited, the
logged information is stored in a first-in-first-out buffering system. The amount and character of the
logged information to be kept can be configured.
For a log analysis the black box data may be uploaded to a PC. These data may be used post-
mortem by means of examination the journal data and explain, understand and give evidence on
<what happened on the system>. The journalised data may allow a reconstruction of the case to
be analysed.

2 Developer Manual AMCOS / Application Level


This chapter describes information for users compiling new versions of AMC board based software
and using AMCOS on the application level. In the following are all the compiler switch related
configuration settings discussed. The coding of logging user-defined data to the black box is
described, too.

2.1 Include Functions to the Project


The Black Box Logger and Data Logger Manager functions are included to a project with the
following compiler switch settings:

File <TARGET.H>
#define TOPT_LOGGER_FLASH TOPTSEL_AM29F016D
#define TOPT_BLACKBOX_LOGGER TOPTSEL_YES

and file <TARGET.INC>

define TOPT_LOGGER_FLASH 'LOGGER_FLASH_AM29F016D'


define TOPT_BLACKBOX_LOGGER 'YES'
define TOPT_LOGGERDATAMANAGER 'YES'

2.2 Define Ring Buffer Size


Configure the size allocated for the Black Box Logger ring buffer. This buffer is a modulo buffer
using Y memory.

File <BB_LogToRingBuffer.c>
Für dieses Dokument und den darin dargestellten Gegenstand behalten wir uns alle Rechte vor. Vervielfältigung, Bekanntgabe an
Dritte oder Verwendung ausserhalb des vereinbarten Zwecks sind nicht gestattet. Copyright BootUp GmbH.
Black Box and Data Logger 2DB100151
UserManualBlackBoxDat

GmbH Manager aLogger_V1.1.doc

Sonnenbergstrasse 460 User Manual


CH- 5236 Remigen Switzerland
Dept. Project Date Author Approved Revision Page
AMCOS 26.10.2010 Hartmann Klaus Rütten 1.1 3 / 10
/**
size of the ring buffer in Y memory
*/
#define BLACKBOX_RING_BUFFER_SIZE 0x100

#ifndef _MSC_VER
#pragma asm
;---------------------------------------------------------------------------
; Black Box ring buffer
; DEFINITION OF CONSTANTS
;---------------------------------------------------------------------------
global BLACKBOX_RING_BUFFER_SIZE_ASM
BLACKBOX_RING_BUFFER_SIZE_ASM equ $100 ;Max ???
#pragma endasm

Background information:
Black box logger entries created on time levels are first copied to the ring buffer. This happens on
the task level the entries are generated. The ring buffer is overwrite protected. New entries are
written to the ring buffer until there is no more space, in this case these entries are lost. The ring
buffer size is monitored and the inhibited overflows are counted to the monitoring variables.
The ring buffer is emptied from the background task. The ring buffer data is written to the FLASH
memory and the used ring buffer space is freed. Writing to the FLASH memory is a slow process
and when the FLASH has to be maintained (sector delete) every now and then the data could NOT
be consumed and will stay in the ring buffer.

The following events are stored in the black box ring buffer:
Type of black box logger entry used memory locations
- 5 memory locations
-
 Alarm/Fault buffer entries 5 memory locations
- set / set external / reset fault
- set external / clear external alarm
- set / clear alarm
 Event buffer (set/delete) entries 5 memory locations
- register event
 Alarm/Fault status change entries 4 memory locations
 User defined entries 4 + (1..MAX_DATA_SIZE) memory locations

The fault and event buffer sizes are NOT of help to calculate the proper size. The needed ring
buffer size depends on the application and the operational conditions. The question is how
frequent are, worst case, events send to the ring buffer. However, the ring buffer should be big
enough to handle bursts of events sent to the black box logger.

2.3 Monitoring the Ring Buffer Size


It is recommended to make tests under different operational conditions and measure the used ring
buffer size. The implemented ring buffer monitoring could be used for this purpose.

The ring buffer used size is monitored (background task) and the highest value is stored. Maximal
used size of the black box ring buffer, this value has to be monitored during testing new system
configurations.

Für dieses Dokument und den darin dargestellten Gegenstand behalten wir uns alle Rechte vor. Vervielfältigung, Bekanntgabe an
Dritte oder Verwendung ausserhalb des vereinbarten Zwecks sind nicht gestattet. Copyright BootUp GmbH.
Black Box and Data Logger 2DB100151
UserManualBlackBoxDat

GmbH Manager aLogger_V1.1.doc

Sonnenbergstrasse 460 User Manual


CH- 5236 Remigen Switzerland
Dept. Project Date Author Approved Revision Page
AMCOS 26.10.2010 Hartmann Klaus Rütten 1.1 4 / 10
BLACKBOX_RING_BUFFER_SIZE gives the size of the ring buffer in use.
By design monitored size will stay blow BLACKBOX_RING_BUFFER_SIZE, even when ring buffer
is/was full, because the ring buffer is protected against overflows.
But overflows are monitored by BB_u24BlackBoxRingBuffer_OverflowCounter.
Variable is updated by vMonitorRingBufferSize();
called by vBackgroundRingBufferMaintenance();

 Please monitor and collect values for system configurations.

File <BB_LogToRingBuffer.c>
visible unsigned int _Y _u24BlackBoxRingBuffer_MaxUsedSize = 0;

Black box ring buffer overflow counter is incremented for each black box entry NOT written,
because of ring buffer full. The entry sequence number is incremented anyway.

 Please monitor values during operation

File <BB_LogToRingBuffer.c>
unsigned int _Y BB_u24BlackBoxRingBuffer_OverflowCounter = 0;

2.4 Log User Entry


Log user defined entries to the Black Box. The entry is build with the given status word [_00 .. _1F]
and the specified user data block (pointer and size) from the X memory space to be Black Box
logged.
The runtime requirements may be different for the various use cases where logging of user-defined
data is a need. Two different methods are implemented, and may be used. The difference is in how
the data is copied, when the function is called by means of application code.

2.4.1 Log User Entries With Limited Data Size


Log user entries with limited data size function disables interrupts while copying the data. Interrupts
may only be disabled for a certain period of time; this leads to the fact that the amount of data
handled has to be limited. When control is returned, then the user data buffer may be used for
other purpose.
 Please define the maximal number of locations to be copied while interrupts are
disabled.
Note, that the user buffer to be black box logged should fit into the ring buffer.

File <BB_LogToRingBuffer.c>
#define MAX_DATA_SIZE 60

Create black box logger entries and feed them to the ring buffer by calling the wrapper functions:

File <BB_BlackBox.h>
enum E_BB_ErrorCodes BB_eLogUserEntry_LimitedDataSize_00(
unsigned int* ipau24XMemUserData,
unsigned int iu24UserDataSize)

Für dieses Dokument und den darin dargestellten Gegenstand behalten wir uns alle Rechte vor. Vervielfältigung, Bekanntgabe an
Dritte oder Verwendung ausserhalb des vereinbarten Zwecks sind nicht gestattet. Copyright BootUp GmbH.
Black Box and Data Logger 2DB100151
UserManualBlackBoxDat

GmbH Manager aLogger_V1.1.doc

Sonnenbergstrasse 460 User Manual


CH- 5236 Remigen Switzerland
Dept. Project Date Author Approved Revision Page
AMCOS 26.10.2010 Hartmann Klaus Rütten 1.1 5 / 10
enum E_BB_ErrorCodes BB_eLogUserEntry_LimitedDataSize_01(
unsigned int* ipau24XMemUserData,
unsigned int iu24UserDataSize)

continued

enum E_BB_ErrorCodes BB_eLogUserEntry_LimitedDataSize_1F(


unsigned int* ipau24XMemUserData,
unsigned int iu24UserDataSize)

where the following user entry status word in question is used

BB_USER_ENTRY_STATUS_WORD_00
...
BB_USER_ENTRY_STATUS_WORD_1F

2.4.2 Log User Entries With Unlimited Data Size


Unlimited data size may be handled with this function, where interrupts are disabled only for a
short period of time. Restriction is that only one single time instance of the called function may be
active at a time. And by the way, the user date should fit into the ring buffer.

Create black box logger entries and feed them to the ring buffer by calling the wrapper functions:

File <BB_BlackBox.h>
enum E_BB_ErrorCodes BB_eLogUserEntry_UnLimitedDataSize_00(unsigned int*
ipau24XMemUserData, unsigned int iu24UserDataSize)

enum E_BB_ErrorCodes BB_eLogUserEntry_UnLimitedDataSize_01(unsigned int*


ipau24XMemUserData, unsigned int iu24UserDataSize)

continued

enum E_BB_ErrorCodes BB_eLogUserEntry_UnLimitedDataSize_1F(unsigned int*


ipau24XMemUserData, unsigned int iu24UserDataSize)

where the following user entry status word in question is used

BB_USER_ENTRY_STATUS_WORD_00
...
BB_USER_ENTRY_STATUS_WORD_1F

For this function it is possible to log also data from the y-memory. Just set the bit 0x100000
(Y_MEM_BIT) of the address and the function will interpret it as a pointer to the Y memory. E.G.:

(unsigned int *)((unsigned)&MYVAR | Y_MEM_BIT)

Für dieses Dokument und den darin dargestellten Gegenstand behalten wir uns alle Rechte vor. Vervielfältigung, Bekanntgabe an
Dritte oder Verwendung ausserhalb des vereinbarten Zwecks sind nicht gestattet. Copyright BootUp GmbH.
Black Box and Data Logger 2DB100151
UserManualBlackBoxDat

GmbH Manager aLogger_V1.1.doc

Sonnenbergstrasse 460 User Manual


CH- 5236 Remigen Switzerland
Dept. Project Date Author Approved Revision Page
AMCOS 26.10.2010 Hartmann Klaus Rütten 1.1 6 / 10

3 User Manual Level


This chapter gives user information about the black box compiled into an application. Application
specific information can‟t be given here. However, please find here general user information.

3.1 Faults
The black box data archived are checked after booting the device. It is essential that the archived
data structures are valid. In case the archive is found corrupted the user should upload the
archives for later data processing. All further writing to the corrupted archive has to be paused.

So in case the archive is found corrupted, a fault is triggered. The common fault bit and the black
box fault bit 11 in fault word ssw_fault is set. The fault is additionally logged to the fault logger with
the text “Black Box Incons.”.

The user has the possibility to make an UPLOLAD of the flash using the PC Tools. After the upload
or without upload the user will reset the FAULT, and then the flash recovering will take place. While
recovering takes place, corrupted archived data may be erased.

3.2 Alarms
An alarm condition will disable the black box logger and the data logger manager function.

An alarm is triggered at program start,


 if an incorrect flash HW was found
 if flash HW is NOT present
 if the sector configuration is found corrupted.

An alarm is triggered during operation


 if an incorrect flash HW was found
 if flash HW is NOT present
 if the open sector can't be determined
 if a physical sector erase failed
 if the sector configuration is found corrupted
 if the physical flash programming failed.

An alarm condition sets the black box alarm bit 11 in alarm word ssw_alarm and writes the alarm
message ”Black Box Inact.” into the fault logger.

Für dieses Dokument und den darin dargestellten Gegenstand behalten wir uns alle Rechte vor. Vervielfältigung, Bekanntgabe an
Dritte oder Verwendung ausserhalb des vereinbarten Zwecks sind nicht gestattet. Copyright BootUp GmbH.
Black Box and Data Logger 2DB100151
UserManualBlackBoxDat

GmbH Manager aLogger_V1.1.doc

Sonnenbergstrasse 460 User Manual


CH- 5236 Remigen Switzerland
Dept. Project Date Author Approved Revision Page
AMCOS 26.10.2010 Hartmann Klaus Rütten 1.1 7 / 10

3.3 The Data Logger Manager User Interface


Every time the AMC data loggers are triggered (e.g. with a trip) they are automatically copied to the
black box logger flash. Max. 14 data logger trigger events can be stored in the logger flash.

Data Logger Manager user interface handled through AMC Table parameter Group 106:

Index Text Description


10 DL AUTORESTART Auto Restart of DL after trip reset
11 DL1 MAX ARCHIVES DL1 maximal amount of data logger1 archives (stored data
logger sets)
Read only
12 DL2 MAX ARCHIVES DL2 maximal amount of data logger2 archives (stored data
logger sets)
Read only
13 DL1 USED ARCHIVES DL1 actual number of stored data logger1 archives (stored
data logger sets)
Read only
14 DL2 USED ARCHIVES DL2 actual number of stored data logger2 archives (stored
data logger sets)
Read only
15 DL1 RESTORE SEL Restore is only possible, if the data logger is NOT running.
DL1 which archive index to be restored to data logger 1
In restore mode, if != 0, indicating the restored index.
Enter the archive index to be restored. The index number
refers to archive to be restored. Index 1 is the latest; index 2 is
the one before and so on.
If request can‟t be processed 0 is shown.
16 DL2 RESTORE SEL Restore is only possible, if the data logger is NOT running.
DL2 which archive index to be restored to data logger 2
In restore mode, if != 0, indicating the restored index.
Enter the archive index to be restored. The index number
refers to archive to be restored. Index 1 is the latest; index 2 is
the one before and so on.
If request can‟t be processed 0 is shown.
17 DL RESET DL Reset loggers (return from restore mode)
18 DL1 TO FACTORY Reset DL1 to default values
19 DL2 TO FACTORY Reset DL2 to default values

The stored data loggers can be read using the BlackBox upload tool (see next chapter) or by
loading a stored data logger into the normal data logger memory:
 The signals 106.13 and 106.14 show the amount of stored data loggers.
 With parameter 106.15 and 106.16 one can select a data logger to be restored.
Data in the normal data logger memory will be overwritten.
 After restoring it can be displayed using a standard DriveWare tool, DriveWindow or
DriveDebug, by opening the normal data logger 1 or 2 inside the tool.
 Finally the data logger mode needs to be reset with 106.17.

Für dieses Dokument und den darin dargestellten Gegenstand behalten wir uns alle Rechte vor. Vervielfältigung, Bekanntgabe an
Dritte oder Verwendung ausserhalb des vereinbarten Zwecks sind nicht gestattet. Copyright BootUp GmbH.
Black Box and Data Logger 2DB100151
UserManualBlackBoxDat

GmbH Manager aLogger_V1.1.doc

Sonnenbergstrasse 460 User Manual


CH- 5236 Remigen Switzerland
Dept. Project Date Author Approved Revision Page
AMCOS 26.10.2010 Hartmann Klaus Rütten 1.1 8 / 10

4 PC Tool <BlackBox_Upload>
BlackBox_Upload.exeis the PC tool for uploading and maintaining the Black Box and Data Logger
Manager Archives stored on the AMC board.

4.1 Installing <BlackBox_Upload>


No installation needed.

4.2 Starting <BlackBox_Upload>


 Ensure that DriveDebug is installed - on your PC; BlackBox_Upload.exe uses the same DLLs
to communicate with the AMC board.
 Ensure that you have a proper communication with your system.
 Wait at least 1 minute after booting the AMC board.
 Open the DOS box.
 Execute BlackBox_Upload.exe with the command line parameters in question.

4.3 <BlackBox_Upload> Command Line Parameters


Command line: BlackBox_Upload <node> (options) ...

BlackBox_Upload connects to the AMC at <node>.

Options: Description:
/? Shows the command line options
/mbaud= Set link speed (only for PCMCIA and AMC3 CH3)
[default = 1 (no write to control register)
8=8MBaud
4=4MBaud
2=2MBaud
1=1MBaud)]
Faster speed is only possible if drive is not in ReadyRun, i.e. the drive is
either ReadyOn or Tripped.
For faster speeds (2…8) use a point to point connection with PCMCIA
card. The USB adapter RUSB-02 does not support faster speeds.
/channel= Set the DDCS channel of the DDCS hardware.
(0 [default] or 1)
If both, PCMCIA and USB, adapter are installed, PCMCIA is always
channel 0 and USB channel 1.
If only one of them is installed it is always channel 0.
/bb_info Shows the Black Box logger info
Black Box logger enabled state, flash writer description and for each
flash sector the state, ...
/bb_upload_data Uploads the Black Box logger data.
The following files are written:
BBUpload.CSV raw data in comma separated format
BBText.CSV readable text file in comma separated format
BBRecords.CSV comma separated format; one line for each black box
entry.

Für dieses Dokument und den darin dargestellten Gegenstand behalten wir uns alle Rechte vor. Vervielfältigung, Bekanntgabe an
Dritte oder Verwendung ausserhalb des vereinbarten Zwecks sind nicht gestattet. Copyright BootUp GmbH.
Black Box and Data Logger 2DB100151
UserManualBlackBoxDat

GmbH Manager aLogger_V1.1.doc

Sonnenbergstrasse 460 User Manual


CH- 5236 Remigen Switzerland
Dept. Project Date Author Approved Revision Page
AMCOS 26.10.2010 Hartmann Klaus Rütten 1.1 9 / 10
/bb_upload_image Uploads the Black Box logger flash sector image.
The following files are written:
BBUpload.CSV raw data in comma separated format
BBRecText.CSV readable text file in comma separated format
/dl_info Shows the Data Logger Archive info
Data Logger Archive enabled state, archive description and for each
flash sector the state, ...
/dl_upload_data Uploads the Data Logger sector data
The following files are written:
DLMUpload.CSV raw data in comma separated format.

And for each data logger archive two files


DataLogger1_File00.DAT binary format
DataLogger1_File00.TXT text format
..
DataLogger1_File13.DAT binary format
DataLogger1_File13.TXT text format
DataLogger2_File14.DAT binary format
DataLogger2_File14.TXT text format
..
DataLogger2_File27.DAT binary format
DataLogger2_File27.TXT text format
/dl_upload_image Uploads the Data Logger flash sector image
The following files are written:
DLMUpload.CSV raw data in comma separated format.
/erase_flash Erases the complete logger flash.

Each session writes the screen output to the file <BlackBox_Upload.log>.

Examples:

A typical batch file for uploading the logger data from inside the loading package folder looks like:
if not exist .\Uploads\nul md Uploads
cd Uploads
..\Prog\BlackBox_Upload.exe 1 /mbaud=8 /bb_upload_data >nul
cd ..

Hint: Suppressing the output to the screen with „> nul‟ speeds up the uploading process.

For erasing the flash:


@echo Do you really want to erase the logger flash? If not press Ctrl-C!
@pause
if not exist .\Uploads\nul md Uploads
cd Uploads
..\Prog\BlackBox_Upload.exe 1 /mbaud=8 /erase_flash
cd ..

The data and log-file will be stored in the defined folder (e.g. Uploads). The file BBRecords.CSV is
meant to be used for fault analysis. The other 2 CSV-files contain only intermediate and debugging
data.

Für dieses Dokument und den darin dargestellten Gegenstand behalten wir uns alle Rechte vor. Vervielfältigung, Bekanntgabe an
Dritte oder Verwendung ausserhalb des vereinbarten Zwecks sind nicht gestattet. Copyright BootUp GmbH.
Black Box and Data Logger 2DB100151
UserManualBlackBoxDat

GmbH Manager aLogger_V1.1.doc

Sonnenbergstrasse 460 User Manual


CH- 5236 Remigen Switzerland
Dept. Project Date Author Approved Revision Page
AMCOS 26.10.2010 Hartmann Klaus Rütten 1.1 10 / 10

4.4 Known limitations


The BlackBox upload tool has a few known limitations:

 Speed
The upload of a completely full logger flash may take some minutes because the tool has to
load all related fault and parameter texts from the target.
Currently there is no possibility to just upload the latest „x‟ events or all new events since the
last upload.
If such a feature is needed please place your request at the MV Drives support line.

 System buffer
The upload tool uses a system buffer inside the AMC operating system during uploading.
It has to share the buffer with other internal function executions. Therefore it is recommended
to do the upload only when the drive is offline (MCB open).
If the system buffer is reserved by the tool and the tool closes abnormally it is not possible to
release the buffer anymore; one way is to reboot the AMC board.
The fault message is the following:
OS-buffer reservation
***ERROR (503 – Operating system buffer already reserved.) !
After booting it takes at least one minute until the OS buffer is released for use. Please wait
that time before starting the upload tool.

 USB
One limitation of the RUSB-02 DDCS USB-adapter is:
It works smoothly only with a baud rate of 1 or 2 MBaud. Using a higher baud rate makes the
communication unstable and slower.

Für dieses Dokument und den darin dargestellten Gegenstand behalten wir uns alle Rechte vor. Vervielfältigung, Bekanntgabe an
Dritte oder Verwendung ausserhalb des vereinbarten Zwecks sind nicht gestattet. Copyright BootUp GmbH.

Вам также может понравиться