Motion Library - Derivator

Name

Description

Return type

MLDerInit

Initializes a derivator object

BOOL

MLDerReadInModPos

Returns the input MODULO_POSITION of the Derivator block

None

MLDerWriteInModPos

Sets the input MODULO_POSITION of the Derivator block

BOOL

FunctionMLDerInitPipe Network motion icon

Description

Initializes an derivator object. FunctionClosedA function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. block is automatically called if a Derivator Block is added to the Pipe Network, with user-defined settings entered in the Pipe Blocks Properties screen. Input ModuloPosition is defined to manage the periodicity (modulo) of the input values.


  • Derivator objects are normally created in the Pipe Network using the graphical engine. Then you do not have to add MLDerInit function blocks to their programs. Parameters are entered directly in pop-up windows, and the code is then automatically added to the current project.

MLDerInit

Figure 7-94: MLDerInit

Arguments

Input

BlockID

Description

ID number of a created Pipe Block

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

ModuloPosition

Description

Input ModuloPosition of Derivator object

 

Data type

LREAL

 

Range

 

Unit

User unit

 

Default

360.0

Output

Default (.Q)

Description

Returns TRUE if the Derivator object is initialized

See more details here.

 

Data type

BOOL

 

Unit

N/A

Return Type

BOOL

Related Functions

MLBlkCreate

MLDerReadInModPos

MLDerWriteInModPos

Example

Structured Text

 

//Create and Initiate a Derivator object

MyDerivator := MLBlkCreate( 'MyDerivator', 'DERIVATOR' );

MLDerInit( MyDerivator, 360.0 );

 

Ladder Diagram

MLDerInit: LD example

 

Function Block Diagram

MLDerInit: FBD example

Go back to the top of the page [Top]

FunctionMLDerReadInModPosPipe Network motion icon

Description

Returns the Input ModuloPosition of the derivator block. Input ModuloPosition is defined to manage the periodicity (modulo) of the input values.

For example, if the input value increases each millisecond by one degree then the output value is 1000 degrees per second. Now lets imagine that the input value skips suddenly from 359 to 0.

  • If Input ModuloPosition = 360, the output continues to indicate 1000 degrees per second, indicating that rollover into the next period has been properly handled.
  • If Input ModuloPosition = 1000, the output then indicates 359,000 degrees per second, indicating that the input has incorrectly interpreted roll-over as a 359 degree move in one millisecond.

MLDerReadInModPos

Figure 7-95: MLDerReadInModPos


  • The first calculation of a Derivator Pipe Block just after the pipe installation indicates zero regardless of the initial input value.

Arguments

Input

ID

Description

ID number of an initiated Derivator object.

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

Output

ModuloPosition

Description

Current Input ModuloPosition of the selected Derivator object.

 

Data type

LREAL

 

Unit

User unit

 

Default

Related Functions

MLDerWriteInModPos

MLDerInit

Example

Structured Text

 

//save the current input MODULO_POSITION of a Derivator object

DerInputPeriod := MLDerReadInModPos ( PipeNetwork.MyDerivator );

 

 

Ladder Diagram

MLDerReadInModPos: LD example

 

Function Block Diagram

MLDerReadInModPos: FBD example

Go back to the top of the page [Top]

FunctionMLDerWriteInModPosPipe Network motion icon

Description

Sets the Input ModuloPosition of the Derivator block. Input ModuloPosition is defined to manage the periodicity (modulo) of the input values.

For example, if the input value increases each millisecond by one degree then the output value is 1000 degrees per second. Now lets imagine that the input value skips suddenly from 359 to 0

-If Input ModuloPosition = 360, the output continues to indicate 1000 degrees per second, indicating that rollover into the next period has been properly handled

-If Input ModuloPosition = 1000, the output then indicates 359,000 degrees per second, indicating that the input has incorrectly interpreted roll-over as a 359 degree move in one millisecond

MLDerWriteInModPos

Figure 7-96: MLDerWriteInModPos


  • The first calculation of a Derivator Pipe Block just after the pipe installation indicates zero regardless of the initial input value.

Arguments

Input

ID

Description

ID number of an initiated Derivator object

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

ModuloPosition

Description

Desired new value of Input ModuloPosition of the selected Derivator object

 

Data type

LREAL

 

Range

 

Unit

User unit

 

Default

Output

Default (.Q)

Description

Returns TRUE if the Input ModuloPosition value is changed

See more details here.

 

Data type

BOOL

 

Unit

N/A

Return Type

BOOL

Related Functions

MLDerReadInModPos

MLDerInit

Example

Structured Text

 

//change the input MODULO_POSITION of a Derivator object to 720

MLDerWriteInModPos ( PipeNetwork.MyDerivator, 720 );

 

Ladder Diagram

MLDerWriteInModPos: LD example

 

Function Block Diagram

MLDerWriteInModPos: FBD example

Go back to the top of the page [Top]