Motion Library - Derivator
-
-
For a description of the this pipe block and its parameters, see Pipe Blocks Description
Name |
Description |
Return type |
Initializes a derivator object |
BOOL |
|
Returns the input MODULO_POSITION of the Derivator block |
None |
|
Sets the input MODULO_POSITION of the Derivator block |
BOOL |
MLDerInit
Description
Initializes an derivator object. FunctionA 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.
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
Example
Structured Text
//Create and Initiate a Derivator object MyDerivator := MLBlkCreate( 'MyDerivator', 'DERIVATOR' ); MLDerInit( MyDerivator, 360.0 );
|
Ladder Diagram
Function Block Diagram
MLDerReadInModPos
Description
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.
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
Example
Structured Text
//save the current input MODULO_POSITION of a Derivator object DerInputPeriod := MLDerReadInModPos ( PipeNetwork.MyDerivator );
|
Ladder Diagram
Function Block Diagram
MLDerWriteInModPos
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
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
Example
Structured Text
//change the input MODULO_POSITION of a Derivator object to 720 MLDerWriteInModPos ( PipeNetwork.MyDerivator, 720 );
|
Ladder Diagram
Function Block Diagram