Skip to main content

Physical layer for using a Moxa devices with IEC870REE library

Project description

Physical layer for using a Moxa devices for IEC870REE library

Using:

from iec870ree_moxa import Moxa
from iec870ree.ip import Ip
from iec870ree.protocol import LinkLayer, AppLayer
import iec870ree.protocol
import datetime

ip_layer = iec870ree.ip.Ip(('127.0.0.1', 40001))
physical_layer = Moxa('PHONENUMBER', ip_layer)
link_layer = iec870ree.protocol.LinkLayer(10345, 1)
link_layer.initialize(physical_layer)
app_layer = iec870ree.protocol.AppLayer()
app_layer.initialize(link_layer)
physical_layer.connect()
link_layer.link_state_request()
link_layer.remote_link_reposition()
logging.info("before authentication")
resp = app_layer.authenticate(1)
logging.info("CLIENTE authenticate response {}".format(resp))
logging.info("before read")

start_date = datetime.datetime(2018, 4, 1, 0, 0)
end_date = datetime.datetime(2018, 4, 2, 1, 0)

for resp in app_layer.read_integrated_totals(start_date, end_date):
    logging.info("read response {}".format(resp))
physical_layer.disconnect()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iec870ree_moxa-0.3.0.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file iec870ree_moxa-0.3.0.tar.gz.

File metadata

  • Download URL: iec870ree_moxa-0.3.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/2.7

File hashes

Hashes for iec870ree_moxa-0.3.0.tar.gz
Algorithm Hash digest
SHA256 39200e30448866bcd9630a2380b175d11466a629530940df563d1cf6d04c0a5a
MD5 745d40c63fd79e1d0f5897bbcd9d3726
BLAKE2b-256 34a93bb7b70f1c7e33a81b62e6018dee7a11f827483f03f453c4b6d3c81653df

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page