Display date and time

Overview

Display date and time in Image Window if judgement result is NG.

Specification of this example


Behavior
When measurement ends, display date and time in the Image Window if judgement result is NG.

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. In case judgement is NG, displayed date and time in Image Window is updated.

How to implement

Scene data
Unit No.
Processing Item
0.
Camera Image Input
1.
Search
2.
Macro
The Macro Program below segment is to be set in '2.Macro'.
Macro Program
*MEASUREPROC
Return

*MEASUREDISPG
    MYUNIT& = UnitNo

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

    If RECGJDG& = JUDGE_NG Then                                                       '(2)
        SetTextStyle 20, TA_TOP, JUDGE_NG, 0, FONTSTYLE_BOLD + FONTSTYLE_UNDERLINE
        DrawTextG Date$ + " " + Time$, 10, 10, 0
    EndIf
Return

The macro program is in refthis link.
Explanation
(1)Get judgement result of forward unit via external reference data.
(2)Set font style by [SetTextStyle] command.
(3)Draw date and time by [DrawTextG] command.