MC_WriteNcIoOutput

MC_WriteNcIoOutput 1:

The MC_WriteNcIoOutput function block can be used to write to unused IO outputs of the axis.

MC_WriteNcIoOutput 2: Inputs

VAR_INPUT
    Execute           : BOOL;
    Device            : E_NcIoDevice := E_NcIoDevice.NcIoDeviceDrive;
    NcIoOutput        : E_NcIoOutput := E_NcIoOutput.NcIoOutputnCtrl1;
    BitSelectMask     : UDINT := 16#0;
    BitValues         : UDINT;
END_VAR

Name

Type

Description

Execute

BOOL

The command is executed with a rising edge.

Device

E_NcIoDevice

Selection of the Nc axis component whose IO object is to be modified (encoder or drive)

NcIoOutput

E_NcIoOutput

Selection of the subobject whose value is to be modified (e.g. nCtrl1)

BitSelectMask

UDINT

Mask for selecting which bits are to be modified

BitValues

UDINT

Values of the corresponding bits to be modified

MC_WriteNcIoOutput 3: Inputs/outputs

VAR_IN_OUT
    Axis : AXIS_REF;
END_VAR

Name

Type

Description

Axis

AXIS_REF

Axis data structure that unambiguously addresses an axis in the system. Among other parameters it contains the current axis status, including position, velocity or error state.

MC_WriteNcIoOutput 4: Outputs

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

Name

Type

Description

Done

BOOL

TRUE if the command was executed without errors.

Busy

BOOL

TRUE as soon as the command is started with Execute and as long as the command is processed. If "Busy" is FALSE, the function block is ready for a new order.

Error

BOOL

TRUE, if an error occurs.

ErrorID

UDINT

If the error output is set, this parameter supplies the error number.

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4024

PC or CX (x86)

Tc2_MC2