Commissioning
Programming digital channels (DXP)
62
Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | [email protected] | www.turck.com
7.6.3
Programming DXP channels with Python 3
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 example shows the programming of the digital I/O channels with Python 3.
import sys
#GPIOs-> OUT: IN:
ports = ["88","59"]
# write GPIO:
try:
# set direction to write DXP
fo = open("/sys/class/gpio/gpio" + ports[0] +"/direction", "w")
fo.write("out")
fo.close()
# write GPIO:
f = open("/sys/class/gpio/gpio" + ports[0] +"/value", "w")
f.write("1")
f.close()
except:
# export gpio if not done as yet
f1 = open("/sys/class/gpio/export", "w")
f1.write(ports[0]) f1.close()
# set direction to write DXP
fo = open("/sys/class/gpio/gpio" + ports[0] +"/direction", "w")
fo.write("out")
fo.close()
# write GPIO:
fw = open("/sys/class/gpio/gpio" + ports[0] +"/value", "w")
fw.write("1")
fw.close()
Содержание 100000897
Страница 1: ...Your Global Automation Partner Instructions for Use TN UHF LNX UHF Reader...
Страница 2: ...2 Hans Turck GmbH Co KG T 49 208 4952 0 F 49 208 4952 264 more turck com www turck com...
Страница 19: ...V02 00 2021 05 19 Right click the Ethernet adapter Start the Topology scan Fig 16 Starting the Topology scan...
Страница 69: ...V02 00 2021 05 69 fclose fh else printf failed on writing n return 1...
Страница 75: ...V02 00 2021 05 75 else printf failed on writing n return 1 return EXIT_SUCCESS...
Страница 91: ...V02 00 2021 05 91 Restart the device to complete the update Click Reboot Fig 65 Restarting the device...
Страница 93: ...V02 00 2021 05 93 Select RS485 RFID and confirm with OK Fig 67 Selecting the RS485 interface...
Страница 97: ...V02 00 2021 05 97 Click the Select BL File button Fig 73 Button selecting a BL file...
Страница 106: ...Over 30 subsidiaries and over 60 representations worldwide www turck com 100003067 2021 05 100003067...