Commissioning
Programming RFID channels
56
Hans Turck GmbH & Co. KG | T +49 208 4952-0 | F +49 208 4952-264 | [email protected] | www.turck.com
7.5
Programming RFID channels
The RFID channel is designed as a (
/dev/tty01
or
/dev/COM0
) serial interface.
7.5.1
Programming RFID channels with Python 3
The following examples illustrate the programming of the RFID interface with Python 3.
Example 1: using the “pySerial” module
import serial # from module pySerial
# open serial interface on port 0 and set a timout of 8 seconds
seri = serial.Serial("/dev/COM0", timeout=8)
# change settings
seri.baudrate = 115200 # set the baudrate of port COM0 to 115200
seri.parity ='N' # set no parity for port COM0
seri.bytesize = 7 # set the byte size for a sign to 7 for port
COM0
seri.stopbits = 1 # set stopbits to 1 for port COM0
seri.write(bytearray.fromhex("aa 07 07 49 00 41 23")) # writes a
bytestream
print(seri.readline()) # reads incoming message as ascii
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...