
V01.00 | 2019/04
51
7.5.2
Setting DXP functions via script
A script is installed on the device for setting the DXP channels. The script is located under the
following path:
/usr/bin/dxp
The script can be used with the following syntax:
/usr/bin/dxp channel [value]
The following example sets the value for the DXP0 channel to ON.
/usr/bin/dxp 0 1
Parameter
Possible values
DXP0…DXP3
1: Switch on channel
0: Switch off channel
7.5.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 applica-
tions. To achieve faster data processing, the process can be set as a real-time pro-
cess.
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()
Summary of Contents for TN-UHF LNX Series
Page 1: ...Your Global Automation Partner Instructions for Use TN UHF LNX UHF Read Write Head ...
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 75: ...V01 00 2019 04 75 Select RS485 RFID and confirm with OK Fig 62 Selecting the RS485 interface ...