EasyManua.ls Logo

Cognex DataMan - Decodeevents

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...
function onResult (decodeResults, readerProperties, output)
{
if (decodeResults[0].decoded)
{
var mymsg = decodeResults[0].content;
// output[’Serial’] is identical to output.Serial
output[’Serial’] = ”serial: ”+mymsg;
output.Telnet = telnet: ”+mymsg;
output.content = mymsg;
}
else
{
output.content = bad read”;
}
}
Note: For every channel that is not addressed in special, the output is the normal content text. For example:
function onResult (decodeResults, readerProperties, output)
{
if (decodeResults[0].decoded)
{
/* save decoded result to variable */
var mymsg = decodeResults[0].content;
/* output to telnet channel a different result
*/
output.Telnet = "telnet: " + mymsg;
/* to all other channel output the saved
result */
output.content = mymsg;
}
else
{
/* On bad read output to all channels the same
*/
output.content = "bad read";
}
}
DecodeEvents
Describes the events to be emitted after a decode.
Property Type Description
system
integer
These are the system generated events:
l 0 = none
l 1 = good read
l 2 = no read
l 3 = validation failure*
50
DataMan Application Development

Table of Contents

Other manuals for Cognex DataMan

Related product manuals