Block responsible for the execution of a defined positioning a cam table of a curve CAM.
Ladder Representation

Execution Features
Program Memory Size |
92 Bytes |
Data Memory Size |
52 Bytes |
Block Structure
Variable Type |
Name |
Data Type |
Description |
VAR_IN_OUT |
Master |
BYTE |
Selection of operation master (0 - Fast digital inputs) (1 - CANopen) (2 - Encoder 1) (3 - Virtual Axis) (4 - Encoder 2) |
Slave |
BYTE |
Selection of operation slave (0 - Real axis) |
|
VAR_INPUT |
Execute |
BOOL |
Block enabling |
MasterScaling |
REAL |
Gain in the position values of the master axis. |
|
SlaveScaling |
REAL |
Gain in the position values of the slave axis. |
|
MasterSyncPosition |
LREAL |
Position of the master axis where the slave will start the CAM curve. |
|
CamTableID |
WORD |
Selected CAM table |
|
BufferMode |
BYTE |
Execution start mode (0 - Starts block immediately, if there is another block in the execution it will be aborted) (1 - When another block is in execution, the block in execution will continue its motion until the end and this new block will wait to be executed.) (6 – If another block is in execution, this block will go into error 52 and will not be executed. The HMI will show the alarm A00052.) |
|
VAR_OUTPUT |
InSync |
BOOL |
Output enabling |
Busy |
BOOL |
Flag indicating the block has not yet been ended |
|
Active |
BOOL |
Block flag with control on the axis |
|
CommandAborted |
BOOL |
Flag of aborted command |
|
Error |
BOOL |
Error in the execution flag |
|
ErrorID |
WORD |
Identifier of the occurred error |
|
EndOfProfile |
BOOL |
End of the CAM profile flag |
|
VAR |
MC_CAMIN_INST_0 |
MC_CAMIN |
Instance of access to block structure |
Operation
When this block detects a leading edge in Execute, it sends a command for the drive to execute a defined positioning by CamTableID.
When Execute has FALSE value, Done remains FALSE. The Done output is activated when the block finishes the execution successfully, remaining at TRUE level until Execute receives FALSE.
If there is any error in the execution, the Error output is enabled and ErrorID displays an error code according to the table below.
Code |
Description |
52 |
Attempt to execute block with BufferMode in Single when another block is active. |
67 |
Drive in the "Disabled" or "Errorstop" status. |
69 |
Drive in the "Stopping" status. |
70 |
Attempt to execute block with BufferMode in Buffered when another block is active and another block is waiting. |
71 |
P202 different from 4. |
74 |
Drive in the "Homing" status. |
78 |
MC block not executed – Internal fault. |
85 |
CamTableID not valid. |
Example in Ladder


In the up transition of CAMCALC_EXECUTE, the MW_CamCalc block is executed and the cam table of NUM_OF_TABLE will be calculated according to the block arguments.
When the calculation of cam table 11 is finished, the InSync output is set while the Execute input remains set.
With the CAMCALC_DONE set, the MC_CamIn block can be executed.
In the up transition of CAMIN1_EXECUTE, the first MC_CamIn block is executed.
If it is necessary to adjust the cam table of the CAM curve, just make the adjustment in MASTER_PT[0], MASTER_PT[1], SLAVE_PT[0] and SLAVE_PT[1], change the content of NUM_OF_TABLE to 12 and execute the MW_CamCalc block again.
Example in ST
The example below displays the instructions for applying the example above in the ST language.
VAR CAMCALC_EXECUTE, CAMCALC_DONE, CAMIN1_EXECUTE, CAMIN1_DONE : BOOL; NUM_OF_TABLE, PTS_OF_ARRAY : WORD; CAMTABLEID : UINT; CURVE_ARRAY : ARRAY [0..1] OF WORD; M_PTS_ARRAY, S_PTS_ARRAY : ARRAY [0..1] OF LREAL; MW_CAMCALC_INST_0 : FB_MW_CamCalc; MC_CAMIN_INST_0 : FB_MC_CamIn; END_VAR
M_PTS_ARRAY[0] := FB_WORD_TO_LREAL(PAR_1050); M_PTS_ARRAY[1] := FB_WORD_TO_LREAL(PAR_1050); S_PTS_ARRAY[0] := FB_WORD_TO_LREAL(PAR_1050); S_PTS_ARRAY[1] := FB_WORD_TO_LREAL(PAR_1050); CURVE_ARRAY[0] := FB_STORE(WORD#0); CURVE_ARRAY[1] := FB_STORE(WORD#1);
MW_CAMCALC_INST_0.Execute := CAMCALC_EXECUTE; MW_CAMCALC_INST_0( Master:=0, Slave:=0, CamTable:=NUM_OF_TABLE, NumberOfPoints:=PTS_OF_ARRAY, MasterPoints:=M_PTS_ARRAY, SlavePoints:=S_PTS_ARRAY, CurveType:=CURVE_ARRAY, Periodic:=0); CAMTABLEID := MW_CAMCALC_INST_0.CamTableID; CAMCALC_DONE := MW_CAMCALC_INST_0.InSync;
MC_CAMIN_INST_0.Execute := CAMIN1_EXECUTE AND CAMCALC_DONE; MC_CAMIN_INST_0( Master:=3, Slave:=0, MasterScaling:=1.0, SlaveScaling:=1.0, MasterSyncPosition:=LREAL#0.0, CamTableID:=11, BufferMode:=1); CAMIN1_DONE := MC_CAMIN_INST_0.InSync;
|
|---|