Commissioning
Programming digital channels (DXP)
64
Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | [email protected] | www.turck.com
7.6.4
Programming DXP channels with Node.js
NOTE
The speed of the data transmission depends on the configured block size and the
set transfer rate. The speed may possibly not be enough for time critical
applications. To achieve faster data processing, the process can be set as a real-time
process.
The following examples illustrate the programming of the digital I/O channels with Node.js.
Further information on Node.js and the Node.js packages is provided at:
n
n
// initialize the onoff box
const Gpio = require('onoff').Gpio;
function setGpioByInt(OUT, val) {
// switch from DXP to GPIO...
switch (OUT) {
case 0:
res = 88;
break;
case 1:
res = 89;
break;
case 2:
res = 86;
break;
case 3:
res = 87;
break;
}
// initialize the GPIO just to write...
// write the GPIO / DXP...
console.log('set Gpio '+ res + ' to ' + val);
}
Summary of Contents for 100000897
Page 1: ...Your Global Automation Partner Instructions for Use TN UHF LNX UHF Reader...
Page 2: ...2 Hans Turck GmbH Co KG T 49 208 4952 0 F 49 208 4952 264 more turck com www turck com...
Page 69: ...V02 00 2021 05 69 fclose fh else printf failed on writing n return 1...
Page 75: ...V02 00 2021 05 75 else printf failed on writing n return 1 return EXIT_SUCCESS...
Page 93: ...V02 00 2021 05 93 Select RS485 RFID and confirm with OK Fig 67 Selecting the RS485 interface...
Page 97: ...V02 00 2021 05 97 Click the Select BL File button Fig 73 Button selecting a BL file...