Python Simple Script for WIZ107SR

Source Github Link

WIZ107SR

WIZ107SR is a gateway module that converts serial protocol (RS-232) into TCP/IP protocol by using W7100A.

Link WIZ107SR materials – WIZ107SR

SW – Download & Install

Script descriptions – TCPClient

  • Init. serial port number and baudrate
serial.Serial("COM1", 57600)
  • Change to serial commond mode

Change to serial command mode; when serial command switch code is ‘123’.
Just only input serial command mode switch code of 3bytes without ‘\r\n’.
Serial command mode switch code is set by using ConfigTool.

ser.write(b'123')
  • Setting TCPClient mode
ser.write(b'LP5000rn') # Source port number : ex.) 5000
ser.write(b'RP3000rn') # TCP server port number : ex.) 3000
ser.write(b'RH192.168.10.100rn') # TCP server IP address : ex.) '192.168.10.100'
ser.write(b'OP0rn') # Set TCP Client mode : OP0 - TCPClinet
ser.write(b'SVrn') # Save Setting
ser.write(b'RTrn') # Reboot
  • Send
ser.write(b'hellorn')
  • recv
serial_recv_buf = 10
line = ser.read(serial_recv_buf)

FAQ; How know the status of TCP connections ?

We can know the TCP connection by using 8pin.

In the initial time, this pin is INPUT for Hardware Trigger(for
serial command mode). After that, this pin is OUTPUT for
connection status. When the connection is established, this pin
goes Low. And, it will go HIGH when connection is closed.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s