TANGO

Device Servers




PSI power supplies
Device Description

PSI_PC Class

Revision: - Author: Maciej Lipinski
Control of SR power supplies.. The Device Server is meant to provide control of PSI Power Supply Controllers. The DS is basic/universal, it means that it can be used as a base for developing Device Servers for PSI PSC intended for specific usage which requires implementing additional functions (ex. upload/download waveform).

The Device Server can use two types of hardware connection to communicate with PSI PSC: serial (RS232) or fiber. The connection type is determined by setting the property: ConnectionType (0 for fiber and 1 for serial).

For simplicity, PSC DS connected by serial connection will be called serial DS, PSC DS connected by fiber connection will be called fiber DS.

Serial connection is considered as local and 'service', it is not supposed to be used on normal basis, just in extraordinary cases.
Fiber connection is considered a default connection meant to be used most of the time.

Fiber connection uses PCI/cPCI Carrier Card. Each card carries two Industrial Pack (IP), each having two channels. Each channel of IP is connected to one PSC. One IP is represented in /dev/ folder as node called pscipX (X is number).
If fiber connection is to be used, the property 'FODevice' needs to be set (ex '/dev/pscip0') along with 'Channel' property (0 or 1).

Serial connection uses PySerial Device Server. The property 'TangoDevice' needs to be set inicating the Py Serial name and localization (ex. 'ws/pc-test/ocem00-serial ').

For the PySerial to work properly, the following attributes need to be set:

Attr name value
Bautrate 115200
DataBits 8
Parity odd
Port Correct port to which PSC is connected (ex. /dev/ttyR0)
StopBits 1


In theory, instead of PySerial DS, any DS can be used instead of PySerial without any changes to PSI SD as long as the following commands are implemented: Both connections can be used simultaneously only for reading. When writing, a priority is given to one of the Device Servers The priority can be only set Serial DS. It means that DS connected by fiber cannot regain writing priority , it has to be granted priority. For safety reasons the priority is granted to serial DS as long as it is connected to PSC. To be precise, the priority for serial DS is granted as soon as it attempts the first write. The priority is set to fiber DS only if serial DS is disconnected from PSC.

CAUTION: If the priority is set to serial DS and an attempt to write is made by fiber DS, the fiber DS gives no error message, it looks as if the operation was successful, however, the value is not written.

The following documentation is available, which can be useful for future developers/users:
1) Communication_protocol.doc is adescription of communication protocol between DS and PSC
2) DSP_SW_R4_User_Documentation English.doc is a description of PSI Power Supply Controller (all registers and their meaning, meaning of leds, etc)
3) Messages_Codes_en.xls explains meaning of error codes from PSC
4) DS Specification Architecture and Design of the TANGO device server for the Power supplies at ALBA

Detailed documentation describing hardware used is provided with the PSCIP Linux Device Driver.

Commands, attributes and properties detailed description.

The following symbols are used:

Symbol

meaning

Attribute /property

I

current

Attribute

I_ideal

current setpoint

Attribute

I_ref

current reference

Attribute

o

offset

Attribute

f

current factor

Property

In most of the cases the default values of 'offset' and 'current factor' should be set:

o = 0

f = 1

Change of the default setting should be done only in the case User knows what he/she is doing !!!!

Attributes:

Name

Description

Current

current calculated out of measured ( by PSC ) current according to the following formula:

I = I_ideal + ( I_ref - I_measured ) / f

CurrentSetpoint

the ideal current which is intended to be acquired, it is not the current set to the hardware, the current set in the hardware is calculated according to the following formula:

( I_ideal + o )

CurrentOffset

a value added to the current written to the 'current setpoint' attribute

CurrentReference

the current value written to the hardware

CurrentMeasured

current measurement read from the hardware

Errors

returns readable information about all the errors which have occurred. If error occurs more then one time, it is not duplicated in the return table

ErrorCodes

returns codes of the latest errors detected according to categories stored in ErrorLabel attribute

ErrorLabel

returns the categories of the error codes

RemoteMode

is glued to 1 (means remote mode) because PSC can only be operated remotely

State

returns device state (short message)

Status

returns human readable, textual description

Voltage

returns voltage measured on the load

Properties:

Name

Description

Channel

(0 or 1) defines IP channel used to connect PSC by fiber

ConnectionType

(0 - fiber; 1 - serial) determines which hardware medium is used to connect industrial PC with PSC

FODevice

defines device used for fiber optic connection (ex. /dev/pscip0)

TangoDevice

defines name and location of PySerial DS used for serial communication

Current factor

multiplier

InterlockFlowBit InterlockTemperatureBit

'flow' interlock and 'temperature' interlock signals are represented in 'Digital_Input_Signals' register of PSC as bits. The properties allow user to determine which bits of the PSC register are associated with this interlocks. If correctly defined, these properties enable DS to recognize Flow and Temperature interlocks and provide user with appropriate error message


Commands:

Name

Description

ClearError

clear Disorder register in PSC, Error and ErrorCodes attributes in DS

Disable_interlocks

write Digital_Input_Signals_Mask with 0xE070 value. I causes all the interlocks, except one, to be disabled. The not disabled interlock has input at the rear of PSC and can be disabled hardware-wise. The change of Mask register value is temporary.

Enable_interlocks

write Digital_Input_Signals_Mask with 0xF877 value. Interlocks are enabled

Interlocks_state

shows the current value of Digital_Input_Signals_Mask, Three states: 'Interlocks enabled', 'Interlocks disabled' or 'Interlocks customized'

Init

default function which re-initialize Device Server not affecting the state of the hardware

Off

turns off the device

On

turns on the device

Read_PSC_register

enable user to read any PSC register which is read-enabled. The address and (optionally) format of output data need to be specified. The default format is hexadecimal. Example input data '0x00' will read register 0x00 and output it data as hexadecimal, '0x00 f' will read register 0x00 and output it as flaot

Reset

resets PSC by turning it off, an attempt to reestablish connection with hardware is taken if it has been lost. It also calls ClearErrors command

State

Status

the same as attributes





TANGO is an open source project hosted by :
Sourceforge logo small
Core and Tools : CVS repository on tango-cs project
Device Servers : CVS repository on tango-ds project