EasyManua.ls Logo

Cognex DataMan - Page 56

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 CommHandler()
{
// private properties and methods:
var num_trigger = 0;
var num_send;
// public properties and methods:
function onTimeout()
{
num_send = this.send(my_name + ': timer callback\r\n');
this.setTimer(1.0);
}
function onTimeout2()
{
today = new Date();
var msg = today.getSeconds() * 1000 + today.getMilliseconds();
num_send = this.send(my_name + ': time is: ' + msg + '\r\n');
dmccCommand("TRIGGER", true);
this.setTimer(1.0);
}
function replace_crlf(input_str)
{
return input_str.replace(/\r/g, '\\r').replace(/\n/g, '\\n');
}
return {
onConnect: function (peerName)
{
my_name = peerName;
// we may ignore the connection
if(my_name == "COM1")
return false;
num_send = this.send(my_name + ": connected\r\n");
this.expectFramed("#", ";\r\n", 64);
return true;
},
onDisconnect: function ()
{
},
onExpectedData: function (inputString) {
var msg = 'ok';
this.expectFramed("#", ";\r\n", 64);
if (inputString == "name")
{
msg = dmccGet("DEVICE.NAME");
msg = msg.response;
}
else if(inputString == "trigger")
56
DataMan Application Development

Table of Contents

Other manuals for Cognex DataMan

Related product manuals