Python library to access Studer-Innotec Xcom-485i device through Modbus RTU over a serial port
Please read the complete documentation available on : Studer Innotec SA
_ -> Support -> Download Center -> Software and Updates -> Communication protocols Xcom-CAN
.. code-block:: console
$ pip install xcom485i
This package rely on pyserial
_ standard package, in order to use the xcom485i package make sure to instantiate it like :
.. code-block:: python
import serial
serial_port = serial.Serial(SERIAL_PORT_NAME, SERIAL_PORT_BAUDRATE, parity=serial.PARITY_EVEN, timeout=1)
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 LinuxSERIAL_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 ===== ===== ===========
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 :
.. code-block:: python
xcom485i = Xcom485i(serial_port, OFFSET, debug=True)
serial_port
is the previously created object with SerialOFFSET
is your actual modbus address offset set by the dip-switches inside your Xcom-485idebug
enables you to get some useful console information for debugging purposeXcom-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 ===== ===== =============== ==============
/examples
folder
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Go to /examples folder with a terminal and execute this script
.. code-block:: console
$ python ex_read_info.py
Check client file
_ to understand it.
Open documentation from Read The Docs
_
addresses file
_Studer Innotec SA - Initial work - Studer Innotec SA
_
This project is licensed under the MIT License - see the LICENSE
_ file for details
.. External References: .. _Studer Innotec SA: https://www.studer-innotec.com .. _addresses file: https://xcom485i.readthedocs.io/en/latest/addresses.html .. _client file: https://xcom485i.readthedocs.io/en/latest/client.html .. _Read The Docs: https://xcom485i.readthedocs.io/en/latest/index.html .. _LICENSE: https://xcom485i.readthedocs.io/en/latest/license.html .. _pyserial: https://pyserial.readthedocs.io/en/latest/shortintro.html