MC_DigitalCamSwitch_BkPlcMc (from V3.0)

MC_DigitalCamSwitch_BkPlcMc (from V3.0) 1:

The function block generates software cams depending on the position, direction of travel and velocity of an axis.

MC_DigitalCamSwitch_BkPlcMc (from V3.0) 2: Inputs

VAR_INPUT
    Enable:         BOOL;
    EnableMask:     DWORD;
END_VAR

Name

Type

Description

Enable

BOOL

This input controls all activities of the function block.

EnableMask

DWORD

A mask with bits that specify the activation of the outputs in Outputs.

MC_DigitalCamSwitch_BkPlcMc (from V3.0) 3: Inputs/outputs

VAR_INOUT
    Axis:           Axis_Ref_BkPlcMc;
    Switches:       CAMSWITCH_REF_BkPlcMc;
    Outputs:        OUTPUT_REF_BkPlcMc;
    TrackOptions:   TRACK_REF_BkPlcMc;
END_VAR

Name

Type

Description

Axis

Axis_Ref_BkPlcMc

Here, the address of a variable of type Axis_Ref_BkPlcMc should be transferred.

Switches

CAMSWITCH_REF_BkPlcMc

Here, an array of type CAMSWITCH_REF_BkPlcMc should be transferred.

Outputs

OUTPUT_REF_BkPlcMc

Here, the address of a variable of type OUTPUT_REF_BkPlcMc should be transferred.

TrackOptions

TRACK_REF_BkPlcMc

Here, an array of type TRACK_REF_BkPlcMc should be transferred.

MC_DigitalCamSwitch_BkPlcMc (from V3.0) 4: Outputs

VAR_OUTPUT
    InOperation:    BOOL;
    Busy:           BOOL;
    Error:          BOOL;
    ErrorID:        UDINT;
END_VAR

Name

Type

Description

InOperation

BOOL

This indicates whether the function block is active.

Busy

BOOL

This output is TRUE while the command is being processed.

Error

BOOL

The occurrence of an error is indicated here.

ErrorID

UDINT

An encoded indication of the cause of the error is provided here.

Behavior of the function block

Cam signals (switches) are switched based on the actual position of an axis. The available options are position-controlled (with start and end position) and time-controlled (with trigger position and duration). The direction of travel of the axis can be taken into account.

The cam signals are assigned to tracks with parameter sable properties. The time response can be specified through a switch-on and switch-off delay. Predictive signalling can be achieved through negative values. A hysteresis enables suppression of undesirable signalling, if the axis is near a switching points and the actual position is not entirely constant.

Example

CAMSWITCH_REF_BkPlcMc used:

Parameter

Switch[1]

Switch[2]

Switch[3]

Switch[4]

...

Switch[n]

TrackNumber

1

1

1

2

 

 

FirstOnPosition

2000.0

2500.0

-1000.0

3000.0

 

 

LastOnPosition

3000.0

3000.0

1000.0

 

 

 

AxisDirection

1

2

0

0

 

 

CamSwitchMode

0

0

0

1

 

 

Duration

 

 

 

1.35

 

 

.....

 

 

 

 

 

 

TRACK_REF_BkPlcMc used:

Parameter

Track[1]

Track[2]

...

Track[n]

OnCompensation

-0.125

0.0

 

 

OffCompensation

0.250

0.0

 

 

Hysteresis

0.0

0.0

 

 

Signal curves during axis motion from 0.0 to 5000.0 and back:

MC_DigitalCamSwitch_BkPlcMc (from V3.0) 5:

The following diagram shows the signal curves over the position. For positive direction of travel the signals are shown normally (upwards), for negative direction of travel they are shown negative, i.e. 'downwards'. The vertical cursor lines indicate the positions 1000 and 3000 mm.

MC_DigitalCamSwitch_BkPlcMc (from V3.0) 6: