Edit the list of position

Overview

This sample edits the list of position.

Specification of this example


Behavior
This sample edits the list of position and displays the list in Text Window.

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 edits the list of position and displays the list in Text Window.
The list is repeat this cycle, Unit No.(1, 2), (2, 3), (1, 3), (1, 2), ...

How to implement

Scene data
Unit No.
Processing Item
0.
Camera Image Input
1.
Gravity and Area
2.
Labeling
3.
ECM Search
4.
Macro
The Macro Program below segment is to be set in '4.Macro'.
Macro Program
*MCRINIT

    INDEX& = 0         '(1)
    UNITNO1& = 1
    UNITNO2& = 2
    UNITNO3& = 3

Return

*MEASUREPROC
    Dim UNITNOS&(1)

    '(2)
    If INDEX& = 0 Then
        UNITNOS&(0) = UNITNO1&
        UNITNOS&(1) = UNITNO2&
    Elseif INDEX& = 1 Then
        UNITNOS&(0) = UNITNO2&
        UNITNOS&(1) = UNITNO3&
    Else
        UNITNOS&(0) = UNITNO3&
        UNITNOS&(1) = UNITNO1&
    EndIf

    INDEX& = INDEX& + 1      '(4)
    If INDEX& = 3 Then 
        INDEX& = 0
    EndIf

Return

*MEASUREDISPG

    MeasureDispG UNITNOS&(0), 0
    MeasureDispG UNITNOS&(1), 0

Return

*MEASUREDISPT

    Select INDEX&         '(3)
        Case 0
        MESSAGE$ = "UNIT No.1, 2"
        Case 1
        MESSAGE$ = "UNIT No.2, 3"
        Case 2
        MESSAGE$ = "UNIT No.1, 3"
    End Select

    DrawText "Display the measurement result of", 1, 1
    DrawText MESSAGE$, 1, 2

Return

The macro program is in refthis link.
Explanation
(1)Initialize parameters(ex.first Unit No. of the list of position) when initialize measurement.
(2)Set the list of position, and display the position.
(3)Display the Unit No. of the list in Text Window.
(4)Set the next sequence number of the list.