Multi Signal Class Users Guide

# 2. Class Description

The multi signal class allows to handle a set of signals implemented for a device. A multi signal object is a list of signal objects (see: Signal Class Users Guide). Executing a method on a multi signal object will execute the same method on all signal objects of the list. All signals handled by same multi signal object must be signals of the same device:

> SR/RF-FOC/TRA3-1/Set-Current

> SR/RF-FOC/TRA3-1/Current

> SR/RF-FOC/TRA3-1/Voltage

## 2.1 The Configuration Resources

Because the multi signal object is created as a list of signal objects, the configuration resources for every signal must be specified as described in the section "The Configuration Resources" of the "Signal Class Users Guide".

As in the signal class the function object_initialise() was modified from the standard device server template. A class_name argument was added to the function to allow the specification of signal resources for a whole class of devices.

> static long object_initialise (MDSSignal ds, char *dev_class_name, long *error);

A list of signal names must be specified for the device class. All devices of the same class treat the same list of signals. For example the signal list of the "RF_FOCUS" device class:

> CLASS/RF_FOCUS/DEFAULT/signal_names: set-Current \

> Voltage, \

> Current

## 2.2 Functionality

The multi signal class offers the same functionality as the signal class but on a list of signals. Alarms can be checked in the same way and all the signals in the list can be reinitialised with the actual resource values by executing the method DevMethodSignalsReset.

The method DevMethodCheckLimits is not implemented in the multi signal object. Up to now this feature is used to check set-point limits when changing set-points. In this case it is an action on one signal object only. To handle a set-point limit check when working with a multi signal object, a method was implemented to extract the pointer of a signal object from the multi signal object.

## 2.3 The Methods

### 2.3.1 DevMethodClassInitialise

- long class_initialise (long *error)

- Description:

  Method to initialise the multi signal class. Will be called automatically when an object of this class is created the first time. The routine will be called only once.

- Arg(s) In:

  None

- Arg(s) Out:

  long *error - Pointer to error code, in case routine fails.

### 2.3.2 DevMethodCreate

- long object_create (char *name, MDSSignal *ds_ptr, long *error)

- Description:

  Method to create a multi signal object.

- Arg(s) In:

  char *name - Name of the multi signal object = the device name.

- Arg(s) Out:

  MDSSignal *ds_ptr - Pointer to the created multi signal object.

  long *error - Pointer to error code, in case routine fails.

### 2.3.3 DevMethodDestroy

- long object_destroy ( MDSSignal ds_ptr, long *error)

- Description:

  Method to destroy a multi signal object and to free all memory occupied by the object.

- Arg(s) In:

  MDSSignal ds - Multi signal object to destroy.

- Arg(s) Out:

  long *error - Pointer to error code, in case routine fails.

### 2.3.4 DevMethodInitialise

- long object_initialise (MDSSignal ds, char *dev_class_name, long *error)

- Description:

  Method to initialise the multi signal object. Reads all levels of specified resources or initialises to default values if no resources were found.

- Arg(s) In:

  MDSSignal ds - Multi signal object to initialise.

  char *dev_class_name - Name of the device class the multi signal object belongs to.

- Arg(s) Out:

  long *error - Pointer to error code, in case routine fails.

### 2.3.5 DevMethodReadProperties

- long read_properties (MDSSignal ds, DevVarStringArray *properties, long *error)

- Description:

  The method returns the properties of all signals defined in the multi signal object as a string array. The first string (element [0]) indicates the number of properties per signal, to have the flexibility to add new properties. The number of elements in the string array will be:

> properties.length = (number of properties per signal) * number of signals + 1

  Example for two signals:

> properties.length = 25

> properties.sequence[0] = Number of properties per signal

> properties.sequence[1] = Name of signal 1

> properties.sequence[2] = Label 1

> properties.sequence[3] = Unit 1

> properties.sequence[4] = Format 1

> properties.sequence[5] = Description 1

> properties.sequence[6] = Maximum value 1

> properties.sequence[7] = Minimum value 1

> properties.sequence[8] = Alarm high 1

> properties.sequence[9] = Alarm low 1

> properties.sequence[10] = Delta value 1

> properties.sequence[11] = Time interval 1

> properties.sequence[12] = Multiplier for standard units 1

> properties.sequence[13] = Name of signal 2

> properties.sequence[14] = Label 2

> properties.sequence[15] = Unit 2

> properties.sequence[16] = Format 2

> properties.sequence[17] = Description 2

> properties.sequence[18] = Maximum value 2

> properties.sequence[19] = Minimum value 2

> properties.sequence[20] = Alarm high 2

> properties.sequence[21] = Alarm low 2

> properties.sequence[22] = Delta value 2

> properties.sequence[23] = Time interval 1

> properties.sequence[24] = Multiplier for standard units 2

  Attention: The string array must not bee freed! The returned data is valid until the next call to the method. Than the string array is automatically freed before the new properties are returned.

- Arg(s) In:

  MDSSignal ds - Multi signal object to use.

- Arg(s) Out:

  DevVarStringArray *properties - Array of strings containing the properties of all signals in the list..

  long *error - Pointer to error code, in case routine fails.

### 2.3.6 DevMethodCheckAlarm

- long check_alarms (MDSSignal ds, DevVarDoubleArray *read_values,

  DevVarLongArray *alarm_states, long *error)

- Description:

  The method checks all the specified alarms on signals of the multi signal object. Alarms can be specified as described in the section "Alarms on Signals" in the "Signal Class Users Guide".

  As input the method takes an array of actual read values, defined as an array of double values for the most general case. The result is an array of corresponding alarm states. An alarm state can take the following four values:

> DEVHIGH = Exceeded high alarm level.

> DEVLOW = Exceeded low alarm level.

> DEVEXTRACTED = Difference between read and set (nominal) value.

> DEVRUN = Signal is in the given range.

  The return value of the method indicates:

> True = One or more signals indicate alarms

> False = No alarms

> DS_NOTOK = An error occurred

  Attention: The sequence of alarm states must not bee freed! The returned data is valid until the next call to the method. Than the sequence is automatically freed before the new alarm states are returned.

- Arg(s) In:

  MDSSignal ds - Multi signal object to use.

  DevVarDoubleArray read_values - Signal values to check.

- Arg(s) Out:

  DevVarLongArray *alarm_states - Results of the alarm check.

  long *error - Pointer to error code, in case routine fails.

### 2.3.7 DevMethodReadAlarm

- long read_alarms (MDSSignal ds, DevVarStringArray *alarm_mess, long *error)

- Description:

  Method to read the alarm messages of all pending alarms for the multi signal object. The method "DevMethodReadAlarm" is executed on all signals of the multi signal object. Alarm messages are handled as described in the section "DevMethodReadAlarm" of the "Signal Class Users Guide".

  Attention: The string array must not bee freed! The returned messages are valid until the next call to the method. Than the string array is automatically freed before the new alarm messages are returned.

- Arg(s) In:

  MDSSignal ds - Multi signal object to use.

- Arg(s) Out:

  DevVarStringArray *alarm_mess - Array of alarm message of all pending alarms.

  long *error - Pointer to error code, in case routine fails.

### 2.3.8 DevMethodSignalReset

- long reset (MDSSignal ds, long *error)

- Description:

  Method to reinitialise the properties of all signals of the multi signal object. All properties are updated with their actual resource values.

- Arg(s) In:

  MDSSignal ds - Multi signal object to use.

- Arg(s) Out:

  long *error - Pointer to error code, in case routine fails.

2.1 - The Configuration Resources
2.2 - Functionality
2.3 - The Methods
2.3.1 - DevMethodClassInitialise
2.3.2 - DevMethodCreate
2.3.3 - DevMethodDestroy
2.3.4 - DevMethodInitialise
2.3.5 - DevMethodReadProperties
2.3.6 - DevMethodCheckAlarm
2.3.7 - DevMethodReadAlarm
2.3.8 - DevMethodSignalReset

Generated with Harlequin WebMaker