MC_AxUtiStandardInit_BkPlcMc (from V3.0)

MC_AxUtiStandardInit_BkPlcMc (from V3.0) 1:

The function block handles the initialization and monitoring of axis components.

MC_AxUtiStandardInit_BkPlcMc (from V3.0) 2: Inputs

VAR_INPUT
    AxisName:           STRING(255);
    PathName:           STRING(255);
    pDeviceInput:       POINTER TO ST_TcPlcDeviceInput:=0;
    pDeviceOutput:      POINTER TO ST_TcPlcDeviceOutput:=0;
    pLogBuffer:         POINTER TO ST_TcPlcMcLogBuffer:=0;
    pStAxAuxLabels:     POINTER TO ST_TcMcAuxDataLabels:=0;
    pStAxAutoParams:    POINTER TO ST_TcMcAutoIdent;
    pStAxCommandBuf:    POINTER TO ST_TcPlcCmdBuffer_BkPlcMc:=0;    (* ab/from V3.0.8 *)
    nLogLevel:          DINT:=0;
END_VAR

Name

Type

Description

AxisName

STRING

Here, the text-based name of the axis (example: 'Axis_1') should be transferred.

PathName

STRING

Here, the text-based path name (example: 'C:\TwinCAT\Project\'), under which the axis parameters are to be saved, should be transferred.

pDeviceInput

POINTER

This parameter is used to transfer the address of a variable of type ST_TcPlcDeviceInput.

pDeviceOutput

POINTER

This parameter is used to transfer the address of a variable of type ST_TcPlcDeviceOutput.

pLogBuffer

POINTER

Here, the address of a variable of type ST_TcPlcMcLogBuffer can be transferred.

pStAxAuxLabels

POINTER 

Here, the address of an ST_TcMcAuxDataLabels structure with label texts for customer-specific axis parameters can be transferred.

pStAxAutoParams

POINTER 

Here, the address of a variable of type ST_TcMcAutoIdent can be transferred.

pStAxCommandBuf

POINTER

From V3.0.8 the input BufferMode defined by the PLCopen is available for various function blocks. The functionality that can be controlled with this is currently in preparation. In this context this command buffer was amended.

The input pStAxCommandBuf must currently not be supplied, or only with the value 0.

nLogLevel

DINT

Here, a coded value should be transferred, which specifies the threshold value for recording of messages.

MC_AxUtiStandardInit_BkPlcMc (from V3.0) 3: Inputs/outputs

VAR_OUTPUT
    Busy:       BOOL;
    Done:       BOOL;
    Ready:      BOOL;
    Error:      BOOL;
    ErrorID:    UDINT;
END_VAR

Name

Type

Description

Busy

BOOL

 

Done

BOOL

 

Ready

BOOL

 

Error

BOOL

The occurrence of an error is indicated here.

ErrorID

UDINT

An encoded indication of the cause of the error is provided here.

MC_AxUtiStandardInit_BkPlcMc (from V3.0) 4: 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.

Behavior of the function block

With each call the function block examines the transferred axis interface and the transferred pointers. If a change is detected, the function block indicates in the transferred Axis_Ref_BkPlcMc structure that the axis has to be reinitialized. The MC_AxParamLoad_BkPlcMc function block used by the function block will now automatically load the axis parameters from the file. If pAuxLabels is supplied, an MC_AxParamAuxLabelsLoad_BkPlcMc function block is then used to load the label texts for the customer-specific axis parameters.

MC_AxUtiStandardInit_BkPlcMc (from V3.0) 5:

The strings transferred as AxisName and PathName must not contain spaces or special characters, which would make them unsuitable for generating a file name. The file name is generated by concatenating the transferred strings and adding the extension '.dat'. The file name for the label texts of the customer-specific axis parameter is generated in the same way, but with the extension '.txt'.

MC_AxUtiStandardInit_BkPlcMc (from V3.0) 6:

The parameters pDeviceInput and pDeviceOutput should be supplied for all axes, which use an I/O hardware for position detection. If virtual axes are used, these parameters should not be assigned or assigned 0.

MC_AxUtiStandardInit_BkPlcMc (from V3.0) 7:

The input pStAxCommandBuf must currently not be supplied, or only with the value 0.