L_MC2P_CamRefFromFile

This FB automatically reads an existing cam file (*.lcp) after the program download and provides the data for the application.

Cyclic call by the Lenze Cam Editor

The CamRef object created by the Lenze Cam Editor in the "ProfileReference" directory corresponds to an instance of the FB L_MC2P_CamRefFromFile .

The CamRef object or the instance of the FB L_MC2P_CamRefFromFile

  • is an interface of MC_CAM_REF type
  • can directly be connected to an input of MC_CAM_REF type of another FB, e.g.
    • CamTable input of the FB MC_CamIn
    • CamTable1 input of the TM L_TT1P_FlexCamBase
    Programming example:
    MC_CamIn1.CamTable:= L_MC2P_CamRefFromFile1

 

 

 

L_MC2P_CamRefFromFile

 

 

 

BOOL

-

xExecute

xNewDataAvailable

-

BOOL

STRING

-

sFileName

xDone

-

BOOL

L_MC2P_IMotionData

-

itfCamData

xBusy

-

BOOL

UDINT

-

udiCamDataCount

xError

-

BOOL

BOOL

-

xReloadable

eErrorID

-

L_IE1P_Error

 

 

 

 

 

 

 

 

Note!

The renewed reading of a file, e.g. FB MC_CamIn , is not possible if the same cam file is currently being processed.

Restriction for Controller c300 / p300 :
Cam data are only loaded when a boot project is started or after a program download.
Reloading the cam data during operation is not possible.

Memory location of cam data

  • After a download or an Online Change , the cam data is only available in the PLC directory "/Temp/ProfileData".
    • By switching the PLC off at this time, the cam data are lost.

Firmware v1.15

  • The profile data is copied to the "/IPC/PLC/ProfileData" directory only when the boot application is created. As a result, the data is stored on the controller's SD card and is protected against data loss when the PLC is powered off.

Firmware v2.x

  • The profile data is copied to the "$ProfileData$" storage area only when the boot appli-cation is created. As a result, the data is stored in the controller's internal non-volatile memory and is protected against data loss when the PLC is powered off.
Inputs

Name

Data type

Information/possible settings

xExecute

BOOL

FALSE ä TRUE

Execute reading of the cam file

sFileName

STRING

Name of the cam file (e.g. "Kurve1.lcp")

itfCamData

L_MC2P_IMotionData

Interface on data area for saving the read-in cam data

udiCamDataCount

UDINT

Number of the transmitted profile elements

xReloadable

BOOL

Reserved

Outputs

Name

Data type

Value/meaning

xNewDataAvailable

BOOL

TRUE

The connected cam file has been updated and downloaded.

xDone

BOOL

TRUE

The read operation is completed.

xBusy

BOOL

TRUE

Processing is running.

xError

BOOL

TRUE

An error has occurred. For details see eErrorID .

eErrorID

If xError = TRUE: Error number for the error that has occurred.

Cyclic call by the Lenze Cam Editor

The FB has to be called cyclically if

  • a new cam file is to be imported while the application is running or
  • the currently connected cam file has to be updated (new download via the »PLC Designer«).

The FB does not have to be called cyclically if

  • the CamRef object is only connected with one cam file and
  • no update is carried out while the application is running.