Demo Project Structure

Calls

Call up of the function block FB_SmgAddOnModule

The call up of the AxisModule and the FB_SmgAddOnModule takes place in the action SubModules of the equipment module SR_SmgAddOnModule.

G-SE-0069347.1.gif-high.gif

 

 

Call up of the application example

The call up of the application example is performed in the action Logic of the equipment module SR_SmgAddOnModule.

As example a flying saw was implemented here:

G-SE-0069345.1.gif-high.gif

 

 

Function Block FB_SmgAddOnModule

The function block FB_SmgAddOnModule is called in the AdditionalMode of the AxisModule. It is an application function block that is provided in the demo project SmgAddOnModuleExample.

NOTE: In the present demo project the functional range of the FB_SmgAddOnModule is designed for the example of a flying saw.

If the functional range for the application is not enough then it can be extended.

Task

The function block FB_SmgAddOnModule has the following tasks:

oControl and communication between application and AxisModule:

oThe control of the FB_SmgAddOnModule takes place via the default variable stSlave1In­terface (AXM.ST_ModuleInterface).

G-SE-0069349.1.gif-high.gif 

oThe module is brought into the operation mode and started (see action Init_CmdTables) via the default commands:

stAutoTable[udiStepIndex].sTitle: = "Additional Mode Slave1";

stAutoTable[udiStepIndex].udiModuleName: = c_udiSlave1;

stAutoTable[udiStepIndex].diStep: = diStep;

stAutoTable[udiStepIndex].diCMD: = AXM.Et_Cmd.AdditionalWs;

stAutoTable[udiStepIndex].timTimeOut: = T#0MS;

stAutoTable[udiStepIndex].xEndCMD: =FALSE;

oThe control of the application example from the FB_SmgAddOnModule takes place via the user variable stApplicationItf (ST_ApplicationItf).

G-SE-0069346.1.gif-high.gif 

The previous figure shows the ways of communication between the AxisModule, the FB_SmgAddOnModule and the flying saw application.

oActivating and monitoring the SMG:

With an internal state machine the function block is brought into its readiness for operation and thereby it activates the SMG. In addition, data are saved for a potential warm start and diagnostic messages from the application are monitored.

oProviding methods and properties to command the SMG:

Before calling the original SMG methods, the necessary SMG parameters are set in these methods. They are only containers, that decrease the complexity of the SMG functions and parameters. The application is realized with these methods.

Methods and properties

The following methods and properties of the FB_SmgAddOnModule are available in the demo project SmgAddOnModuleExample:

G-SE-0069366.1.gif-high.gif

 

 

Method DoWarmStart

This method performs a positioning on the cam position of the currently interrupted cam. For the cam point calculation the master position (iq_stModuleItf.stMain.i_ifMaster) is used and calculated in the application period (i_lrPeriode).

The warm start is only realized for jobs of the ET_MotionJobType.ExternalCam type.

These are jobs that were sent via the method TakeMultiCamJob. Otherwise an absolute positioning is started on the position zero.

If necessary, this method can be extended.

Input

Data type

Description

i_lrPeriode

LREAL

Application period based on the master (part lengths) in units

i_lrVelocity

LREAL

Maximum warm start velocity in units/s

i_lrAcceleration

LREAL

Maximum acceleration in units/s2

i_lrDeceleration

LREAL

Maximum deceleration in units/s2

i_lrJerk

LREAL

Maximum jerk in units/s3

Method TakeJob

With this method the original method TakeJob is called directly. It is used for jobs where the user requires full access to all the job relevant parameters and functions.

Input

Data type

Description

i_etChannel

ET_Channel

Channel, over which the job is performed.

Input/Output

Data type

Description

iq_stMotionJob

ST_MotionJob

ST_MotionJob contains all the job relevant data.

Method TakeJobAll

With this method the original method TakeJobAll is called directly. It is used for jobs where the user requires full access to all the parameters and functions.

Input/Output

Data type

Description

iq_stMotionJobA

ST_MotionJob

ST_MotionJob for the channel A

iq_stMotionJobB

ST_MotionJob

ST_MotionJob for the channel B

iq_stMotionJobC

ST_MotionJob

ST_MotionJob for the channel C

Method TakeMultiCamJob

This method uses a default MultiCam structure as input, builds a segmented profile out of it (ET_MotionJobType.ExternalCam) and passes it on to the SMG as job. Per channel, maximum three such jobs can be buffered. A buffer of two is normally enough to achieve a jerkfree transition between two cams.

Input

Data type

Description

i_etChannel

ET_Channel

Channel, over which the job shall be performed.

i_diJobId

DINT

During the execution this JobId is displayed in the variable stRTDataTemp.stChannel_x.diCurrentJobId.

i_etCamLimitMode

ET_CamMode

Abort criterion of the cam job, for example ET_CamMode.Endless

i_etSlaveSetPosMode

ET_SetposMode

SetPos job type, for example ET_SetposMode.Absolute

i_lrSlaveSetposValue

LREAL

Value on which the slave axis is set to when the job is started.

i_etMasterSetPosMode

ET_SetposMode

SetPos job type, for example ET_SetposMode.Absolute

i_lrMasterSetposValue

LREAL

Value on which the logical master axis is set to when the job is started.

i_xClearBufferedJobs

BOOL

TRUE = Deletes all the buffered jobs during the start.

FALSE = The new job is put to the very last place in the buffer.

i_xTerminateCurrentJob

BOOL

TRUE = Cancels a possible active job during the start.

FALSE = The new job is buffered when another job is active.

Input/Output

Data type

Description

iq_stMultiCamData

PDL.ST_MultiCam

MultiCam structure

Method TakePoly5CamJob

Starts a polynomial of the 5th degree with variable initial- and accumulated values.

Input

Data type

Description

i_etChannel

ET_Channel

Channel, over which the job shall be performed.

i_diJobId

DINT

During the execution this JobId is displayed in the variable stRTDataTemp.stChannel_x.diCurrentJobId.

i_etCamLimitMode

ET_CamMode

Abort criterion of the cam job, for example ET_CamMode.Endless

i_etSlaveSetPosMode

ET_SetposMode

SetPos job type, for example ET_SetposMode.Absolute

i_lrSlaveSetposValue

LREAL

Value on which the slave axis is set to when the job is started.

i_etMasterSetPosMode

ET_SetposMode

SetPos job type, for example ET_SetposMode.Absolute

i_lrMasterSetposValue

LREAL

Value on which the logical master axis is set to when the job is started.

i_lrXStart

LREAL

X value of the cam at the start point

i_lrYStart

LREAL

Y value of the cam at the start point

i_lrMStart

LREAL

Gradient of the cam at the start point

i_lrKStart

LREAL

Curvature of the cam at the start point

i_lrXEnd

LREAL

X value of the cam at the end point

i_lrYEnd

LREAL

Y value of the cam at the end point

i_lrMEnd

LREAL

Gradient of the cam at the end point

i_lrKEnd

LREAL

Curvature of the cam at the end point

i_xClearBufferedJobs

BOOL

TRUE = Deletes all the buffered jobs during the start.

FALSE = The new job is put to the very last place in the buffer.

i_xTerminateCurrentJob

BOOL

TRUE = Cancels a possible active job during the start.

FALSE = The new job is buffered when another job is active.

Method TakePosJob

Starts a positioning with the specified parameters.

Input

Data type

Description

i_etChannel

ET_Channel

Channel, over which the job shall be performed.

i_diJobId

DINT

During the execution this JobId is displayed in the variable stRTDataTemp.stChannel_x.diCurrentJobId.

i_etPosMode

ET_PosMode

Positioning mode, for example ET_PosMode.Relative

i_lrPosition

LREAL

Target position or distance

i_lrVelocity

LREAL

Maximum velocity in units/s

i_lrAcceleration

LREAL

Maximum acceleration in units/s2

i_lrDeceleration

LREAL

Maximum deceleration in units/s2

i_lrJerk

LREAL

Maximum jerk in units/s3

i_lrDelay

LREAL

Start delay in ms

i_xClearBufferedJobs

BOOL

TRUE = Deletes all the buffered jobs during the start.

FALSE = The new job is put to the very last place in the buffer.

i_xTerminateCurrentJob

BOOL

TRUE = Cancels a possible active job during the start.

FALSE = The new job is buffered when another job is active.

Method TakeSetPosJob

Changes the position of a channel. The axis position is equivalent again with the sum of all the channels after the Setpos.

Input

Data type

Description

i_etChannel

ET_Channel

Channel, over which the job shall be performed.

i_diJobId

DINT

During the execution this JobId is displayed in the variable stRTDataTemp.stChannel_x.diCurrentJobId.

i_etPosMode

ET_PosMode

Positioning mode, for example ET_PosMode.Relative

i_lrValue

LREAL

Value to which the position of a channel is set or value to which the position of a channel is moved to.

Properties

Name

Data type

Accessing

Description

stRTData

ST_RealtimeData

Read

In this property feedback values from the SMG are provided (see ST_RealtimeData and ST_RealtimeChannel). But before they can be used, they have to be copied into a local variable:

stRTDataTemp:=fbSmgAddOnSlave1.strData;

This copying procedure is performed in the application example.

astTouchProbe

ST_Touchprobe

Read/Write

This property also refers to a SMG variable. But it is not used in the application example flying saw. (See also ST_Touchprobe).

stPhaseGenerator

ST_PhaseGenerator

Read/Write

This property also refers to a SMG variable. But it is not used in the application example flying saw. (See also ST_PhaseGenerator).