Function BlockMC_CamTblSelectPLCopen motion icon

Description

This Function BlockClosedA function block groups an algorithm and a set of private data. It has inputs and outputs. is defined to read and initialize the specified profile, returning an ID to be used with MC_CamIn function block.

Arguments

For more detail on how inputs and outputs work, refer to PLCopen Function Blocks - General Rules

Input

Execute

Description

Requests to queue the slave gear ratio move

 

Data type

BOOL

 

Range

0, 1

 

Unit

N/A

 

Default

CamTable

Description

Profile name as defined in the CAM Profile Properties dialog

 

Data type

STRING

 

Range

 

Unit

N/A

 

Default

Periodic

Description

Selects if the profile is periodic
(see also Usage section)

 

Data type

BOOL

 

Range

0, 1

 

Unit

N/A

 

Default

MasterAbsolute

Description

Selects if master profile is absolute or relative
(see also Usage section)

 

Data type

BOOL

 

Range

0, 1

 

Unit

N/A

 

Default

SlaveAbsolute

Description

Selects if Slave profile is absolute or relative
(see also Usage section)

 

Data type

BOOL

 

Range

0, 1

 

Unit

N/A

 

Default

Output

Done

Description

Indicates the function block has completed successfully

 

Data type

BOOL

 

Range

0, 1

 

Unit

N/A

Busy

Description

Indicates this function block is executing

 

Data type

BOOL

 

Range

0, 1

 

Unit

N/A

Error

Description

Indicates an invalid input was specified

 

Data type

BOOL

 

Range

0, 1

 

Unit

N/A

ErrorID

Description

Indicates the error if the Error output is high

See table in PLCopen Function Block ErrorID Output

 

Data type

INT

 

Range

 

Unit

N/A

CamTableID

Description

Indicates the ID number of the profile to be used with MC_CamIn

 

Data type

INT

 

Range

0 - 255

 

Unit

N/A

Usage

  • Each positive transition of the Enable input will create a unique Cam ID and store the profile information in a table. The number of unique Cam IDs is limited to 256. If the application attempts to create more than 256 Cam IDs, the Error output will be true and the ErrorID output will be 22 (Too Many Profiles). It is only necessary to call MC_CamTblSelect once for each Profile/Periodic/MasterAbsolute/SlaveAbsolute configuration to be used.
  • The Periodic input selects if the profile is to repeat each cycle. If the profile is not periodic and the master axis moves beyond the profile range, the slave stops at the end of the profile.

    • If the master axis moves back into the profile range, the slave resumes following the profile.

  • If the MasterAbsolute input is ON, the profile is in reference to the Master axis position.
    If the MasterAbsolute input is OFF, the profile is in reference to the Master axis position at the time the MC_CamIn function block is executed.
  • Similarly, the SlaveAbsolute input selects if the slave positions are in reference to the Slave axis position or the Slave axis position at the time the MC_CamIn function block is executed.

    • If the SlaveAbsolute input is set to TRUE, the axis jumps back to the starting position. If you set this input to FALSE, the axis will no longer jump back; but rather, as the profile repeats, the slave moves relative to the start of each period.

Related Functions

    MC_CamIn

    MC_CamOut

Example

Structured Text

      (* MC_CamTblSelect ST example *) //call this function block every scan until "Done"
      
Inst_MC_CamTblSelect(DoSelect, 'Profileb', TRUE, TRUE, TRUE ); //Inst_MC_CamTblSelect is instance of MC_CamTblSelect
CamSelDone := Inst_MC_CamTblSelect.Done; //store Done output to user defined variable
IF CamSelDone = TRUE THEN//when function block is "done" store
CamTableID := Inst_MC_CamTblSelect.CamTableID; //CamTableID in user defined variable
END_IF;

See also how this function is used in the Hole punch project here

Ladder Diagram

MC_CamTblSelect: LD example

See also MC_CamIn for examples.

Go back to the top of the page [Top]