FunctionMLProfileReleasePLCopen motion iconPipe Network motion icon

An application program is limited to 256 Profile ID’s. This FB releases an existing profile ID definition so that the profile ID can be used for a different/new Profile (minimizing the risk of reaching 256 Profile ID’s). Once the existing Profile ID definition has been successfully released, the Profile ID can then be used by either MLProfileInit or MLProfileBuild to create a new Profile.

The Profile ID selected by the input parameter must not be in-use by a motion engine. In-use is defined as:

  • For Pipe Network – it must not be currently selected for use by an active CAM block in an active pipe. Pipe has been activated by MLCamSwitch.
  • For 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 (deactived):


  • Any profile ID created by MC_CamTblSelect from the specified ProfileID will be destroyed and need to be recreated upon completion of this FB. This means that all derived profile ID’s created by MC_CamTblSelect FB must also not be in use by the PLCopen motion engine in order 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.

Arguments

For more information on how Arguments work, refer to PLCopen Function Blocks - General Rules.

Input

Enable Description Enable execution of the function block. Successful completion will result in a profile ID that is no longer assigned to a specific profile and can be reused for a different/new Profile. Prior to reusing this Profile ID it will need to be re-initialized by either an MLProfileInit Function call or by calling MLProfileBuild.
Data Type BOOL
Range 0, 1
Unit  
Default 0
ProfileID Description Specify a Profile ID that has been created by MLProfileCreate. This is the profile ID that will be released so it can be reused for different/new Profiles. This Profile ID must not be in use by a motion engine.
Data Type DINT
Range 1 to 256
Unit  
Default 0

Output

Done Description If high, Successful completion. The Profile can now be reused.
Data Type BOOL
Range 0, 1
Err Description If high, the Function Block did not complete successfully. Reason is given in Error ID.
Data Type BOOL
Range 0, 1
ErrorID Description Indicates the reason for the failure. See Error Codes table for possible reasons.
Data Type INT
Range  

Error Codes

ErrorID Description
106

Invalid profile ID. Profile ID:

  1. does not exist
  2. has not been created yet
  3. profile ID 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.

Related Functions

MLProfileCreate

MLProfileInit

MLProfileBuild

MLCamInit

MC_CamTblSelect

MC_CamIn

MC_CamOut

Example

Structured Text

//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;

Ladder Diagram

Function Block Diagram

Go back to the top of the page [Top]