LAN DS18B20 WEB Temperature Monitor 1 meter Cable
www.WEB-Relays.com
www.Facebook.com/KMtronic

KMtronic Modbus LAN TCP/IP to Modbus RS485 RTU Serial Converter: testing MODBUS LED Display

  Python examples KMtronic Modbus LAN TCP/IP to Modbus RS485 RTU Serial Converter: testing MODBUS LED Display     Pymodbus is a full Modbus protocol implementation using twisted for its asynchronous communications core.   import struct from struct import * from pymodbus.client.sync import ModbusTcpClient # from pymodbus.client.sync import ModbusSerialClient as ModbusClient import logging logging.basicConfig() log . . .

Read More

Python read SDM230 Modbus Single Phase Energy Meter with Pymodbus

    import struct import binascii import time from pymodbus.constants import Endian from pymodbus.payload import BinaryPayloadDecoder from pymodbus.payload import BinaryPayloadBuilder from struct import * from pymodbus.client.sync import ModbusTcpClient import logging logging.basicConfig() log = logging.getLogger() #log.setLevel(logging.DEBUG) host = ‘192.168.1.204’ port = 502 client = ModbusTcpClient(host, port) client.connect() for x in range(0, 300): rr = client.read_input_registers(0x0000,2,unit=1) assert(rr.function_code . . .

Read More

How to send bytes to serial port in Python | Control KMtronic USB Relay board example

  FIRST channel commands: OFF command : FF 01 00 (HEX) or 255 1 0 (DEC) ON command : FF 01 01 (HEX) or 255 1 1 (DEC)   (1) Verify Python Interpreter Availability with ‘helloworld.py’ #!/usr/bin/python # Hello world python program print “Hello World!”;   (2) Create ‘kmtronic_usb_relay_test.py” file (3) Copy and paste code: #!/usr/bin/python . . .

Read More

How to Send a GET Packet in Python | Control KMtronic WEB Relay board example

  (1) Verify Python Interpreter Availability with ‘helloworld.py’ #!/usr/bin/python # Hello world python program print “Hello World!”;   (2) Create ‘kmtronic_web_relay_test.py” file (3) Copy and paste code: #!/usr/bin/python # Test KMtronic WEB Relay board print “Test KMtronic WEB Relay board”; import socket import time print “” HOST = “192.168.1.199” PORT = 80 # Arbitrary non-privileged . . .

Read More

How to Send a UDP Packet in Python | Control KMtronic UDP Relay board

(1) Verify Python Interpreter Availability with ‘helloworld.py’ #!/usr/bin/python # Hello world python program print “Hello World!”;   (2) Create ‘kmtronic_up_relay_test.py” file (3) Copy and paste code: #!/usr/bin/python # Test KMtronic UDP Relay board print “Test KMtronic UDP Relay board”; import socket import time UDP_IP = “192.168.1.199” UDP_PORT = 12345 RELAY1_ON_COMMAND = “FF0101” RELAY1_OFF_COMMAND = “FF0100” . . .

Read More

KMtronic LAN WEB 8 Channel Relay board