MC_LinTableImportFromBinFile_BkPlcMc
The function block imports a linearization table from a file in binary format.
Inputs
VAR_INPUT
Execute: BOOL:=FALSE;
FileName: STRING(255):=’’;
END_VAR
Name | Type | Description |
---|---|---|
Execute | BOOL | A rising edge initiates the import. |
FileName | STRING |
|
Inputs/outputs
VAR_INOUT
Axis: Axis_Ref_BkPlcMc;
END_VAR
Name | Type | Description |
---|---|---|
Axis | Axis_Ref_BkPlcMc | Here, the address of a variable of type Axis_Ref_BkPlcMc should be transferred. |
Outputs
VAR_OUTPUT
Busy: BOOL;
Done: BOOL;
Error: BOOL;
ErrorID: UDINT;
LastIdx: INT:=0;
END_VAR
Name | Type | Description |
---|---|---|
Busy | BOOL | Indicates that a command is being processed. |
Done | BOOL | This indicates successful identification. |
Error | BOOL | The occurrence of an error is indicated here. |
ErrorID | UDINT | An encoded indication of the cause of the error is provided here. |
LastIdx | INT |
|
Behavior of the function block
The function block reads the contents of the file and interprets it line by line according to the following rules:
- Each two values are regarded as a pair of numbers.
- Each pair of numbers is entered as a point in the linearization table of the axis. LastIdx is thereby incremented. After a successful import, the number of table points read is available here.
Manipulation of the file
The binary format makes it practically impossible to manipulate such a file with a simple editor. This is possible with an appropriate program, but absolutely not recommended. The expected structure of the file is hardly visible and it is practically impossible to maintain the formatting. Even with the correct formatting, however, it will hardly be possible to create a usable linearization table. The correct function of the system will not be possible. In addition, persons may be endangered and the products or plant may be damaged.