Logging data with comments
Overview
Output the logging data with comments.
Specification of this example
Behavior
Output the logging data with the measurement results of [Search] (Judge, Count, Correlation).
And add header, comments to it.
How to try this example
1.Click the link below, then the folder containing zip file automatically opens.
File
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 the logging data with the measurement results of [Search] is output.
The logging file is made for "C:\result.csv".
When the file is opened, the detail results is output.
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
*MCRINIT
WORKFOLDER$ = "C:\" '(1)
WORKFILE$ = "result.csv"
UNITNO& = 1
Open WORKFOLDER$ + WORKFILE$ FOR APPEND As #10 '(2)
Print #10, "Comment : Sample Program"
Print #10, " "
Print #10, "Judgement,Count,Correlation value"
Close #10
Return
*MEASUREPROC
JG& = UnitData(UNITNO&, "JG") '(3)
C& = UnitData(UNITNO&, "C")
CR& = UnitData(UNITNO&, "CR")
Open WORKFOLDER$ + WORKFILE$ FOR APPEND As #11 '(4)
Print #11, Str$(JG&) + "," + Str$(C&) + "," + Str$(CR&)
Close #11
Return
The macro program is in
this link.
Explanation
(1)Set the file path and reference unit number.
(2)Output the header.
It newly makes if there is no file, and it becomes a postscript in case of being.
(3)Get the measurement results of [Search].
(4)Output the results.