Notes, Error description, Code example – Yaskawa MotionWorks IEC Toolboxes User Manual
Page 98

Cam Toolbox: Function Blocks
MotionWorks IEC61131-3 Toolboxes: 2013-09-13
85
while enable is held high.
VAR_OUTPUT
B
Valid
BOOL
Indicates that the outputs of the function are valid.
V
Engage
BOOL
Set high when the externally located Y_Cam_In
function block(s) must be executed.
V
Disengage
BOOL
Set high when the externally located Y_Cam_Out
function block(s) must be executed.
B
Error
BOOL
Set high if error has occurred during the execution of
the function block. This output is cleared when
'Execute' or 'Enable' goes low.
E
ErrorID
UINT
If Error is true, this output provides the Error ID.
This output is reset when 'Execute' or 'Enable' goes
low.
Notes
• The Engage output is to be used with a Y_CamIn function block placed external to this function block. This
design allows for one or more cam slaves to be operated via the logic provided.
• The Disengage output is to be used with a Y_CamOut function block placed external to this function block.
This design allows for one or more cam slaves to be operated via the logic provided.
• This function block is designed to work with the
function block. It waits for an initial
Camshift will occur before the first Engage event should take place. If the application requires the slave to
become synchronized with the master without a Camshift, simply use an R_TRIG of the CamControl.Valid to
cause the CamData.Shifting bit to go high and low.
Error Description
ErrorID
Meaning
No error
ControlData.DecisionPosition
Code Example
The operation of CamControl in deciding when to engage and disengage a cam is shown in the logic analyzer
illustration below. The rising edge of the CamControl.Shifting variable denotes the "first" product to be
processed. First product in this implementation means the cam is disengaged, the ProductBuffer was empty,
and a product arrived. Shifting starts immediately if it is the first product in the ProductBuffer. CamControl
waits for the falling edge of the Shifting bit to set the CamControl.Engage output. While the cam is engaged,
the CamControl block continues to monitor the product buffer for new products. When the ProductBuffer
indicates that no products have arrived and the cam cycle has past the ‘Decision Position,’ the
CamControl.Disengage output is turned on.