Execute measurement with different regions continuously(use multiple processing units)

Overview

This sample executes measurement with different regions continuously.

Specification of this example


Behavior
This sample sets multiple [Scan Edge Width] in this flow, and set regions whose position are differ in regular intervals.
It is useful for measurement when there are same works at regular intervals.

Screenshot


How to try this example
1.Click the link below, then the folder containing zip file automatically opens.
refFile

2.Right-click and hold on the zip file, and drop it on working window of FJ system. The images and scene data in zip file are loaded on the program automatically.

3.Re-measure the image. Then System automatically sets the regions of[Scan Edge Width] whose position are differ in regular intervals.

4.Executes measurements of [Scan Edge Width] continuously.

How to implement

Scene data
Unit No.
Processing Item
0.
Camera Image Input
1.
Macro
2.
Scan Edge Width
3.
Scan Edge Width
4.
Scan Edge Width
5.
Scan Edge Width
6.
Scan Edge Width
7.
Scan Edge Width
The Macro Program below segment is to be set in '1.Macro'.
Macro Program
*MCRINIT

    UNITNO& = 2         '(1)
    CPYFIGNO& = 0
    UNITCOUNT& = 5
    OFFSETX& = 100
    OFFSETY& = 0

Return

*MEASUREPROC

    Dim FIGDATA&(30)

    GetUnitFigure UNITNO&, CPYFIGNO&, FIGDATA&()    '(2)

    For INDEX& = 1 To UNITCOUNT&
        FIGDATA&(2) = FIGDATA&(2) + OFFSETX&        '(3)
        FIGDATA&(4) = FIGDATA&(4) + OFFSETX&
        FIGDATA&(3) = FIGDATA&(3) + OFFSETY&
        FIGDATA&(5) = FIGDATA&(5) + OFFSETY&

        SetUnitFigure UNITNO& + INDEX& , CPYFIGNO&, FIGDATA&() '(4)
    Next

Return

The macro program is in refthis link.
Explanation
(1)Initialize parameters (ex.offset value of moving region ) when initialize measurement.
(2)Get the region of the original processing unit.
(3)Set the position of regions to move from the position of original processing unit by offset value.
(4)Set the regions to other processing units.