iMotion Library - Block

Name Description Return type
MLBlkCreate Creates a new Pipe Block object None
MLBlkIsReady Checks if a Pipe Block currently has a function running BOOL
MLBlkReadModPos Gets the value of the period of a block in user units None
MLBlkReadOutVal Gets the output value of a selected Pipe Block None
MLBlkWriteModPos Sets the value of the period of a block in user units BOOL

FunctionMLBlkCreatePipe Network motion icon

Description

Creates a new Pipe Block object. Before a Pipe Block is Initialized the block needs to be created and assigned an ID number. MLBlkCreate function block is automatically called if a Block is added to the Pipe Network.


  • Pipe Blocks are normally created in the Pipe Network using the graphical engine. Then you do not have to add MLBlkCreate function blocks to their programs. Blocks are created graphically, and the code with MLBlkCreate commands are automatically generated and called in a program with Pipe Network(MLPN_CREATE_OBJECTS).

Arguments

Input

Name

Description

Desired name for the newly created Pipe Block

 

Data type

String

 

Range

 

Unit

N/A

 

Default

Type

Description

Type of Pipe Block to create (ex. MASTER, GEAR, PHASER, etc.)

 

Data type

String

 

Range

 

Unit

N/A

 

Default

Output

ID

Description

Assigned ID number of the created Block

 

Data type

DINT

 

Unit

N/A

 

Default

Related Functions

PipeNetwork(MLPN_CREATE_OBJECTS)

MLAxisInit

Example

Structured Text

//Create a new  GEAR Pipe Block named “MyGear”
MyGear := MLBlkCreate( 'MyGear', 'GEAR' );

Ladder Diagram

MLBlkCreate: LD example

 

Function Block Diagram

MLBlkCreate: FBD example

Go back to the top of the page [Top]

 

FunctionMLBlkReadOutValPipe Network motion icon

Description

Get the output value a selected Pipe Block.

Arguments

Input

ID

Description

ID number of a created Pipe Block

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

Output

Value

Description

Current output value of the selected Pipe Block

 

Data type

LREAL

 

Unit

N/A

 

Default

Related Functions

MLBlkReadModPos

MLBlkCreate

Example

Structured Text

 

//Save the output of a Gear Pipe Block

BlockOutput := MLBlkReadOutVal( PipeNetwork.MyGear );

 

 

Ladder Diagram

MLBlkReadOutVal: LD example

Function Block Diagram

MLBlkReadOutVal: FBD example

Go back to the top of the page [Top]

FunctionMLBlkReadModPosPipe Network motion icon

Description

Get the value of the period of a block in user units. The output value of a block is reset each time it reaches its period value.

MLBlkReadModPos

Figure 7-65: MLBlkReadModPos

Arguments

Input

ID

Description

ID number of a created Pipe Block

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

Output

ModuloPosition

Description

Current Period Value for selected Pipe Block

 

Data type

LREAL

 

Unit

User unit

 

Default

Related Functions

MLBlkWriteModPos

MLBlkCreate

MLBlkReadOutVal

Example

Structured Text

 

//Return and save the Period of a Pipe Block

GearPeriod := MLBlkReadModPos( PipeNetwork.MyGear );

 

Ladder Diagram

MLBlkReadModPos: LD example

 

Function Block Diagram

MLBlkReadModPos: FBD example

Go back to the top of the page [Top]

FunctionMLBlkIsReadyPipe Network motion icon

Description

Check if a block is ready. Returns FALSE if the selected Pipe Block has a function running. Returns TRUE if no function of a specified Pipe Block is running.


  • Same return value as the .Q output of a specific function itself.

Arguments

Input

ID

Description

ID number of a created Pipe Block

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

Output

Default (.Q)

Description

Returns TRUE if no function of a specified Pipe Block is running.

See more details here.

 

Data type

BOOL

 

Unit

N/A

Return Type

BOOL

Related Functions

MLBlkReadOutVal

MLBlkReadModPos

Example

Structured Text

//Check if the MST Pipe Block named “MASTER” has a function running
IsReady := MLBlkIsReady( PipeNetwork.MASTER );

Ladder Diagram

MLBlkIsReady LD Figure

 

Function Block Diagram

MLBlkIsReady FBD Figure

Go back to the top of the page [Top]

FunctionMLBlkWriteModPosPipe Network motion icon

Description

Set the value of the period of a block in user units. The output value of a block is reset each time it reaches its period value.

MLBlkReadModPos

Figure 7-66: MLBlkReadModPos

Arguments

Input

ID

Description

ID number of a created Pipe Block

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

ModuloPosition

Description

Desired new Period Value for selected Pipe Block

 

Data type

LREAL

 

Range

 

Unit

User unit

 

Default

Output

Default (.Q)

Description

Returns TRUE if the function block executes

See more details here.

 

Data type

BOOL

 

Unit

N/A

Return Type

BOOL

Related Functions

MLBlkReadModPos

MLBlkCreate

MLBlkReadOutVal

Example

Structured Text

 

//Set the Period of a Pipe Block to 300

MLBlkWriteModPos( PipeNetwork.MyGear, 300 );

 

Ladder Diagram

MLBlkWriteModPos: LD example

 

Function Block Diagram

MLBlkWriteModPos: FBD example

Go back to the top of the page [Top]