Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cyclus2-PyCmd

A Python script to interactively send commands to Cyclus2 ergometers.

Warning

🚧 This is prototyping in progress. 🚧

logo{width=130}

Description

This project provides a Python script to interactively send commands to a Cyclus2 ergometer by RBM elektronik-automation GmbH.

Cyclus2 ergometers include a command interface that can be accessed over a serial interface, Ethernet cable, or WiFi. Via that interface, you can request data and/or send commands in (near) real-time. This project provides a command-line interface for interactive exploration of Cyclus2 commands. Eventually, this project can serve as a starting point for more sophisticated scripted interactions with the Cyclus2.

Usage

Using this script requires some installation and setup, see sections below.

Then you can start the command session by running the Python script in a terminal and passing the IP address of your Cyclus2 ergometer.

For example, if your Cyclus2 ergometer has the IP address 192.168.1.200:

python Cyclus2-PyCmd.py --address 192.168.1.200

Example session

$ python Cyclus2-PyCmd.py
Connected to 192.168.1.200:25000, assuming it is a Cyclus2 ergometer.
Type any Cyclus2 command or type `quit` or `exit` to end the session.
For example, try `vers?` and press <Return> for the software version.

> vers?
vers:Cyclus2, Version 5.0.9083.30724

> data?
data:0,0,0.00,0.00,0.00,0.00,0.00,0.00,8.61,0.00,0.00,0.00,0.00

> something-wrong
error:unknown command

> exit
Closing the connection to the Cyclus2 ergometer.

Note

The Cyclus2 will send "error:unknown command" if the command you entered is unknown/invalid.

Installation

  1. You need Python on your computer: To install Python, use a method appropriate to your computer and, if applicable, your institutional tools/policies.

  2. Clone or download this project to your computer, e.g.:

    git clone https://gitlab.rrz.uni-hamburg.de/dhprl/software/Cyclus2-PyCmd.git

On your Cyclus2, all required software should be installed, but it requires some setup, see next section.

Setup

To use this script, you only need a working network connection to your Cyclus2 ergometer. Perhaps as the simplest example, you can connect via a direct Ethernet cable between your computer and the Cyclus2.

  • Make sure your computer and the Cyclys2 share the same network. For example, you can assign the Cyclus2 a fixed IP address like 192.168.1.200 and your computer an address like 192.168.1.100. Alternatively, use a DHCP server to assign addresses automatically.

  • Make sure you can ping the ergometer from your computer, e.g., ping 192.168.1.200. You should see something like Reply from 192.168.1.200.

Tip

With this setup, all commands should work, except changing the baud rate

Support

This project is provided in the hope to be useful, without warranties of any kind (see also section License). No support is included, but feel free to reach out to the authors to ask for help.

This script gets tested on Ubuntu 24.04 LTS with Python 3.12 and on Windows 11 with Python version 3.14. TODO: Test on MacOS?

Roadmap

  • Handling of commands like data=7 that keep sending data for a long time.
  • Test on Windows (and perhaps MacOS) to ensure cross-platform compatibility.
  • Add more explanation what's going on inside the code and during the session (e.g., on what level are errors happening?).
  • Try to package this project into a single executable file for even easier usage. Perhaps possible with https://pyinstaller.org?
  • Incorporate the Cyclus2 protocol specification into the code and perhaps a text-based reference for the user, e.g. for a help command. (Perhaps convert the PDF content into text files that can be read by humans and the script, to avoid too much duplication?)

Contributing

Any contribution will be very welcome. At this stage, please write an email to the authors to report issues, discuss feature requests, or offer patches. As user of UHH GitLab, you can also use the GitLab functions.

Authors

License

This project aims to be REUSE compliant, indicating for each file the license and copyright information.

All software code is licensed under the European Union Public License (EUPL-1.2) to allow free use and modification, while ensuring that any modifications are also shared under the same license. See English license text in LICENSES/EUPL-1.2.txt; for other languages, see https://interoperable-europe.ec.europa.eu/collection/eupl/eupl-text-eupl-12.

Other materials (so far) are licensed under CC0 1.0 Universal Public Domain Dedication for maximal reusability. See English license text in LICENSES/CC0-1.0.txt; for a summary and other languages, see https://creativecommons.org/publicdomain/zero/1.0/deed.

The Cyclus2 protocol specification is published here to allow software development in the context of research and education, but no formal license terms have been decided yet; see more explanation here.

Project status

Experimental: This project is currently being prototyped as a lightweight experimental tool for interactive protocol exploration, not as a general-purpose end-user product. For now, expect breaking changes in each revision.

About

A Python command-line interface for interaction with Cyclus2 ergometers, https://www.cyclus2.com/en/

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages