The function starts a curve-based motion sequence. An axis (i_stAxisId) moves with a curve (i_diProfilId) synchronously to a master encoder (i_stEncId). For this, the profile has to be loaded with the function FC_ProfileLoad().
The job is written in the job preparation buffer and started if no other job is active or if the running job is finished. If the job preparation buffer is not empty, then the existing job is overwritten with the new job. There is one job preparation buffer per axis. To coordinate the job preparation buffer, a system function block (FC_TestJobBuffer() ) is available.
A movement of the coordinate systems of the curve is achieved with i_lrXOffset (master position) / i_lrYOffset (slave position).
The i_lrXFactor / i_lrYFactor are necessary to scale the master- and slave position. i_lrXLimMin / i_XLimMax "lower" and "upper" end criteria of the curve. Here, the X-offset is not taken into account.
i_EncoderGroupStart, i_EncoderGroupCycle, i_diEncoderCountStart, and i_diEncoderCountCycle are used for group type encoder settings of the described encoders. This function is normally used with the sum encoder as master encoder.
TYPE EncoderArray: ARRAY[0..7] OF ST_SetEncoder;
END_TYPE
TYPE ST_SetEncoder :
STRUCT
stEncoderId: ST_LogicalAddress; (*Encoder reference*)
etMode: ET_SetposMode; (*Choice of which kind the Encoder should be manipulated*)
lrValue: LREAL; (*value to manipulate the Encoder Position*)
END_STRUCT
END_TYPE
The end criteria are activated with i_etXLimMinMode / i_etXLimMaxMode. The function supports the extended modes for the end criteria of a CAM job. Next to the options ET_CamLimitMode.Inactive and ET_CamLimitMode.Active the ET_CamLimitMode.Reverse is supported.
TYPE ET_CamLimitMode :
( (* if limit is reached ... *)
Inactive:=0, (* - no activities *)
Active :=1, (* - terminate actual cam job *)
Reverse :=2 (* - perform a reverse action *) );
END_TYPE
ET_CamLimitMode.Reverse enables the directional independent, endless processing of the CAM job. When the upper or lower end position is reached, a Setpos job is performed and the job continues at the beginning or the end of the profile. It is possible to have another Setpos job perform the curve start then at the end of a cycle.
The program is processed after sending the instruction. It does not wait until the motion sequence is completed. If the job is active, then i_diJobId is displayed in the parameter CurrentJobId of the axis.
Input |
Data type |
Description |
---|---|---|
i_stAxisId |
ST_LogicalAddress |
Logical address of the axis |
i_stEncId |
ST_LogicalAddress |
Master encoder |
i_diProfilId |
DINT |
Curve |
i_lrXOffset |
LREAL |
Master position |
i_lrYOffset |
LREAL |
Slave position |
i_lrXFactor |
LREAL |
Scaling the master position |
i_lrYFactor |
LREAL |
Scaling the slave position |
i_lrXLimMin |
LREAL |
Lower end criterion of the curve |
i_lrXLimMax |
LREAL |
Upper end criterion of the curve |
i_etXLimMinMode |
ET_CamLimitMode |
Activate lower end criterion |
i_etXLimMaxMode |
ET_CamLimitMode |
Activate upper end criterion |
i_EncoderGroupStart |
EncoderArray |
|
i_diEncoderCountStart |
DINT |
|
i_EncoderGroupCycle |
EncoderArray |
|
i_diEncoderCountCycle |
DINT |
|
i_diJobId |
DINT |
ID of the executing job |
Data type |
Description |
---|---|
DINT |
1: Job preparation buffer was not free and was overwritten with the new job 0: OK -1: i_stAxisId invalid -2: i_stEncId invalid -3: i_diProfilId invalid -4: Value of i_lrXFactor smaller than 0.1 -5: Sercos bus is not in phase 4; therefore no positioning commands can be processed. -7: i_stEncID invalid or undefined ET_SetPosMode -8: Number of encoders > 8 or < 1 |