MLSmpInit

Pipe Network motion icon

 Function - Initializes a sampler object.

Inputs

Input

Data Type

Range

Unit

Default

Description

BlockID

DINT

-2147483648 to 2147483647

N/A

No default

ID Name of the SMP function block in the Pipe Network.

SamplingPeriod

LREAL

0.25 to ?

Millisecond

No default

Period that the device is sampled.

Mode

DINT

1, 2

Position or Speed

N/A

No default

Sampled output can be either Position or Velocity.

InputModuloPosition

LREAL

No range

User units

No default

Period of the input signal.

The value set depends upon the device used.

  • AKD: This should be set equal to 232 (4294967296.0).
  • AKD2G: The value should be set based on the feed constant value assigned in the EtherCAT object 0x60E4 subindex 1-5.
    • The default feed constant value is 216 (65536)

OutputModuloPosition

LREAL

No range

User units

No default

Period of the output signal.

Outputs

Output

Data Type

Range

Unit

Description

Default (.Q)

BOOL

FALSE, TRUE

N/A

SMP Block successfully initiated.

See Function - General Rules.

Remarks

  • This sampler block is used to periodically sample and place into a pipe some output of a source object.
    • The sampled output can be the POSITION or SPEED of a source object measured by a resolver, an encoder, or some other types of sensor.
  • The sampler implements the logical connection between:
    • An encoder on a physical master axis (the source object).
    • One or more pipes.
    • It performs the function of periodically sampling the source and placing the sampled values into the pipe.
  • This function block is automatically called by the Function PipeNetwork(MLPN_CREATE_OBJECTS) if an SMP Block is added to the Pipe Network, with user-defined settings entered in the Pipe Blocks Properties screen.
  • The SMP Pipe Block is assigned a Name, SAMPLING_PERIOD, MODE, INPUT_VALUE_PERIOD, and OUTPUT_VALUE_PERIOD.
  • This function can be programmed from within the Pipe Network block.
    Right-click the block and click Properties.
  • To offset the Sampler Block Output Position in the Pipe Network either:
    • Place a Phaser Block (and write MLPhaWritePhase in the application code).
    • Place a Gear Block (and write MLGearWriteOff ) after the Sampler Block.

Use AKD Secondary Feedback

Use AKD2G Additional Feedback

  • The Sampler can be connected to the secondary feedback on the AKD using MLSmpConPNAxis.
  • The scaling for the AKD Secondary Feedback is setup using AKD Parameters: DRV.HANDWHEEL and FB2.ENCRES.
  • The feedback signal comes through EtherCAT in object 0x2050.
  • The scaling for this position signal is 0 to 4294967296 = 0 to FB2.ENCRES.
    • Object 0x2050 rolls over to 0 when reaching 4294967296.
  • The Sampler can be connected to the additional feedback (1-5) on the AKD2G using MLSmpConPNAxis.
    • See the AKD2GFeedback Settings section for setting up the additional feedback type and resolution.
  • The default feed constant value in the KAS-IDE is scaled to 65536.
    • This feed constant value can be changed using EtherCAT object 0x60E9 subindex 1-5.
  • The feedback signal comes through EtherCAT in object 0x60E4 subindex 1-5.

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

//Initialize  a Sampler Pipe Block named “EncoderMaster1” to a Sample Period of 1 millisec, Mode of Operation to 2(Velocity), Input Modulo of 4294967296, and Output Modulo of 720
MLSmpInit( PipeNetwork.EncoderMaster1, 1.0,2,4294967296,720);

See Also