MLGearInit

Pipe Network motion icon

 FunctionClosed A 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. - Initializes a Gear Pipe Block with user-defined settings and for use in a PLCClosed Programmable Logic Controller - 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. programClosed The act of performing a sequence of instructions or commands..

Inputs

Input

Data Type

Range

Unit

Default

Description

BlockID

DINT

-2147483648 to 2147483647

N/A

GEAR

ID number of a created Pipe Block.

Ratio

LREAL

No range

N/A

1.0

Ratio of new Gear Pipe Block.

  • Values lower then 1.0 can be entered, but require a leading 0 (zero).
  • Example: 0.8 instead of .8.

Offset

LREAL

No range

N/A

0.0

Offset of new Gear Pipe Block.

  • Values lower then 1.0 can be entered, but require a leading 0 (zero).
  • Example: 0.8 instead of .8.

UseUserRatioSlope

BOOL

0, 1

N/A

FALSE

FALSE to use the maximum Slope.

  • FALSE causes an instantaneous gear change within one cycle.
  • Use TRUE to use user-defined RatioSlope.

RatioSlope

LREAL

No range

1/sec

0.0

User-defined limit at which step changes in Ratio are implemented.

  • Values lower then 1.0 can be entered, but require a leading 0 (zero).
  • Example: 0.8 instead of .8.

UseUserOffsetSlope

BOOL

0, 1

N/A

FALSE

FALSE to use the maximum Slope.

  • FALSE causes an instantaneous gear change within one cycle.
  • Use TRUE to use user-defined OffsetSlope.

OffsetSlope

LREAL

No range

User unit/sec

0.0

User-defined limit at which step changes in Offset are implemented.

  • Values lower then 1.0 can be entered, but require a leading 0 (zero).
  • Example: 0.8 instead of .8.

Modulo

BOOL

0, 1

N/A

FALSE

TRUE when the mode is modulo.

Modulo mode adapts the output values according to the ModuloPosition (modulo).

Outputs

Output

Data Type

Range

Unit

Description

Default (.Q)

BOOL

 

 

Returns TRUE if the Gear Pipe Block is initialized.

Remarks

Modulo Value

If the Gear block's input is a modulo value and the positionClosed Position means a point in space which is described by different coordinates. Depending on the used system and transformation it can consist of a maximum of six dimensions (coordinates).This means three Cartesian coordinates in space and coordinates for the orientation. In ACS there can be even more than six coordinates. If the same position is described in different coordinate systems the values of the coordinates are different. delta is greater than ½, the modulo value within one sample periodClosed Motor systems having a reciprocating or oscillating motor that operates synchronously with the periodicity of the source which supplies the electrical energy. The period of execution of a pipe is the time spent between two successive computations of set values for the same pipe. The period of execution of a pipe is specified by the PERIOD parameter of the input pipe block. in the opposite directionClosed The orientation components of a vector in space., the Gear block cannot detect the change in the direction of motion.

Example

  • The sample period is: 1 msec.
  • The Master is configured for a 360 degree modulo.
  • The Master position is changed by >180 degrees within 1 msec.
    • In this case, the Gear block cannot determine whether the direction is in the same or opposite direction.

Avoid Modulo Calculation Problems

  • Either deactivate and reactivate the PipeNetwork when forcing the Master position with MLMstForcePos.
  • Use a MLMstAbs or MLMstRel move to force the Master’s position value.

Example

To force the Master position to 0 (zero), use this code:

PipeNetwork(MLPN_DEACTIVATE);
MLMstForcePos(PipeNetwork.MASTER, 0);
PipeNetwork(MLPN_ACTIVATE);

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

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

//Initialize a Gear Pipe Block named GEAR1 with:
// Ratio = 1,Offset = 0, User Ratio Slope OFF, User Ratio
// Slope = 0, Offset Slope = 0, and no Modulo
GEAR1 := MLBlkCreate( 'GEAR1', 'GEAR' );
MLGearInit( GEAR1, 1.0, 0.0, false, 0.0, false, 0.0, false);

See Also