MLMotionInit

PLCopen motion icon Pipe Network motion icon

 FunctionClosed A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. - Initializes the motion library.

Inputs

Input

Data Type

Range

Unit

Default

Description

EnableClosed Enable signal for the drive, Hardware-Enable with 24V signal to X8, Software-Enable command by setup Software, fieldbus or permanently set. Both are required for enabling the drive.

BOOL

TRUE, FALSE

N/A

FALSE

Enable function.

BasePeriod

LREAL

Minimum: 125

Microseconds

1000

Duration of one motion cycle.

Outputs

Output

Data Type

Range

Unit

Description

Q

BOOL

TRUE, FALSE

N/A

  • Output is set to high with initial successful execution.
  • It remains high until the function does NOT execute successfully.

Remarks

  • Must be called before any other Motion Library function.
  • Returns TRUE if the function succeeded.

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

//Initialization code to start EtherCAT network.

//First initialize network with MLMotionInit command

//Then wait for command to finish by monitoring MLMotionStatus output

//Once initialized, create any cam profilesClosed The position of a slave axis is mathematically linked to the position of a master axis. Example: A system where two rotating drums turn at a given ratio to each other. A more advanced case of electronic gearing is electronic camming. With electronic camming, a slave axis follows a profile that is a function of the master position. This profile need not be linear but it must be a mathematical function. and PLCopenClosed A vendor -and product- independent worldwide association active in Industrial Control and aiming at standardizing PLC file formats based on XML. or Pipenetwork devices

//Then call MLMotionStart and monitor MLMotionStatus again before beginning rest of programClosed The act of performing a sequence of instructions or commands.

FirstCycle := TRUE;



On FirstCycle DO //Initialize the motion engine

MLMotionInit( 1000);

END_DO;



MotionEngineStatus := MLMotionStatus();//Check the current status of the motion engine

//Once motion engine is initialized, create CAM profiles and defined Axis, then start the motion engine

ON MotionEngineStatus = MLSTATUS_INITIALISED DO

Profiles( MLPR_CREATE_PROFILES );

PLCopen( 0 );

MLMotionStart();

END_DO;



IF MotionEngineStatus = MLSTATUS_RUNNING THEN

bMotionEngineStarted := TRUE;

ELSE

bMotionEngineStarted := FALSE;

END_IF;