You are here: Foswiki>Applications Web>AppHowToMain>AppHowToPython (13 Apr 2020, JuttaFitzek)Edit Attach

Quick Reference: Device Access with Python

Before you start: ALL MODIFICATIONS OF BEAM AFFECTING PROPERTIES HAVE TO GO THROUGH THE LSA SYSTEM!
That beeing said, for development and debugging it might be necessary to inspect device properties and the described python tools are helpfull in this respect.

Using the PropHelper (GUI)

Prophelper is a graphical tool written in Python, provided and maintained by the FrontEnd group. It can be used to read in an easy way properties from a DeviceAccess device.
An introduction is available in the FE Wiki: https://www-acc.gsi.de/wiki/Frontend/PythonPropHelperIntro

Using the devscr (programmatically)

If you want to access the devices programmatically you can use the 'devscr' framework, this framework is also used internally by the PropHelper tool:
https://www-acc.gsi.de/wiki/Frontend/PythonDevscrIntro

Using Device Access (obsolete)

The following example shows, how to read information from a device using device access with python.

First, some environment variables have to be set. This is done by calling:

$ eqpact

Then, device access can be used by calling:

 
import devacc
d=devacc.Device("rm5mu1")
d.read("status")
d.read("version")
d.read("devdesc")
d.read("propdesc")
d.read("status")
print response.accStamp()

-- JuttaFitzek - 06 Jan 2015
-- JuttaFitzek - 12 Nov 2014
-- JuttaFitzek - 23 Oct 2013
-- RaphaelMueller - 02 Aug 2013
-- JuttaFitzek - 30 Mar 2011
Topic revision: r3 - 13 Apr 2020, JuttaFitzek
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback