MLGearWriteRatSlp

Pipe Network motion icon

 Function - Sets the Ratio Slope value of a selected Gear Pipe Block.

  • Ratio Slope sets the limit at which step changes in ratio are implemented.
  • The GEAR block output adds a position offset to the GEAR block input when using a RatioSlope.
  • See RatioSlope Offset for examples.

    • Set the RatioSlope < (Ratio * EtherCAT Update Rate).
    • The Gear block makes a jump (without a ramp) from one gear to the next when the RatioSlope is greater than the Ratio change factor multiplied by the update rate scale factor.

Inputs

Input

Data Type

See Data Types.

Range

Unit

Default

Description

BlockID

DINT

1 to 1024

N/A

No default

ID number of an initialized Gear Pipe Block.

Slope

LREAL

No range

1/sec

No default

Input offset of a Gear Pipe Block.

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

Outputs

Output

Data Type

See Data Types.

Range

Unit

Description

Default (.Q)

BOOL

FALSE, TRUE

N/A

Remarks

RatioSlope Offset

With Offset

  • If MLGearWriteRatSlp is set as MLGearWriteRatSlp (PipeNetwork.GEAR1 12, Gear1RatioSlope 500.0); to generate a ramp (instead of a step) when going from a gear ratio of 1 to 2, there is a position offset when the gear ratio settles as 2.
  • In this image:
    • The ratio goes from 1.0 to 2.0.
    • Green is PN Gear Block Output.
    • Red is Gearbox Input.

  1. Green line: PN Gear Block Output.
  2. Red line: PN Gearbox Input.
  3. When the ratio changes.
  4. Phase difference.

Without Offset

If MLGearWriteRatSlp is set without a ramp, MLGearWriteRatSlp (PipeNetwork.GEAR1 12, Gear1RatioSlope 1e+301);, there is no offset.

  1. Green line: PN Gear Block Output.
  2. Red line: PN Gearbox Input.
  3. When the ratio changes.
  4. Synched.

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

//Set the Ratio Slope value of Gear1 Pipe Block to 100
MLGearWriteRatSlp(PipeNetwork.GEAR1, 100.0);

See Also