The Device Server Signal Interface

# 7. The Signal Interface to HDB

An entry point to the HDB signal library was developed to allow signal configuration in HDB with the same names as they are known in a device class. Using dev_get_sig_config() in the HDB signal library and storing the result of the command DevReadSigValues in the data collector, all signals configured for a device class (in the device server) are dynamically available in HDB with the same names and descriptions.

But, today the HDB signal library still needs for dynamic loading one module for each device class. It is just a question of copy and paste to install such a module for a device class using the signal interface, but it implies recompilation of the HDB signal library. Studies are going on to change this to avoid recompilation and reinstallation of the HDB signal library in the future.

Here is an example module for the HDB signal library. This can be copied, but the function names must be changed to the class name the new module will be used for.

    #include <API.h>
    #include <siggen.h>
    /*
     * function prototypes
     */
    long RF_FOCUS_load_type (long *error);
    long RF_FOCUS_signal_list_init (char *device_name,
                                                       SigDefEntry **signal_list_ptr,
                                                       long *n_signal,
                                                       long *error);

    extern long signal_list_init (char *device_name,
                                              SigDefEntry **signal_list_ptr,
                                              long *n_signal,
                                              long *error);
    /*
     * The load type function
     */
    long RF_FOCUS_load_type (long *error)
    {
            return (DS_OK);
    }
    /*
     * Dynamic signal initialisation function.
     * Uses signals defined on the device server level.
     */

    long RF_FOCUS_signal_list_init (char *device_name,
                                                       SigDefEntry **signal_list_ptr,
                                                       long *n_signal,
                                                       long *error)
    {
            /*
             * calls the general signal init function, which is
             * used for all classes which implement signals on
             * the device server level.
             */
            if ( signal_list_init (device_name, signal_list_ptr,
                                          n_signal, error) == DS_NOTOK )
                {
                return (DS_NOTOK);
                }
            return (DS_OK);
    }

Generated with Harlequin WebMaker