Generic Use Case: Heartbeat - Cognex DataMan Communications And Programming Manual

Hide thumbs Also See for DataMan:
Table of Contents

Advertisement

{
this.send(my_name + ': issue a trigger...\r\n');
dmccCommand("TRIGGER", true);
msg = 'done';
}
else if (inputString == "close")
{
this.close();
}
else if (inputString == "stop")
{
this.setTimer(0.0);
}
else if (inputString == "start")
{
this.setTimer(10.0);
}
else if (inputString == "switch")
{
this.onTimer = onTimeout2;
}
else if (inputString == "time")
{
today = new Date();
msg = today.getSeconds() * 1000 + today.getMilliseconds();
}
else
{
msg = "unknown command: " + replace_crlf(inputString);
}
num_send = this.send(my_name + ': ' + msg + "\r\n");
return inputString.length;
},
onUnexpectedData: function (inputString) {
this.expectFramed("#", ";\r\n", 128);
msg = replace_crlf(inputString);
num_send = this.send(my_name + ': ' + msg + "?\r\n");
return true;
},
onTimer: onTimeout
};
}

Generic use case: Heartbeat

Send out a periodic heartbeat message if reader is idle.
DataMan Application Development
57

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DataMan and is the answer not in the manual?

Table of Contents

Save PDF