FB_CsvLogger

FB_CsvLogger 1:

Implements the logging of values in a CSV file.

Syntax:

FUNCTION_BLOCK FB_CsvLogger EXTENDS FB_CsvBase

FB_CsvLogger 2: Properties

Name

Type

Access

Initial value

Description

Name

STRING

Get, Set

<SourceName>

Specifies the name of the class instance.

FB_CsvBase

Busy

BOOL

Get

FALSE

The function is currently being executed.

ErrorId

UDINT

Get

FALSE

ADS error code of the error that has occurred.

FileMode

E_FileMode

Get, Set

eModeTextAppend

Mode in which the CSV files are used.

FileName

T_MaxString

Get, Set

‘.csv‘

File name in the Plastic Base Application Standard directory.

NetId

AMSNETID

Get, Set

[0,0,0,0,0,0]

AMS (ADS) network ID.

NetIdString

T_AmsNetID

Get, Set

‘0.0.0.0.0.0‘

AMS (ADS) network ID.

Timeout

LREAL

Get, Set

0.0 [s]

Time-out period of the system response of this function.

FB_Base

BaseState

E_BaseState

Get

eNotHandled

Initialization state of the class instance.

Error

BOOL

Get

FALSE

Class is in an error state.

ResultMessage

I_AppMessage

Get

-

Access to the class-internal EventLogger.

[PROTECTED] _Name

STRING

Get

<SourceName>

.Name without leading 'fb'.

FB_CsvLogger 3: Methods

Name

Description

Reset()

Resets the error state of the class.

FB_CsvLogger

Field(sValue)

Logging of a textual value in ASCII format.

This function can be called in a chain.

Float(fValue, nDecimals)

Logging a floating point value, specifying the decimal places.

This function can be called in a chain.

NewLine()

Logging a line break.

This function can be called in a chain.

Timestamp()

Logging the current system time.

This function can be called in a chain.

WField(sValue)

Logging a textual value in Unicode format.

This function can be called in a chain.

FB_Base

SetHMI(ipBase)

General assignment method for an FB_BaseHmi extending class.

Notice This method always fails in the FB_Base implementation. Overwriting is therefore absolutely necessary.

[PROTECTED] _QueryNamespace()

Extracts the first part of the instance path as an object namespace.

[PROTECTED] _QueryObjectName()

Extracts the last part of the instance path as the object name.

FB_CsvLogger 4: Cycle methods

Name

Description

Cyclic()

Cycle method - 1 time per cycle (default 10 ms).

FB_CsvLogger 5: Procedure controlling methods (FB_AdaptableSequence)

Type

Description

CsvStates()

Procedure for processing CSV commands (extended).

FB_CsvLogger 6: Possible events

ID

Description

Alarm/Message

8001

CSV object is in error state

Alarm

FB_CsvLogger 7: Interfaces

Type

Description

I_Base

Standard interface on FB_Base.

I_CsvLogger

Standard interface on FB_CsvLogger.

I_CsvLoggerCmd

Chaining interface for logging commands.

I_CsvBase

Standard interface on FB_CsvBase.

I_BaseEmpty

For extension without standard interface.

I_BaseDev

Covers all methods and properties of the base class.

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT >= v3.1.4024.54 (recommended)
TwinCAT >= v3.1.4024.42 (required)

PC or CX (x64, x86)

Tc3_PlasticBaseApplication (>= v12.8.1.0)