MLSmpInit

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.

The purpose of the sampler block is to periodically sample and place into a pipe some output of a source object. The sampled output can typically be the POSITION or SPEED of a source object measured by a resolver, an encoder or some other types of sensorClosed A sensor is a type of transducer that converts one type of energy into another for various purposes including measurement or information transfer.

The sampler implements the logical connection between an encoder on a physical master axis (the source object) and one or more pipes and 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 a 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 also be programmed from within the Pipe Network block. Simply right-click on the block and select Properties.

Using AKD Secondary Feedback

Using AKD2G Additional Feedback

Place a Phaser Block (and write MLPhaWritePhase in the application code) or Gear Block (and write MLGearWriteOff ) after the Sampler Block to offset the Sampler Block Output Position in the Pipe Network.

Related Function Blocks

MLSmpConnect, MLSmpConECAT, MLSmpConPLCAxis, MLSmpConPNAxis

Arguments

Input

BlockID Description ID Name of the SMP function block in the Pipe Network
  Data type DINT
  Range [-2147483648, 2147483648]
  Unit N/A
  Default
SamplingPeriod Description period that the device is sampled
  Data type LREAL
  Range 0.25 to ?
  Unit millisecond
  Default 1.0
Mode Description Sampled output can be either position or velocity
  Data type DINT
  Range [1 , 2] Position or Speed
  Unit N/A
  Default position
InputModuloPosition Description 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)
  Data type LREAL
  Range
  Unit User unit
  Default 360.0
OutputModuloPosition Description Period of the output signal
  Data type LREAL
  Range
  Unit User unit
  Default 360.0

Output

Default (.Q) Description Smp Block successfully initiatedSee Function - General Rules for more information.
  Data type BOOL
  Unit N/A

FBD Language

MLSmpInit: FBD example

FFLD Language

MLSmpInit: LD example

ST Language

//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);