EasyManua.ls Logo

Cognex DataMan - Global Javascript Functions

Cognex DataMan
76 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
The script-based formatting has two main advantages:
l flexible result configuration
l configuring reader events before the result returns
Note: Script-based formatting limits the user to performing two custom events and overwriting the system event.
Global JavaScript Functions
The DMCC functions fall to three categories:
l Commands, for example to issue a beep or a re-boot
l Setter functions for properties
l Getter functions for properties
The functions make use of the variable arguments feature of the script engine. The types of the function arguments are
compared to the expected types defined by the DMCC commands. If the number of arguments or an argument type is
incorrect an error status is returned.
The functions return an object with a property for the status. If a command returns a response it can be accessed by the
response property. The status codes are the same as for the DMCC commands.
If a function executes successfully, a zero status value is returned. Script exceptions are not used.
To simplify the integration of DMCC commands in scripting, it is now possible to evaluate a DMCC command line as full
command string. It is not required to split the DMCC command into the type correct command arguments.
Note:
l The data formatting script function is executed after the output delay time or distance elapsed.
l All scripting functions run in a separate thread and the execution is mutual exclusive. It is not possible that a
script function is interrupted by another.
l Use [0,1] or [true,false] instead of [ON|OFF] when scripting.
DMCC Description
dmccGet Based on the DMCC implementation the response is always returned as a single string even for
multi-value responses.
dmccSet It supports multiple and type correct parameters.
dmccCommand N/A
dmccSend The functions evaluates a DMCC command. The return value contains the dmcc response type
containing status and response string. The function requires one string argument.
Example
var foo = dmccGet(”DECODER.ROI”);
The set command supports multiple and type correct parameters, for example:
dmccSet(”DECODER.ROI”, 16, 1280, 16, 1024);
Example
The following example uses the dmccSet functions to issue a beep signal, set the ftp server IP for image storage and
adds the MAC to the output response:
25
DataMan Application Development

Table of Contents

Other manuals for Cognex DataMan

Related product manuals