FB_CsvTableGenerator

FB_CsvTableGenerator 1:

Loads a table from a CSV-based file.

Formatting the file:

Drive,Load
0.0,100.0
1.0,110.0
2.0,121.0
3.0,131.0
4.0,142.0
FB_CsvTableGenerator 2:

Formatting variations possible

The formatting of the CSV file can be varied with regard to individual details:

  • A header with column names is optional (not required).
  • For a file with more than two columns, the function block can identify the columns to be used using the header described above.
  • If no Drive column is found (if the CSV file only contains one column), an equidistant distribution of points is assumed. The drive points are distributed between the specified DriveLowEnd and DriveHighEnd.

Syntax:

FUNCTION_BLOCK FB_CsvTableGenerator EXTENDS FB_FileTableGenerator

FB_CsvTableGenerator 3: Properties

Name

Type

Access

Initial value

Description

FilePath

STRING

Get, Set

‘‘

File path on the target system to the stored description file.

FB_FileTableGenerator

DriveHighEnd

LREAL

Get

0.0

Read highest point of the drive side. Can be used in equidistant mode to define the drive points.

DriveLowEnd

LREAL

Get

0.0

Read lowest point of the drive side. Can be used in equidistant mode to define the drive points.

LoadHighEnd

LREAL

Get

0.0

Read highest point of the load side.

LoadLowEnd

LREAL

Get

0.0

Read lowest point of the load side.

Tc3_PlasticFunctions.FB_TrafoTableGenerator

Further characteristics

<>

<>

<>

Implemented by FB_TrafoTableGenerator

FB_CsvTableGenerator 4: Methods

Name

Description

DefineTable()

Starts reading the table from the file. The function runs asynchronously and must be called several times. As soon as the file has been successfully loaded, a TRUE is returned.

FB_FileTableGenerator

Reset()

Resets the started, completed or failed reading mechanism.

FB_CsvTableGenerator 5: Procedure controlling methods (FB_AdaptableSequence)

Type

Description

States()

Procedure for processing the file loading mechanism (extended)

FB_CsvTableGenerator 6: Possible events

ID

Description

Alarm/Message

8002

Table could not be read.

Alarm

FB_CsvTableGenerator 7: Interfaces

Type

Description

I_FileTableGenerator

Standard interface on FB_FileTableGenerator.

I_CsvTableGenerator

Standard interface on FB_CsvTableGenerator.

Further interfaces

Implemented by FB_TrafoTableGenerator.

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)