Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The device support structures (DSET) are defined as follows

Code Block
languagecpp
themeRDark
titleDevice support
struct {
        long            number;
        DEVSUPFUN       report;
        DEVSUPFUN       init;
        DEVSUPFUN       init_record;
        DEVSUPFUN       get_ioint_info;
        DEVSUPFUN       read;
}devBsssPid={
        5,
        NULL,
        NULL,
        init_record_pid,
        get_ioint_info,
        read_pid
};

struct {
        long            number;
        DEVSUPFUN       report;
        DEVSUPFUN       init;
        DEVSUPFUN       init_record;
        DEVSUPFUN       get_ioint_info;
        DEVSUPFUN       read;
        DEVSUPFUN       speical_linconv;
}devBsssV={
        6,
        NULL,
        NULL,
        init_record_v,
        get_ioint_info,
        read_v,
        NULL
};

epicsExportAddress(dset, devBsssPid);
epicsExportAddress(dset, devBsssV);

The More information about the DSET can be found here. The structure of these structures come from aiRecord.h and int64inRecord.h files. Once the functions are defined and their function addresses are given to the structure, the structures must be exported using the epicsExportAddress command.

The functions are namely as follows:

  • DEVSUPFUN       init_record: Runs at each new record initialization. Create a new PV structure - pid_pvt or v_pvt depending on the record type. Checks if record INP is not INST_IO, prints error and exits. otherwise, it looks for the asyn parameters of the associated asyn driver by dissecting the INP field of the instantiated record, and extracting the port, the bsakey and the edef number. Once the reference is found, private pointers are stored.
  • DEVSUPFUN       get_ioint_info: 
  • DEVSUPFUN       read;


At this point, the device supports exist, but are still not enabled for usage. the new device supports need to be added to the dbd file (bsaAsynDriver.dbd) using the following commands:

...