MLProfileBuild

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. - Creates a CAM ProfileClosed 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. from application data that can be executed by a CAM block in Pipe Network or PLCopenClosed A vendor -and product- independent worldwide association active in Industrial Control and aiming at standardizing PLC file formats based on XML..

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

No range

N/A

No default

Enables execution.

Starts on the rising edgeClosed The transition of a digital signal from low to high. AKA: positive edge..

Cam_Props

CamProps_ref

No range

N/A

No default

Structures containing the CAM Profile properties.

Cam_Data

CamData_ref

N=3 to 20,000 elements

N/A

3 elements minimum size

Array of structures containing the CAM Profile data.

CamDataCount

UINT

3 - 20,000

Elements

3

Number of elements in the Cam_Data array to be used.

ProfileID

DINT

-2147483648 to 2147483647

N/A

No default

ID number of an initialized CAM Profile.

Cyclic

BOOL

0, 1

TRUE, FALSE

N/A

No default

  • FALSE: One time through the profile.
  • TRUE: Repeating profile.

Options

UINT

  • CAM_PROFILE_OPTION_DEFAULT: Allows the use of point and line segments.
  • CAM_PROFILE_OPTION_PARABOLIC: Allows the use of line and parabolic segments.

  • The DEFAULT and PARABOLIC options cannot be combined.
    A CAM Profile can only use point and line segments, or parabolic and line segments.
    Point and parabolic segments cannot both be used in the same profile.

N/A

No default

Describes the combinations of segments that can be used to build a cam profile.

Outputs

Output

Data Type

Range

Unit

Description

Done

BOOL

0, 1

TRUE, FALSE

N/A

Indication of whether or not the profile was successfully compiled and built.

Busy

BOOL

0, 1

TRUE, FALSE

N/A

Indication that the function blockClosed A function block groups an algorithm and a set of private data. It has inputs and outputs. is executing.

  • TRUE if executing.
  • FALSE if not executing.

Err

BOOL

0, 1

TRUE, FALSE

N/A

Indication that the function did not execute correctly.

ErrorID output is valid and indicate the reason.

ErrorID

INT

No range

N/A

Indicates the reason for the failure.

See the Error Codes table.

ErrorElem

UINT

No range

N/A

The array element number of the CAM data where an error is detected.

Remarks

MLProfileBuild internally performs two functions:

  1. Compile the CAM data (like the cam editor performs in the IDE).
  2. Puts the compiled profile into the profile object so it can be used by other Profile Function Blocks.
    Provides similar functionality to MLProfileInit.

  • Prior to using MLProfileBuild, you must call MLProfileCreate to create the profile object.
    The ID output of MLProfileCreate is used as the ProfileID input to MLProfileBuild.
    MLProfileCreate must be performed in the application before the MLMotionStart command is executed.

  • MLProfileBuild compiles the CAM Profile data specified at the CamData input and writes the resulting profile to the CAM Profile object specified at input ProfileID.
  • The created profile can be used as an input to PLCopen CAM Function Blocks (e.g., MC_CamTblSelect, MC_CamIn, MC_CamOut), or any Pipe Network CAM Profile Function/Function Blocks.
  • When the operation is complete, the Done output is high.
    • If an error is encountered, the Error output is high and the ErrorID output returns an error code.
    • If the Error can be attributed to a specific profile element in the CamData array, ErrorElem attempts to indicate the element in error.

CamProps_Ref Structure

See Master/Input offset about the parameters which transform the CAM Profile.

CamData_Ref Structure

The Cam_Data function block input is an array of CamData_Ref structures.

Error Codes


  • If Cyclic is TRUE and the Vel/Accel of the first and last elements do not match, MLProfileBuild automatically copies the first element's Vel/Accel to the last element's.
    A log warning message is posted indicating that this change has occurred.

Example: Use MLProfileBuild

This example has these procedure steps:

Example: Building a Parabolic Cam Profile

To build a parabolic CAM Profile, your CAM data elements must use CAM_SEGMENT_TYPE_PARABOLIC or CAM_SEGMENT_TYPE_LINE when defining the cam data array.

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

            // Build the profile
Inst_MLProfileBuild( TRUE, ProfileProps, ProfileData, 3, ProfileID, TRUE, CAM_PROFILE_OPTION_DEFAULT);

See Also