Skip to main content

A library to communicate with Omron NX and NJ PLC and motion controllers

Project description

aphyt

This is a library for communicating with Omron NX and NJ industrial PLC and motion controllers using Ethernet/IP.

Communicating with Omron Sysmac Controllers Using Ethernet/IP

This software implements the core functionality of reading and writing numeric, Boolean, string, structure and array variables to an Omron NX or NJ controller using symbolic names. The read_variable and write_variable methods allow the programmer to use Python based data types to write to variables, as well as properly format the data received when reading variables. The example code below demonstrates how to establish the explicit Ethernet/IP connection and then read and write variables to a test project in the NJ or NX controller.

Example Use

Installation

This package is on PyPI so the user can install using:

pip install aphyt

Getting Started

In order to connect to an Omron N-Series controller for data exchange using Ethernet/IP, the programmer should import omron from the aphyt module and instantiate an instance from the NSeries or NSeriesThreadDispatcher object using a context manager or by assignment. If the program supplies the host to the object, it is not necessary to explicitly connect to the IP address of the controller, and register a session. If the object is created without a host, the connection and session registration must be done explicitly.

import time
from aphyt import omron


if __name__ == '__main__':
    with omron.NSeries('192.168.250.9') as eip_conn:
        for i in range(10):
            print(eip_conn.read_variable('TestInt'))
            eip_conn.write_variable('TestInt', 24)
            print(eip_conn.read_variable('TestInt'))
            eip_conn.write_variable('TestInt', 7)
            time.sleep(.5)

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

aphyt-0.1.20.tar.gz (46.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aphyt-0.1.20-py3-none-any.whl (46.1 kB view details)

Uploaded Python 3

File details

Details for the file aphyt-0.1.20.tar.gz.

File metadata

  • Download URL: aphyt-0.1.20.tar.gz
  • Upload date:
  • Size: 46.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.5

File hashes

Hashes for aphyt-0.1.20.tar.gz
Algorithm Hash digest
SHA256 f9f895d9e4cac2d0647042e45982f8aacdb33cc050fe8ef3f5d374796aa72de6
MD5 5e3147257a19a18cf8e1a37ed8ca0e7b
BLAKE2b-256 4e143dc80522aa4fb3535ad0cf9d2ca88798d4256fc7eeee762d3ab7eb0af172

See more details on using hashes here.

File details

Details for the file aphyt-0.1.20-py3-none-any.whl.

File metadata

  • Download URL: aphyt-0.1.20-py3-none-any.whl
  • Upload date:
  • Size: 46.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.5

File hashes

Hashes for aphyt-0.1.20-py3-none-any.whl
Algorithm Hash digest
SHA256 08fe08c5c8fb926686fed4af4efd19a0014a94dd76153a485d5c0157cbb21fae
MD5 8a7fee0cb9a199ac1c991c347f9bbf88
BLAKE2b-256 5256288394d9fab545d19a71eebbbd0087eff5f90f63ebd374fbb5fad0d14214

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