MC_CreatePLCAxis

PLCopen motion icon

 Function - Creates a PLCopen Axis.

Inputs

Input

Data Type

Range

Unit

Default

Description

En

BOOL

FALSE, TRUE

N/A

No default

When TRUE, requests to create a PLCopen axis.

AxisName

STRING

No range

N/A

No default

Axis name.

BusInterface

STRING

No range

N/A

No default

Bus interface identifier:

  • EtherCATDriver = EtherCAT interface.
  • MSBusDriver = KAS Simulator interface.

BusAddress

DINT

Bus dependent

N/A

No default

Address of the drive on the bus.

AxisNumber

UINT

1 to 256

N/A

No default

Axis number.

AxisType

USINT

Enumerated

N/A

No default

One of these enumeration values:

USINT

Type

Description

0

MC_AXIS_TYPE_SERVO_STEPPER

A Servo or Stepper axis can be mapped to a physical or simulated drive.

Either a servo or stepper drive is supported.

1

MC_AXIS_TYPE_DIGITIZING

A digital position input from a drive or other device.

It is useful as an input for gearing, camming, etc.

2

MC_AXIS_TYPE_VIRTUAL

A virtual axis cannot be mapped to a physical or simulated drive.

It is useful for generating motion trajectory as an input for gearing, camming, etc.

DriveAxisNumber

UINT

1 to 256

N/A

No default

This one-based number specifies the axis on the drive.

For a single-axis drive this number should be 1.

UserUnits

DINT

1 to 2147483647

User units

No default

User unit portion of the user unit/feedback unit ratio.

FeedbackUnits

DINT

1 to 2147483647

Feedback units

No default

Feedback unit portion of the user unit/feedback unit ratio.

Rollover

LREAL

0 to 4294967296

User units

No default

Rollover position.

0 (zero) = no rollover.

UpdateRate

UINT

3 to 9

N/A

No default

Servo update rate.

  • 0, 1, and 2 are reserved.
  • 3 = 125 μsec
  • 4 = 250 μsec
  • 5 = 500 μsec
  • 6 = 1 msec
  • 7 = 2 msec
  • 8 = 4 msec
  • 9 = 8 msec

Outputs

Output

Data Type

Range

Unit

Description

OK

BOOL

FALSE, TRUE

N/A

Indicates the axis has been created.

Figure 1: MC_CreatePLCAxis

Remarks

  • See Function Blocks - General Rules about how inputs and outputs work.
  • A call to this function is automatically generated when the application is compiled, based on the data entered in the PLCopen Axis Data dialog.
  • MC_CreateAxis must be called between MLMotionInit and MLMotionStart.

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

(* MC_CreatePLCAxis ST Example *)
AxisName1    := 'PLCOpenAxis1';
BusName1     := 'EtherCATDriver';
BusAddress1    := 1001;
AxisNumber1    := 1;
AxisType1     := MC_AXIS_TYPE_SERVO_STEPPER;
DriveAxisNumber1  := 1;
UserUnits1    := 360;
FeedbackUnits1    := 1048576;
Rollover1    := 0;
UpdateRate1     := 3;
MC_CreateAxis(AxisName1, BusName1, BusAddress1, AxisNumber1, AxisType1, DriveAxisNumber1, UserUnits1, FeedbackUnits1, Rollover1, UpdateRate1);