SMC_LimitCircularVelocity (FB)

 

FUNCTION_BLOCK SMC_LimitCircularVelocity

The module checks the particular elements of the OutQueue and limits the path velocities of circular elements against their radii. In order to limit the acceleration to a prescribed value, the velocity of the arc at the tran­sition sqrt(a*r) must not exceed. The module controls the transition between two elements (line on circular arc, circular arc on line or circular arc on circular arc) and adapts the end velocity of the first element so that the acceleration jump will not exceed the value dMaxAccJump. Furthermore, the module limits the acceleration in X and Y to the value dMaxAcc.

InOut:

Scope

Name

Type

Initial

Comment

Input

bExecute

BOOL

FALSE

Execution starts on the rising edge.

bAbort

BOOL

FALSE

If TRUE, the current processing of this function block is aborted

bAppend

BOOL

FALSE

As long as this input remains FALSE, poqDataOutQueue will be cleared at each reset. As long as it remains TRUE, newly incoming data will be written to the end of the DataOutQueue.

poqDataIn

POINTER TO SMC_OUTQUEUE

NULL

This variable points to the SMC_OUTQUEUE structure object, which contains the SMC_GEOINFO objects of the path; typically it points on the output poqDataOut of the preceding module (e.g. the SMC_NCDecoder ).

dMaxAcc

LREAL

0

This input variable gives the maximum acceleration value permissible for circular arcs. A value equal to 0 will cause no check to be done.

dMaxAccJump

LREAL

0

This input variable gives the maximum acceleration jump for a transition of two objects. A value equal to 0 will cause no check to be done.

nSizeOutQueue

UDINT

0

This variable contains the size of the data buffer, the list of SMC_GEOINFO structure objects will be written to. This buffer must be able to hold at least five SMC_GEOINFO objects. Otherwise, SMC_LimitCircularVelocity will not execute any actions at all. Its size may be predefined, but may be modified later only during a reset. It is recommended to create the buffer as described by the example below:

ExampleBuf: ARRAY[1..50] of SMC_GeoInfo.

The correct buffer size will then be retrieved by use of the operator sizeof(ExampleBuf).

pbyBufferOutQueue

POINTER TO ARRAY [0..0] OF SMC_GEOINFO

NULL

This input must point to the first byte of the memory area that is allocated for the SMC_OUTQUEUE structure. This area must be at least as big as defined in nSizeOutQueue. Typically the allocation of the memory buffer is done in the declaration part of the IEC-program by defining an array of SMC_GEOINFO (e.g. BUF: ARRAY[1..50] OF SMC_GEOINFO; for a buffer that can store 50 path elements). The value may be predefined, but may be modified later on only during a reset.

Output

bDone

BOOL

FALSE

This variable will be set to TRUE as soon as the input data from poqDataIn has been processed completely. Thereafter, the module will not perform any further actions until it gets reset. If input bExecute is FALSE, bDone will be reset to FALSE.

bBusy

BOOL

FALSE

TRUE while execution of function block is not finished

bError

BOOL

FALSE

Signals that an error has occurred within the function block

wErrorID

SMC_ERROR

SMC_NO_ERROR

Error identification

poqDataOut

POINTER TO SMC_OUTQUEUE

NULL

This output points on the SMC_OUTQUEUE structure managing the new SMC_GEOINFO objects.