MLProfileRelease

PLCopen motion icon Pipe Network motion icon

 Function - Removes a Profile so the ProfileID can be used by a different or new Profile.

Inputs

Input

Data Type

Range

Unit

Default

Description

Enable

BOOL

FALSE, TRUE

N/A

No default

Enables execution.

  • Successful completion results in a profile ID no longer assigned to a specific profile and can be reused for a different/new Profile.
  • Prior to reusing this Profile ID, it must be re-initialized by either an MLProfileInit function call or by calling MLProfileBuild.

ProfileID

DINT

1 to 256

N/A

No default

Specify a Profile ID that has been created by MLProfileCreate.

  • This is the profile ID released so it can be reused for a different or new Profile.
  • This Profile ID must not be in use by a motion engine.

Outputs

Output

Data Type

Range

Unit

Description

Done

BOOL

FALSE, TRUE

N/A

If high, Successful completion.

The Profile can now be reused.

Err

BOOL

FALSE, TRUE

N/A

If high, the function block did not complete successfully.

Reason is given in ErrorID.

ErrorID

INT

No range

N/A

Indicates the reason for the failure.

See the Error Codes table.

Remarks

  • See Function - General Rules.
  • An application program is limited to 256 ProfileIDs.
  • Once the existing ProfileID definition has been successfully released, the ProfileID can be used by either MLProfileInit or MLProfileBuild to create a new Profile.
  • The ProfileID selected by the input parameter must not be in-use by a motion engine.

In-use Definitions

  • Pipe Network – Must not be currently selected for use by an active CAM block in an active pipe.
  • PLCopen – Selected for use by MC_CamIn and has an active move.

There are a number of ways to change an in-use profile to one that is not in-use (deactivated):

  • Pipe Network – Perform a MLCamSwitch on an active Pipe to a different Profile or deactivate the pipe.
  • PLCopen – Whenever the active profile move is halted or aborted, the profile is no longer in use.
    • MC_CamOut is one way of aborting the profile move.
    • Any PLCopen motion command that aborts a profile move deactivates a profile.

  • Any profile ID created by MC_CamTblSelect from the specified ProfileID is destroyed and must be recreated when this FB is completed.
    All derived profile ID’s created by the MC_CamTblSelect FB must not be in use by the PLCopen motion engine for this function to succeed.


  • Loading a Profile Editor-generated profile into a ProfileID released by MLProfileRelease should be done with care.
    The MLProfileInit () function call can take in excess of 4 milliseconds to execute.
    Application execution is suspended during this time until the function call is completed.

Error Codes

ErrorID

Description

106

Invalid ProfileID.

This can occur if the ProfileID:

  • Does not exist.
  • Has not been created yet.
  • The ProfileID is not a profile.

108

Profile cannot be released because it is in use by the motion engine or currently selected by an active CAM block.

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

//Release a Cam Profile
Inst_MLProfileRelease( Profile_A , 'Profile_A.5op');

If Inst_MLProfileRelease.Done THEN
// Do Something
ELSIF Inst_MLProfileRelease.Err THEN
// Handle Error
END_IF;

See Also