Skip to main content

Package that let easily interact with the Xcom-485i device over Modbus RTU

Project description

Python library to access Studer-Innotec Xcom-485i device through Modbus RTU over a serial port

Prerequisites

Please read the complete documentation available on : Studer Innotec SA -> Support -> Download Center -> Software and Updates -> Communication protocols Xcom-CAN

Getting Started

1. Package installation

$ pip install xcom485i

2. Hardware installation

  • Connect your Xcom-485i (Studer side) to your installation using the cable provided with the device

  • Connect your Xcom-485i (External side) to your controller (personal computer, Raspberry Pi, etc.) using a USB to RS-485 adapter

  • Please refer to the Xcom-485i manual for more information about commissioning the device

3. Serial configuration

This package rely on pyserial standard package, in order to use the xcom485i package make sure to instantiate it like :

import serial

serial_port = serial.Serial(SERIAL_PORT_NAME, SERIAL_PORT_BAUDRATE, parity=serial.PARITY_EVEN, timeout=1)
  • where SERIAL_PORT_NAME is your serial port interface, for example set it to ‘COM4’ (string argument) when using Windows otherwise you may set it to ‘/dev/ttyUSB0/’ on Linux

  • where SERIAL_PORT_BAUDRATE is the baudrate used by your serial port interface (must be set to 9600, 19200, 38400 or 115200 according to Xcom-485i dip-switches)

Xcom-485i Dip switches baud rate selection

N° 7

N° 8

Baudrate

OFF

OFF

9600 bps

OFF

ON

19200 bps

ON

OFF

38400 bps

ON

ON

115200 bps

4. Address offset

Set the modbus offset corresponding to the internal dip-switches of your Xcom-485i device, it must be set to 0, 32, 64 or 128.

It is done when instantiate the Xcom485i class like :

xcom485i = Xcom485i(serial_port, OFFSET, debug=True)
  • where serial_port is the previously created object with Serial

  • where OFFSET is your actual modbus address offset set by the dip-switches inside your Xcom-485i

  • where debug enables you to get some useful console information for debugging purpose

Xcom-485i Dip switches address offset selection

N° 1

N° 2

Address offset

Address range

OFF

OFF

0

1 to 63

OFF

ON

32

33 to 95

ON

OFF

64

65 to 127

ON

ON

128

129 to 192

5. Run an example from /examples folder

Go to /examples folder with a terminal and execute this script

$ python ex_read_info.py

Check client file to understand it.

6. Open documentation

Open documentation from Read The Docs

Warnings

  • Please check carefully the serial configuration, the Xcom-485i dip-switches configuration as well as the jumper for D+, D- and GND signals

  • Use devices addresses generated into addresses file

  • It is strongly recommended NOT to spam the Xcom-485i with multiple requests. The correct way to communicate with the Xcom-485i is to send a request and to wait for the response before sending the next request. If no response comes from the Xcom-485i after a delay of 1 second, we can consider that the timeout is over and another request can be send. It is also how Modbus RTU is intended to work.

Authors

Studer Innotec SA - Initial work - Studer Innotec SA

License

This project is licensed under the MIT License - see the LICENSE file for details

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

xcom485i-0.9.3.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

xcom485i-0.9.3-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file xcom485i-0.9.3.tar.gz.

File metadata

  • Download URL: xcom485i-0.9.3.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for xcom485i-0.9.3.tar.gz
Algorithm Hash digest
SHA256 b214755faad847bb0c101eea234836a3448c9ba1d3f3583ca896198c0fa0caba
MD5 e6229eb43b479a620bded3638ea7faeb
BLAKE2b-256 0e0523ed456de6d2e47bb5b657b4ac786d596059190b019dd77ec0d866183238

See more details on using hashes here.

File details

Details for the file xcom485i-0.9.3-py3-none-any.whl.

File metadata

  • Download URL: xcom485i-0.9.3-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for xcom485i-0.9.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0f773857f383de059b53858727e9ef471968b5928f460f2e7edcdb1dff7b0e8c
MD5 28e07a72d996af7f3046bafac20b3686
BLAKE2b-256 ddfba6d649a796ddf2263de62da20edb1c3fbbebf59dea71ef8fae2d1a6b6608

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