Skip to content

Channel

mandolout edited this page Jun 14, 2017 · 7 revisions

In the Virtual Device Server (VDS,) a "channel" is intended to represent a particular physical value. The channel can either control the value, measure the value, or both. To achieve this, the channel is supplied with information about one or two LabRAD device servers & settings, corresponding to being able to set and/or measure a particular value. Listed below are the properties of a channel, and their individual descriptions/purposes.

Table of Contents

name and ID

The name and ID of a channel are used to refer to the channel. When specifying a channel, the user may specify a name, an ID, or both. The channel used will be the one with the same name/ID as given; if both are given, they must belong to the same channel (IE don't specify the name of one channel with the ID of a different channel; if this happens, an error will be thrown.)

label

The label of a channel is the default axis/plot label for when this channel shows up on a graph. This property is optional and its use is not enforced; it is up to the client whether or not to use this supplied label.

description

An open-ended "description" of the channel (what device it's for, what its purpose is, etc.) Again, this property isn't required and doesn't have an inherent effect on the channel; however, it can be useful for clients to use this property to provide information about a given channel.

tags

A list of tags (strings) applied to the channel. Their intended use is to be able to categorize channels, or to differentiate between channels belonging to different physical hardware setups (or experimental setups.)

has_get, has_set

Boolean properties corresponding to whether or not the channel has the ability to measure and control (get and set respectively) the value that it represents. A channel may have either or both of these abilities, but it would make no sense to allow a channel to have neither.

get properties

The following properties determine how the channel measures (performs the get_channel command.) If has_get is False, then these properties can be left empty.

get_setting

This is a list of three strings that point to a the specific setting that the channel's "get" feature uses. The form is [server, device, setting] corresponding to a LabRAD server, a device on that server, and a setting from that server, respectively.

get_inputs

This is a list of inputs to be passed to the get setting when calling it. They are stored as strings, and their corresponding units are determined by the property get_inputs_units (below.)

get_inputs_units

This is a list of the units corresponding the the entries in the get_inputs property. The units are specified as follows:

"s" "str" and "string" -> string

"i" "int" and "integer" -> int

"f" "v" "" (empty string) and "float" -> float

Anything else is interpreted as a LabRAD Value

Additionally, if the entry starts with a period, these rules will be overridden and the data type will be a LabRAD Value (with the leading period omitted.) IE, ".v" -> LabRAD Voltage

set properties

The following properties determine how the channel controls (sets) the value it represents (how it performs the set_channel command.) If has_set is False, these can be left blank/empty.

set_setting

List of [server, device, setting] pointing to the LabRAD Server, device, and setting that are used to perform the set_channel command. Same behavior as get_setting.

set_var_slot

The set command sets the channel to a specific value, as specified in the set_channel command. This value needs to be passed to the LabRAD setting, and is often not the only argument that is passed to it. These arguments are split up in to two parts: the variable, which is specified each time the value is set, and the "statics" which are constant and specified by the properties below.

set_var_slot is the numerical position of the variable argument in the set of arguments for the setting. Note that the first position is position zero, etc.

For example, a for a setting such as the AD5764_DCBOX's set_voltage, the setting takes two inputs: port and voltage, use as such: set_voltage(port, voltage); in this case, set_var_slot would be 1, as the variable parameter (voltage) is in position 1 of the arguments.

set_statics

This is a list of the aforementioned static inputs for the set setting. They are stored as strings in the same way as the get_inputs are, and their units are stored by the property set_statics_units (below) in the same way that the units are specified for the "get" setting.

set_statics_units

List of units associated with the values in set_statics; each value will be converted to the appropriate units before being passed to the setting. Units behave identically to get_inputs_units above.

min, max, offset, scale

The second notable function of the Virtual Device Server is that the user can specify a domain (min and max values) and transformation (offset and scale) for the values of a channel. Min and max can be used to prevent damage to hardware by limiting, for instance, the value of a voltage to a safe range; offset and scale can be used to simplify input if the channel is consistently used in a particular regime.

min: the absolute minimum value for the channel to set (enforced after offset and scale)

max: the absolute maximum value for the channel to set (enforced after offset and scale)

offset, scale: the real value set (and checked for bounds) is offset + scale*value