idMotion Library - Adder

Name

Description

Return type

MLAddInit

Initializes an Adder Pipe Block with user-defined settings

BOOL

MLAddReadOff1

Returns the offset value of the first entry of an Adder block

None

MLAddReadOff2

Returns the offset value of the second entry of an Adder block

None

MLAddReadRatio1

Returns the ratio value of the first entry of an Adder block

None

MLAddReadRatio2

Returns the ratio value of the second entry of an Adder block

None

MLAddWriteInput

Sets the source of an input of an adder Pipe Block

BOOL

MLAddWriteOff1

Sets the offset value of the first entry of the Adder block

BOOL

MLAddWriteOff2

Sets the offset value of the second entry of the Adder block

BOOL

MLAddWriteRat1

Sets the ratio value of the first entry of the Adder block

BOOL

MLAddWriteRat2

Sets the ratio value of the second entry of the Adder block

BOOL

FunctionMLAddInitPipe Network motion icon

Description

Initializes an Adder Pipe Block for use in a PLCClosed"Programmable Logic Controller" A Programmable Logic Controller, PLC, or Programmable Controller is a digital computer used for automation of industrial processes, such as control of machinery on factory assembly lines. Used to synchronize the flow of inputs from (physical) sensors and events with the flow of outputs to actuators and events Program. 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 an Adder Block is added to the Pipe Network, with user-defined settings entered in the Pipe Blocks Properties screen.

The Pipe Block is assigned ratios and offsets for both inputs. After an Adder block is initialized, the inputs still need to be selected using the MLAddWriteInput function block or graphically using the Pipe Network.

Adder Block Output = Ratio1*Input1 + Offset1 + Ratio2*Input2 + Offset2

MLAddInit

Figure 7-67: MLAddInit


  • Adder objects are normally created in the Pipe Network using the graphical engine. Then you do not have to add MLAddInit 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

Ratio1

Description

Sets the Ratio value of the first entry of an Adder object

 

Data type

LREAL

 

Range

 

Unit

N/A

 

Default

Offset1

Description

Sets the Offset value of the first entry of an Adder object

 

Data type

LREAL

 

Range

 

Unit

N/A

 

Default

Ratio2

Description

Sets the Ratio value of the second entry of an Adder object

 

Data type

LREAL

 

Range

 

Unit

N/A

 

Default

Offset2

Description

Sets the Offset value of the second entry of an Adder object

 

Data type

LREAL

 

Range

 

Unit

N/A

 

Default

Output

Default (.Q)

Description

Returns TRUE if the Adder Pipe Block is initialized.

See more details here.

 

Data type

BOOL

 

Unit

N/A

Return Type

BOOL

Related Functions

MLBlkCreate

MLAddWriteInput

MLAddReadOff1

MLAddReadRatio1

Example

Structured Text

 

//Create and Initiate a Trigger object

MyAdder := MLBlkCreate( 'MyAdder', 'ADDER' );

MLAddInit( MyAdder, 1.0, 0.0, 1.0, 0.0 );

 

Ladder Diagram

MLAddInit: LD example

 

Function Block Diagram

MLAddInit: FBD example

Go back to the top of the page [Top]

 

FunctionMLAddReadOff1Pipe Network motion icon

Description

Returns the offset value of the first entry of an Adder block. Can change the offset value with MLAddWriteOff1 function block. Offset1 shifts the value of the first input to the block before its added to the second input.

Adder Block Output = Ratio1*Input1 + Offset1 + Ratio2*Input2 + Offset2

MLAddReadOff1

Figure 7-68: MLAddReadOff1

Arguments

Input

BlockID

Description

ID number of an initiated Adder object

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

Output

Offset

Description

Returns the offset value of the first entry of an Adder object

 

Data type

LREAL

 

Unit

N/A

Related Functions

MLAddWriteOff1

MLAddReadOff2

MLAddReadRatio1

MLAddWriteRat1

Example

Structured Text

 

//Save the offset value of first entry to the Adder block

AdderOffset := MLAddReadOff1( PipeNetwork.MyAdder );

 

Ladder Diagram

MLAddReadOff1: LD example

 

Function Block Diagram

MLAddReadOff1: FBD example

Go back to the top of the page [Top]

 

FunctionMLAddReadOff2Pipe Network motion icon

Description

Returns the offset value of the second entry of an Adder block. Can change the offset value with MLAddWriteOff2 function block. Offset2 shifts the value of the second input to the block before its added to the first input.

Adder Block Output = Ratio1*Input1 + Offset1 + Ratio2*Input2 + Offset2

MLAddReadOff2

Figure 7-69: MLAddReadOff2

Arguments

Input

BlockID

Description

ID number of an initiated Adder object

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

Output

Offset

Description

Returns the offset value of the second entry of an Adder object

 

Data type

LREAL

 

Unit

N/A

Related Functions

MLAddWriteOff2

MLAddReadOff1

MLAddReadRatio2

MLAddWriteRat2

Example

Structured Text

 

//Save the offset value of second entry to the Adder block

AdderOffset := MLAddReadOff2( PipeNetwork.MyAdder );

 

Ladder Diagram

MLAddReadOff2: LD example

 

Function Block Diagram

MLAddReadOff2: FBD example

Go back to the top of the page [Top]

FunctionMLAddReadRatio1Pipe Network motion icon

Description

Returns the ratio value of the first entry of an Adder block. Can change the ratio value with MLAddWriteRat1 function block. Ratio1 amplifies the value of the first input to the block before its added to the second input.

Adder Block Output = Ratio1*Input1 + Offset1 + Ratio2*Input2 + Offset2

MLAddReadRatio1

Figure 7-70: MLAddReadRatio1

Arguments

Input

BlockID

Description

ID number of an initiated Adder object

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

Output

Ratio

Description

Returns the Ratio value of the first entry of an Adder object

 

Data type

LREAL

 

Unit

N/A

Related Functions

MLAddWriteRat1

MLAddReadRatio2

MLAddReadOff1

MLAddReadOff2

Example

Structured Text

 

//Save the ratio value of first entry to the Adder block

AdderRatio := MLAddReadRatio1( PipeNetwork.MyAdder );

 

Ladder Diagram

MLAddReadRatio1: LD example

 

Function Block Diagram

MLAddReadRatio1: FBD example

Go back to the top of the page [Top]

FunctionMLAddReadRatio2Pipe Network motion icon

Description

Returns the ratio value of the second entry of an Adder block. Can change the ratio value with MLAddWriteRat2 function block. Ratio2 amplifies the value of the second input to the block before its added to the first input.

Adder Block Output = Ratio1*Input1 + Offset1 + Ratio2*Input2 + Offset2

MLAddReadRatio2

Figure 7-71: MLAddReadRatio2

Arguments

Input

BlockID

Description

ID number of an initiated Adder object

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

Output

Ratio

Description

Returns the Ratio value of the second entry of an Adder object

 

Data type

LREAL

 

Unit

N/A

Related Functions

MLAddWriteRat2

MLAddReadRatio1

MLAddReadOff1

MLAddReadOff2

Example

Structured Text

 

//Save the ratio value of second entry to the Adder block

AdderRatio := MLAddReadRatio2( PipeNetwork.MyAdder );

 

Ladder Diagram

MLAddReadRatio2: LD example

 

Function Block Diagram

MLAddReadRatio2: FBD example

 

Go back to the top of the page [Top]

FunctionMLAddWriteInputPipe Network motion icon

Description

Sets the source of an input of an adder Pipe Block. Function block is automatically called if an Adder Block is connected to other blocks in the Pipe Network.

Adder Block Output = Ratio1*Input1 + Offset1 + Ratio2*Input2 + Offset2

MLAddWriteInput

Figure 7-72: MLAddWriteInput


  • Adder objects are normally created in the Pipe Network using the graphical engine. Then you do not have to add MLAddWriteInput function blocks to their programs. Blocks are connected with lines in the Pipe Network, and the code is then automatically added to the current project.

Arguments

Input

BlockID

Description

ID number of an initiated Adder object

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

InputID

Description

Select first or second input to the Adder object

 

Data type

DINT

 

Range

[1, 2]

 

Unit

N/A

 

Default

InputBlockID

Description

ID number of an initiated Pipe Block which is an input to the Adder object

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

Output

Default (.Q)

Description

Returns TRUE if the input to the Adder object is set

See more details here.

 

Data type

BOOL

 

Unit

N/A

Return Type

BOOL

Related Functions

MLBlkCreate

MLAddInit

MLAddReadOff1

MLAddReadRatio1

Example

Structured Text

//Set the first input of an Adder pipeblock to be connected to the output of GEAR1 pipeblock
MLAddWriteInput( PipeNetwork.ADDER, 1, PipeNetwork.GEAR1 );

Ladder Diagram

MLAddWriteInput: LD example

Function Block Diagram

MLAddWriteInput: FBD example

Go back to the top of the page [Top]

FunctionMLAddWriteOff1Pipe Network motion icon

Description

Set the offset value of the first entry of the Adder block. Offset1 shifts the value of the first input to the block before its added to the second input.

Adder Block Output = Ratio1*Input1 + Offset1 + Ratio2*Input2 + Offset2

MLAddWriteOff1

Figure 7-73: MLAddWriteOff1


  • Changes made to the Offset of an Adder block are executed immediately and can cause an axis position to jump.

Arguments

Input

BlockID

Description

ID number of an initiated Adder object

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

Offset

Description

Desired new value for the Adder Object's Offset1

 

Data type

LREAL

 

Range

 

Unit

N/A

 

Default

Output

Default (.Q)

Description

Returns TRUE if the Offset value for input one is set

See more details here.

 

Data type

BOOL

 

Unit

N/A

Return Type

BOOL

Related Functions

MLAddReadOff1

MLAddWriteOff2

MLAddReadRatio1

MLAddWriteRat1

Example

Structured Text

 

//Change the offset value of first entry to the Adder block to 10

MLAddWriteOff1( PipeNetwork.MyAdder, 10 );

 

Ladder Diagram

MLAddWriteOff1: LD example

 

Function Block Diagram

MLAddWriteOff1: FBD example

Go back to the top of the page [Top]

FunctionMLAddWriteOff2Pipe Network motion icon

Description

Set the offset value of the second entry of the Adder block. Offset2 shifts the value of the second input to the block before its added to the first input.

Adder Block Output = Ratio1*Input1 + Offset1 + Ratio2*Input2 + Offset2

MLAddWriteOff2

Figure 7-74: MLAddWriteOff2


  • Changes made to the Offset of an Adder block are executed immediately and can cause an axis position to jump.

Arguments

Input

BlockID

Description

ID number of an initiated Adder object

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

Offset

Description

Desired new value for the Adder Object's Offset2

 

Data type

LREAL

 

Range

 

Unit

N/A

 

Default

Output

Default (.Q)

Description

Returns TRUE if the Offset value for input two is set

See more details here.

 

Data type

BOOL

 

Unit

N/A

Return Type

BOOL

Related Functions

MLAddReadOff2

MLAddWriteOff1

MLAddReadRatio2

MLAddWriteRat2

Example

Structured Text

 

//Change the offset value of second entry to the Adder block to 10

MLAddWriteOff2( PipeNetwork.MyAdder, 10 );

 

Ladder Diagram

MLAddWriteOff2: LD example

 

Function Block Diagram

MLAddWriteOff2: FBD example

Go back to the top of the page [Top]

FunctionMLAddWriteRat1Pipe Network motion icon

Description

Set the ratio value of the first entry of the Adder block. Ratio1 amplifies the value of the first input to the block before its added to the second input.

Adder Block Output = Ratio1*Input1 + Offset1 + Ratio2*Input2 + Offset2

MLAddWriteRat1

Figure 7-75: MLAddWriteRat1


  • Changes made to the Ratio of an Adder block are executed immediately and can cause an axis position to jump.

Arguments

Input

BlockID

Description

ID number of an initiated Adder object

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

Ratio

Description

Desired new value for the Adder Object's Ratio1

 

Data type

LREAL

 

Range

 

Unit

N/A

 

Default

Output

Default (.Q)

Description

Returns TRUE if the Ratio value for input one is set

See more details here.

 

Data type

BOOL

 

Unit

N/A

Return Type

BOOL

Related Functions

MLAddReadRatio1

MLAddWriteRat2

MLAddReadOff1

MLAddWriteOff1

Example

Structured Text

 

//Change the ratio value of first entry to the Adder block to 2

MLAddWriteRat1( PipeNetwork.MyAdder, 2 );

 

Ladder Diagram

MLAddWriteRat1: LD example

 

Function Block Diagram

MLAddWriteRat1: FBD example

Go back to the top of the page [Top]

FunctionMLAddWriteRat2Pipe Network motion icon

Description

Set the ratio value of the second entry of the Adder block. Ratio2 amplifies the value of the second input to the block before its added to the first input.

Adder Block Output = Ratio1*Input1 + Offset1 + Ratio2*Input2 + Offset2

MLAddWriteRat2

Figure 7-76: MLAddWriteRat2\


  • Changes made to the Ratio of an Adder block are executed immediately and can cause an axis position to jump.

Arguments

Input

BlockID

Description

ID number of an initiated Adder object

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

Ratio

Description

Desired new value for the Adder Object's Ratio2

 

Data type

LREAL

 

Range

 

Unit

N/A

 

Default

Output

Default (.Q)

Description

Returns TRUE if the Ratio value for input two is set

See more details here.

 

Data type

BOOL

 

Unit

N/A

Return Type

BOOL

Related Functions

MLAddReadRatio2

MLAddWriteRat1

MLAddReadOff2

MLAddWriteOff2

Example

Structured Text

 

//Change the ratio value of second entry to the Adder block to 2

MLAddWriteRat2 ( PipeNetwork.MyAdder, 2 );

 

Ladder Diagram

MLAddWriteRat2: LD example

 

Function Block Diagram

MLAddWriteRat2: FBD example

Go back to the top of the page [Top]