Skip to content

Instantly share code, notes, and snippets.

@rwclarke
Last active November 20, 2023 13:00
Show Gist options
  • Save rwclarke/a0af2f80187d86ac405a197e7def4d88 to your computer and use it in GitHub Desktop.
Save rwclarke/a0af2f80187d86ac405a197e7def4d88 to your computer and use it in GitHub Desktop.
Automate Honeywell barcode label printing with Node.js
const net = require('net');
const client = new net.Socket();
const IP_ADDRESS = "your-honeywell-ip-address";
const PORT = 9100;
/*
Intermec Printer Language (IPL) exported from Bartender
File > Printer Code Template
*/
const cmd = `<STX>R<ETX>
<STX><ESC>C<SI>W635<SI>h<ETX>
<STX><ESC>P<ETX>
<STX>E3;F3<ETX>
<STX>H1;f2;o967,623;c63;b0;h12;w12;d3,PART NO.<ETX>
<STX>H2;f2;o963,553;c63;b0;h12;w12;d3,(P)<ETX>
<STX>B3;f2;o938,494;c0,3;w3;h64;r0;d3,PXBITEMID<ETX>
<STX>H4;f2;o963,426;c63;b0;h12;w12;d3,QUANTITY<ETX>
<STX>H5;f2;o927,404;c63;b0;h12;w12;d3,(Q)<ETX>
<STX>H6;f2;o836,407;c63;b0;h28;w28;d3,XBQUANTITY<ETX>
<STX>B7;f2;o938,354;c0,3;w3;h76;r0;d3,QXBQUANTITY<ETX>
<STX>H8;f2;o963,261;c63;b0;h12;w12;d3,SUPPLIER<ETX>
<STX>H9;f2;o925,236;c63;b0;h12;w12;d3,(V)<ETX>
<STX>B10;f2;o963,189;c0,3;w3;h51;r0;d3,V<ETX>
<STX>H11;f2;o976,122;c63;b0;h12;w12;d3,SERIAL<ETX>
<STX>H12;f2;o900,121;c63;b0;h13;w12;d3,(S)<ETX>
<STX>H13;f2;o849,108;c63;b0;h17;w17;d3,SXBRECORDNO<ETX>
<STX>B14;f2;o976,115;c0,3;w3;h80;r0;d3,SXBRECORDNO<ETX>
<STX>L15;f0;o0,428;l1014;w4<ETX>
<STX>L16;f0;o0,276;l1014;w4<ETX>
<STX>L17;f0;o0,124;l1014;w4<ETX>
<STX>H18;f2;o570,233;c26;b1;h28;w28;d3,XBPTYPE<ETX>
<STX>H19;f2;o836,572;c63;b0;h28;w28;d3,XBITEMID<ETX>
<STX>D0<ETX>
<STX>R<ETX>
<STX><SI>l13<ETX>
<STX><ESC>E3,1<CAN><ETX>
<STX><RS>1<US>1<ETB><ETX>
<STX><ESC>P<ETX>
<STX>E3<ETX>
<STX>R<ETX>`;
client.connect(PORT, IP_ADDRESS, function() {
console.log('Connected');
client.write(cmd);
client.destroy();
});
client.on('close', function() {
console.log('Connection closed');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment