FunctionMLSmpInitPipe Network motion icon

Description

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 sensorClosedA 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 FunctionClosedA 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. 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 PipeNetwork block. Simply right-click on the block and select Properties.

Using AKD Secondary Feedback Using 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 EtherCATClosedEtherCAT is an open, high-performance Ethernet-based fieldbus system. The development goal of EtherCAT was to apply Ethernet to automation applications which require short data update times (also called cycle times) with low communication jitter (for synchronization purposes) and low hardware costs 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. Please refer to the AKD2G Feedback section for setting up the additional feedback type and resolution.

The default feed constant value in the KAS IDEClosed"Integrated development environment" An integrated development environment is a type of computer software that assists computer programmers in developing software. IDEs normally consist of a source code editor, a compiler and/or interpreter, build-automation tools, and a debugger 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.

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 PipeNetwork.

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 initiated

See more details here.

  Data type BOOL
  Unit N/A

Example

Structured Text

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

Ladder Diagram

MLSmpInit: LD example

Function Block Diagram

MLSmpInit: FBD example

Go back to the top of the page [Top]