MLMotionStatus

PLCopen motion icon Pipe Network motion icon

 Function - Returns the status of the motion engine 0 (zero).

Inputs

Input

Data Type

Range

Unit

Default

Description

En

BOOL

FALSE, TRUE

N/A

No default

Enable function.

Outputs

Output

Data Type

Range

Unit

Description

OK

BOOL

FALSE, TRUE

N/A

  • Indicates the initialization is complete.
  • See Function - General Rules.

Status

DINT

0, 3

N/A

Status of the Motion Engine.

Based on the Internal Defines, the status is one of these:

  • #define MLSTATUS_NOT_INITIALISED 0 (*Motion not initialized*)
  • #define MLSTATUS_RUNNING 1 (*Motion is running*)
  • #define MLSTATUS_STOPPED 2 (*Motion is stopped*)
  • #define MLSTATUS_ERROR 3 (*Motion is in error*)

Remarks

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 profiles and PLCopen or Pipenetwork devices
//Then call MLMotionStart and monitor MLMotionStatus again before beginning rest of program

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;

See Also