Macro examples

These are the example programs which can be loaded on Macro unit.

List of Macro examples

refDraw a figure on Image Window
refCalculate the approximate outer circumference of a circular workpiece
refRe-register a model automatically at result NG
refMake an average of last five times of measurement result and display it in Image Window
refCalculate corner positions of a square workpiece
refCalculate the shortest distance between line and point
refCalculate the variations of the measurement result
refSet calibration parameter via external reference data
refLogging data with comments
refDisplay measurement results of selected processing unit in Image Window
refDisplay date and time
refDisplay last NG image with the processing unit title which caused last NG
refDisplay the measurement results of multiple processing units at once
refDisplay the measurement result graphically
refCount the number of mesurement results OK/NG and display it in Image Window
refCount the number of mesurement results OK/NG and display it in Text Window
refDraw the graphic of measurement result of any processing unit
refDisplay the measurement result by other symbols
refDisplay the measurement results of the units of specified processing item
refDisplay warning message when the NG judgement result continues twice
refDisplay the measurement result with emphasis
refDisplay the last ten times of NG results
refShow the measurement result with classification
refDraw the center line
refDraw the dash line
refDraw figures on an image after scroll
refExecute measurement with different regions continuously(use multiple processing units)
refMeasure of each workpiece after classifiering the kind of workpieces
refExecute measurement with different edge level
refMeasure multiple images at once
refMemory the number of counts
refAdapt [Filtering] to images multiply
refExecute multiple camera image input and measurement at one measurement trigger
refAdd Header and Footer when output data via the serial interface
refRepeat the measurement until the result is OK
refRepeat the measurements
refRound off measurement results and display
refSave the measurement result of labeling to a file in csv format
refSave the measurement results per minutes in txt format
refSearch Processing Unit by its unit title
refOutput the hexadecimal number via the serial interface
refOutput measurement time and results via the serial interface when measurement results is NG
refOutput the tag data via the serial interface
refEdit the list of position
refSet the parameter of region of multiple processing units at once
refSet the parameter and region setting of the processing unit from the measurement result of other processing unit
refChange the parameter of the same processing unit name collectively
refSet a threshold of the binary level by the average of the measurement result
refSort by the outline
refSync the unit number which using by Macro with flow editing
refRefer to a common value to the scene by the global data
refChange scene by clicking buttons whose background is the workpiece image
refDisplay a ruler in FJ screen
refSet the same unit parameter collectively
refUse Printer
refWait for specified time

How to use Macro examples

At first, read paragraph "Specification" in each articles, and try the examples.
Get zip file from the link, and drag&drop on FJ screen. Then demo tool appears and setting data containing Macro is loaded automatically.

Using demo tool, select images and make a measurement. Switching scenes or changing display view are also available from FJ screen.

After that, read "How to implement" and understand the way of implementation.

From Flow window, you can open Macro Editor by selecting Macro unit.

Try to modify macro program, and see how the behavior changes.
IMPORTANT
The programs developed by modifying or utilizing these code samples shall be used at your own risk.
These sample codes have only limited functions since they are developed focusing on readability. Please add the functions and error handlings required in your environment to use them.