Motf Mode

Sets how MOTF position information is derived.

Syntax

Motf.Mode = Encoder.<mode>

 

Parameters

mode Encoder Sets the how to track position inputs

 

Copy
Example
-- This program demonstrates on-the-fly marking. Here a DataMatrix barcode is scanned.
-- The Barcode string is incremented by 1. 
SetUnits(Units.Millimeters)
-- Use MOTF Port 0
MOTF.Mode = Encoder.ExternalSingleAxis
-- Web direction
MOTF.Direction = Direction.BottomToTop
-- 10um linear resolution for example
encoderLinResInMmPerCount = 0.010
-- Bits/Mm * Mm/Count -> Bits/Count
MOTF.CalFactor = System.CalFactorY *
encoderLinResInMmPerCount

-- Initialize the MOTF settings
MOTF.Initialize()

-- Initialize laser/scan-head settings
Laser.MarkSpeed = 2000
Laser.MarkDelay = 200
Laser.JumpSpeed = 5000
Laser.JumpDelay = 200
Laser.Frequency = 20
Laser.DutyCycle1 = 50
Laser.Power = 50
Laser.LaserOnDelay = 75
Laser.LaserOffDelay = 125
Laser.PolyDelay = 50
Laser.VariPolyDelayFlag = true

--Variable initialization
serialNo = 105646
--Assign DataMatrix barcode to variable "code"
code = Barcodes.DataMatrix()
--Barcode height
code.Height = 10.0
--X coordinate
code.X = -5
--y coordinate
code.Y = -5
--Angle of the barcode
code.Angle = 0
--Matrix size is 16x16
code.MatrixSize = DataMatrixSize.S16x16
--Apply Dot hatch pattern (Options: Vertical Serpentine or horizontal or Helix filling pattern can be used)
code.HatchStyle = HatchStyle.Dot 
--Sets dot duration as 100
code.DotDuration = 100 
--Code format is Industry (Options: Default,Industry,macro_05,macro_06)
code.Format = DataMatrixFormat.Industry


function MarkBarcode() 
    --Assign serialNo variable to DataMatrix text string 
    barcodeText = "SN:"..serialNo
    code.Text = barcodeText
    --Mark DataMatrix code
    Image.Barcode(code)
    --Increments the Serial number by 1
    serialNo = serialNo+1
    --Display message "Mark Section Completed"
    Report("Marked bacode: " .. barcodeText)
end     
    
--Loop run continuously

-- Wait for this web travel before marking
partDistance = 50.

-- Wait for start signal
IO.WaitForIo(Pin.Din.UserIn1,Trigger.Edge.Rising, 0, 0, true)

-- Initialize to wait the initial distance
MOTF.ResetTracking()
System.Flush()
-- Repeat until aborted via external signal
while IO.ReadPin(Pin.Din.UserIn4) == false do
    MOTF.WaitForDistance(partDistance)
    -- Counters are automatically reset when WaitForDistance() releases
    MOTF.StartTracking(Tracking.WhileMarking)
    MarkBarcode()
    MOTF.StopTrackingAndJump(0, 0, 0, 200)
    Laser.WaitForEnd()
    -- Counters are still counting and distance being measured
end

Report ("Job Finished")

  

 

See Also