FunctionMLMstAbsPipe Network motion icon

Description

Performs a move to an absolute position. Returns TRUE if the function succeeded.

Arguments

Input

BlockID

Description

ID name of the Master Block

 

Data type

DINT

 

Range

[-2147483648, 2147483648]

 

Unit

N/A

 

Default

Position

Description

Sets the value of the absolute destination position.
When the Modulo is turned on, see more explanations below.

 

Data type

LREAL

 

Range

 

Unit

User unit

 

Default

Position with Modulo On


  • This information applies to both MLMstAbs and MLAxisAbs. For simplicity, the term Axis Block also refers to Master Block.

When the Modulo is turned on, the Axis Block moves to the targeted position during the corresponding period, calculated as follows:

  • If the Position input is between 0 and the Modulo Position, then the Axis Block moves within the current period (no position rollover).
  • If the Position input is greater than the Modulo Position, then the Axis Block moves during one of the next period (positive position rollover).

The Axis Block works similarly for negative positions: if the Position input is less than zero, then the Axis Block moves during one of the previous period (negative position rollover).

Forcing the direction of rotation

In some applications, the direction of rotation for the axis is forced in one direction only. As a consequence, the motor movement goes to the next or previous modulo in the following situations:

  • If the End Position is less than the Start Position and the direction of rotation for the axis is forced to be clockwise (the red point shows when the modulo position is reached).

    (see an example in row#2 of the table below)
  • If the End Position is greater than the Start Position and the direction of rotation for the axis is forced to be counter clockwise.

    (see an example in row#4 of the table below)

Examples

Start Position End Position Direction of rotation Cross Modulo Position Input to MLAxisAbs (1) RelativeDistance Moved (2)
60 200 clockwise No 200 140 (i.e. 200 - 60 + 0)
60 30 clockwise Yes 390 330 (i.e. 30 - 60 + 360)
60 30 counter clockwise No 30 -30 (i.e. 30 - 60 - 0)
60 200 counter clockwise Yes -160 -220 (i.e. 200 - 60 - 360)

With:

(1) Position Input = End Position ( + Modulo * Direction of rotation)

 

(2) Relative Distance Moved = End Position - Start Position ( + Modulo * Direction of rotation)

Where:

Direction of rotation = 1 when clockwise and -1 when anti-clockwise

Travel Speed Update with MLAxisAbs

The travel speed of the generator can be updated using the function block MLAxisGenWriteSpd. Depending on the state of the generator, this speed is directly reflected on the current move or a future move.

Following are several examples.

  1. First MLAxisAbs
  2. Second MLAxisAbs
  3. Initial Speed
  4. New Speed

Figure 7-100: Initial speed is smaller than the new speed

  1. First MLAxisAbs
  2. Second MLAxisAbs
  3. Initial Speed
  4. New Speed

Figure 7-101: Initial speed is bigger than the new speed

  1. Acceleration
  2. Constant Velocity
  3. Deceleration

Figure 7-102: The speed update is taken into account only if the second MLAxisAbs is triggered during acceleration or constant velocity

Output

Default (.Q)

Description

Returns true when function successfully executes

See more details here.

 

Data type

BOOL

 

Unit

N/A


  • To reduce the load on the CPU, call MLMstAbs only once for each move. This can be achieved by adding a control variable, which is illustrated below.

              // Master: modulo is on and modulo range is 0 - 360 with rollover at 360
              
    If Not MoveStarted Then
         Position := 500;
         MLMstAbs( PipeNetwork.MASTER, Position);
         MovesStarted := TRUE;
    End_if;	

  • Perform one of the following to prevent undesired axis movement if modulo is turned on.

    • Verify that the Position value is within the modulo range.
    • If the Position value is outside of the modulo range, call MLMstAbs function only once. See the TIP above for an example of how to do this.

Related Functions

MLMstWriteSpeed

MLMstWriteDecel

Examples

Structured Text

//Make an absolute positon move with a Master block called “MASTER” to position 1000.0
MLMstAbs( PipeNetwork.MASTER, 1000.0 );

Ladder Diagram

MLMstAbs: LD example

 

Function Block Diagram

MLMstAbs: FBD example

Go back to the top of the page [Top]