kbLogger 2.0.b1
The automotive ready test and logging program.
FileObject

The FileObject is used to read kbLogger internal messages from or to write it to a file.

In case of used kbLogger file format, every message consists in two lines in the file: the first contains the payload and the second the meta datas.

Example:

Message: 2014.04.08 18:59:02.909: ConfigItem1: PAYLOAD
Metadata: 2014.04.08 18:59:02.909: ConfigItem1: METADATA

In this example, PAYLOAD is the message which can be displayed in a LogViewer. METADATA is the (normally) hidden part of a message which can be used to distinguish between different communication channels of one device. You can read more about this topic in the chapter Messages and Metadata.

The other case is free configurable. With help of regular expressions, the payload, the meta data and the time stamp of the message can be extracted from the file. In this mode, every message consists in a single line.

Creating a FileObject:
Do a right-click on an empty place in the ConfigViewer of your project and choose "New ComObject".

Creating a new ComObject

Configure the ComObject as FileObject:
Double click on the ComObject to open the configure dialog and set the Device Type to File.

ComObject configure dialog



The file

Here you can configure if the file to use.

Configure the used file:
Once you have configured the ComObject to be a FileObject, you can see this dialog:

FileObject configure dialog

File Name:
Here You can type in the name of the file to read from or to write to.

...:
By clicking the ... button, you can choose a file to read from or to write to.

Edit ...:
By clicking the Edit ... button, you can open the configured text editor with the chosen file.



The tab Content

Here you can configure if the used file is an kbLogger log file or an unspecified file and in which way the payload, the meta datas and the time stamp must be read from the file.

File is an kbLogger file:
Set this checkbox to write in kbLogger log file format or to read in the file in this format.

TimeStamp RegExp:
This regular expression defines how to read the time stamp from the file.

[0-9]{4,4}.[0-9]{2,2}.[0-9]{2,2} [0-9]{2,2}:[0-9]{2,2}:[0-9]{2,2}.[0-9]{3,3}
will find time stamps in this form:
2014.04.09 15:38:25.791

Payload RegExp:
Here you can configure how to read the payload from the file. The easiest way to distinguish between the payload and the other parts of the message, is to use delimiter characters.

RegExp: [^;].*[^;]
File:
TimeStamp;PAYLOAD;METADATA
will find the "PAYLOAD" (without ;) in every line of the file.

Metadata RegExp:
Here you can configure how to read the meta datas from the file. The easiest way to distinguish between the payload and the other parts of the message, is to use delimiter characters.

RegExp: [^;].*$
File:
TimeStamp;PAYLOAD;METADATA
will find the "METADATA" (without ;) in every line of the file.

Break RegExp:
Here you can configure an regular expression as break point. The FileObject stops sending when it finds a match within line which contains the next message to send. That means, the affected message is not send. The sending can be continued by clicking on the play button in the toolbar. Since the completely line (or 2 lines in case of an kbLogger log file) is compared against the Break RegExp, it is possible to break at a desired time stamp, payload and meta data contend.



The tab Starting

Here you can configure if the FileObject shall start automatically at simulation start (by clicking the start button, see The Toolbar) and if this shall happen immediately or after a retarding time.

FileObject tab Starting

Autostart at simulation start:
If this check box is checked, the FileObject will start sending messages after the user has clicked on the start button.

Immediately:
If this radio button is set, the FileObject will send the first message right after clicking the start button in the toolbar.

Start Retarding [ms]:
If this radio button is checked, the FileObject will send the first message after the configured time in milli seconds.



The tab Sending

Here you can configure the time between the different messages send by the FileObject.

FileObject tab Sending

Realtime:
If this radio button is checked, the time difference will be taken from the differences of time stamps from the file.

Single Step:
If this radio button is checked, the FileObject will not send automatically. Instead, every click on the related play button in the toolbar will send a message.

Const Time [ms]:
Check this radio button to send the messages with a constant time difference between each other. Possible values are between 0 and 65535 milli seconds.

Time multiplied by [1]:
If this radio button is checked, the time difference will be taken from the file and be multiplied with the configured factor. Possible factors are between 0.0 and 100.0.

Repeat after reaching the end:
If this check box is checked, the FileObject will restart at the start of file automatically. If not, nothing special will happen.