Output measurement time and results via the serial interface when measurement results is NG

Overview

Output measurement time and results via the serial interface when measurement results is NG.

Specification of this example


Behavior
When measurement results of [Gravity And Areat] is NG, Output measurement time and result(area) via the serial interface.

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. The measurement time and results is output via the serial interface when the measurement results is NG.

How to implement

Scene data
Unit No.
Processing Item
0.
Camera Image Input
1.
Gravity And Area
2.
Macro
The Macro Program below segment is to be set in '2.Macro'.
Macro Program
*MEASUREPROC
    MYUNIT& = UnitNo

    RECGJDG& = UnitData(MYUNIT& - 1, "JG")      '(1)

    If RECGJDG& = JUDGE_NG Then     
        AR# = UnitData(MYUNIT& - 1, "AR")       '(1)

        SENDDATA$ = Time$ + "/" + Str$(AR#)     '(2)

        SendString "SerialNormal" SENDDATA$

    EndIf
Return

The macro program is in refthis link.
Explanation
(1)Get measurement results of forward unit via external reference data.
(2)Make the string data.
(3)Output the string data via the serial interface.