Database Device Server User's Guide (V1.5)
A.Götz
17/12/99
This guide explains how user's access the TANGO Database device
server. It contains a brief description of how the Database device server
works. The main part of the guide consists of a detailed description of
all commands implemented and how to call them. Some examples are given
and a list of known problems and how to solve them.
1. Introduction
The TANGO database device server provides a TANGO Device interface to an
underlying database. The underlying database is mysql. The device
server is a client of the mysql database server. The TANGO tables are accessed
using embedded SQL in the Database device server. The client uses the TANGO
Device command_inout method to send requests to the Database device server.
The present version of the device server is monothreaded. This means simultanous
requests to the database are queued.
2. Commands
The following commands are supported :
2.1 DbInfo
-
description - returns list of general information about database e.g. time
database has been running, number of device servers registered and exported,
number of hosts, number of clients, number of property etc.
-
input = void - nothing
-
returns = Tango_DevVarString Array* - sequence of strings contiining description
2.2 DbGetDeviceClassList
-
description - returns the list of devices and their classes to be served
by the specified device server
-
input = Tango_DevString- device server personal name as e.g." StepperMotor/id11"
-
returns = Tango_DevVarStringArray* - sequence of device + device class
e.g. "id11/motor/1", "StepperMotor", "id11/motor/1", "StepperMotor", .
. .
2.3 DbGetClassList
-
description - returns the list of classes to be served by the specified
device server
-
input = Tango_DevString- device server personal name as e.g." StepperMotor/id11"
-
returns = Tango_DevVarStringArray* - sequence of device classes e.g. "DServer",
"StepperMotor"
2.4 DbGetDeviceList
-
description - returns the list of devices to be served by the specified
device server for the specified device class
-
input = Tango_DevVarStringArray* - device server personal name as e.g.
"StepperMotor/id11", "StepperMotor"
-
returns = Tango_DevVarStringArray* - sequence of devices to serve e.g.
"id11/motor/1", "id11/motor/2", .
2.5 DbExportDevice
-
description - export device to database so that clients can access it
-
input = Tango_DevVarStringArray* - device name followed IOR, host, server
name, pid, protocol version number e.g. "id11/motor/1", , "IOR...", "crate031",
"StepperMotor/id11", "123", "1"
-
returns = void - nothing
-
exception(s) - throws an exception if device is not defined in the database
2.6 DbUnExportDevice
-
description - un-export device to database so that clients cannot access
it
-
input = Tango_DevString- device name e.g. "id11/motor/1"
-
returns = void - nothing
2.7 DbUnExportServer
-
description - un-export all devices belonging to this server from the database
so that clients cannot access it
-
input = char* - server name e.g. "steppermotor/id11"
-
returns = void - nothing
2.8 DbImportDevice
-
description - returns device servant information so that client can build
up a connection to it
-
input = Tango_DevString- device name
-
returns = Tango_DevVarLongStringArray* - string branch contains device
name, IOR and TANGO protocol version number, long branch contains 1 if
device exported and 0 if device is defined but not exported e.g. svalue[]
= "id11/motor/1", "IOR...", "1" and lvalue[] = "1"
-
exception(s) = throws an exception if device is not defined in the database
2.9 DbImportDeviceList
-
description - returns a list of device servant information so that client
can build up a connection to it
-
input = Tango_DevVarStringArray* - list of device names e.g. "id11/motor/1",
"id99/dummy/device"
-
returns = Tango_DevVarLongStringArray* - string branch contains device
names, IORs and TANGO protocol version numbers long branch contains 1 if
device exported , 0 if device is defined but not exported and -1 if device
is not defined e.g. svalue[] = "id11/motor/1", "IOR...", "1", "id99/dummy/device",
"", "-1" and lvalue[] = "1", "-1"
2.10 DbGetDeviceProperty
-
description - returns the list of device properties to query for the specified
device
-
input = Tango_DevVarStringArray* - device name followed by a list of properties
to query e.g. "id11/motor/1", "chan_names", "velocity", "acceleration",
"dummy" , . . .
-
returns = Tango_DevVarStringArray* - device name, number of properties
followed by sequence of property names, number, followed by values (if
number is zero value is a space i.e. " ") e.g. "chan_names", "3", "id11/axe/1",
"id11/axe/2", "id11/axe/3", "velocity", "1", "100", "acceleration", "1",
"200", " "dummy", "0", " "
2.11 DbPutDeviceProperty
-
description - replaces or inserts a list of device properties
-
input = Tango_DevVarStringArray* - device name followed by number of properties
to update followed by a list of properties, their number and values e.g.
"id11/motor/1", "3", "chan_names", "3" "id11/axe/1", "id11/axe/2", "id11/axe/3",
"velocity", "1", "100", "acceleration", "1", "200"
-
returns = void - nothing
2.12 DbGetAttributeProperty
-
description - returns the list of attribute properties to query for the
specified device. All attributes properties for a device attribute are
returned. Only simple types are supported i.e. no sequences of simple types.
-
input = Tango_DevVarStringArray* - device name followed by a list of attributes
to query e.g. "id11/motor/1", "min", "max", "units"
-
returns = Tango_DevVarStringArray* - device name followed by number of
attributes to update followed by a list of attributes, number of properties
and a list of properties and values e.g. "id11/motor/1", "1", "position",
"3" "min", "-25000", "max", "25000", "units", "steps"
2.13 DbPutAttributeProperty
-
description - replaces or inserts a list of attribute properties. Only
simple types are supported i.e. no sequences of simple types.
-
input = Tango_DevVarStringArray* - device name followed by number of attributes
to update followed by a list of attributes, number of properties and a
list of properties and values e.g. "id11/motor/1", "1", "position", "3"
"min", "-25000", "max", "25000", "units", "steps"
-
returns = void - nothing
2.14 DbGetClassProperty
-
description - returns the list of class properties to query for the specified
device.
-
input = Tango_DevVarStringArray* - class name followed by a list of properties
to query e.g. "StepperMotor", "velocity", "acceleration", "dummy" , . .
.
-
returns = Tango_DevVarStringArray* - class name, number of properties followed
by sequence of property names, number, followed by values (if number is
zero value is a space i.e. " ") e.g. "StepperMotor", "3", "velocity", "1",
"100", "acceleration", "1", "200", " "dummy", "0", " "
2.15 DbPutClassProperty
-
description - replaces or inserts a list of class properties
-
input = Tango_DevVarStringArray* - class name followed by number of properties
to update followed by a list of properties, their number and values e.g.
"id11/motor/1", "2", "velocity", "1", "100", "acceleration", "1", "200"
-
returns = void - nothing
2.16 DbAddDevice
-
description - adds a device to the TANGO database. This command will also
add the DServer device for the server name to the database. NOTE: if the
device exists already in the database it is first deleted and then reinserted
with all dynamic values set to "nada" or 0 and marked as unexported. To
re-export the device(s) belonging this server restart the server.
-
input = Tango_DevVarStringArray* - server name followed by device name
and class e.g. "OregonMaxeds/id11", "id11/oms/1", "OregonMaxe"
-
returns = void - nothing
2.17 DbAddServer
-
description - add a server with a list of devices to the TANGO database.This
command will also add the DServer device for the server name to the database.
NOTE: if any of the devices exist already in the database they are first
deleted and then reinserted with all dynamic values set to "nada" or 0
and marked as unexported. To re-export the device(s) belonging this server
restart the server.
-
input = Tango_DevVarStringArray* - server name followed by a series of
device names and classes e.g. "OregonMaxeds/id11", "id11/oms/1", "OregonMaxe",
"id11/oms/2", "OregonMaxe", "id11/oms/3", "OregonMaxe"
-
returns = void - nothing