Compounds | |
struct | TEC_INFO |
This structure is the basic parameter definition for the device to be handled. More... | |
Defines | |
#define | DRIVER(_i) ((INT (*)(INT cmd, ...))(pTecInfo->driver[_i])) |
#define | abs(a) (((a) < 0) ? -(a) : (a)) |
Functions | |
void * | GetChannelRecord (INT type, HNDLE hDB, HNDLE key) |
Allocates memory for the channel type and reads the record from the ODB and merges it into the allocated memory depending on the type of the channel. | |
INT | GetReadRegister (void *channel) |
Gets the PLC register to read for the type of the channel. | |
INT | GetWriteRegister (void *channel) |
Gets the PLC register to write for the type of the channel. | |
INT | ParseReadData (void *channel, INT value) |
Takes read value and decomposes into ODB key values. | |
INT | UpdateChannel (HNDLE hDB, TEC_INFO *pTecInfo, INT channel) |
Compare the channel and mirror info to see if anything changed. | |
INT | SetControlDemand (EQUIPMENT *pequipment, HNDLE hDB, TEC_INFO *pTecInfo, INT channel) |
Attaches the hotlink callback functions to the specified channel. | |
void | CommandDemand (HNDLE hDB, HNDLE hKey, void *info) |
Hotlink callback function for turning on controlled channel. | |
INT | CommandClear (void *param) |
Task spawned to clear the passed address in the PLC after one second. | |
void | free_mem (TEC_INFO *pTecInfo) |
This function will free all allocated memory for the device at the end of its lifetime. | |
void | tec_read (EQUIPMENT *pequipment, int channel) |
This routine collects data from all the signal sources and writes them to the ODB if they have changed. | |
INT | tec_init (EQUIPMENT *pequipment) |
This routine is used to initialize the instance of the equipment. | |
INT | tec_exit (EQUIPMENT *pequipment) |
Exit function that closes all device driver conections. | |
INT | tec_idle (EQUIPMENT *pequipment) |
The idle task routine. | |
INT | cd_tec_read (char *pevent, INT off) |
Generates bank data for the logger. | |
INT | cd_tec (INT cmd, EQUIPMENT *pequipment) |
This is the class driver command interface, called by the front end code on startup, shutdowen and periodically by idle task. | |
void | SetpointDemand (HNDLE hDB, HNDLE hKey, void *info) |
Hotlink callback function for turning on controlled channel. |
The interface to controllable channels is based on the ISAC Controls PLC interface specification, which uses a Command and Status word for each device. These registers are located in the 4x area of the PLC.
There are also simple value channels which give data from analog inputs, These registers are located in the 4x area of the PLC.
To manage the channels, a data structure is defined that can handle all aspects of each channel type. The ODB entries contain a Type field to identify each channel.
|
|
|
|
|
This is the class driver command interface, called by the front end code on startup, shutdowen and periodically by idle task.
|
|
Generates bank data for the logger. Not implemented at present |
|
Task spawned to clear the passed address in the PLC after one second.
|
|
Hotlink callback function for turning on controlled channel.
|
|
This function will free all allocated memory for the device at the end of its lifetime.
|
|
Allocates memory for the channel type and reads the record from the ODB and merges it into the allocated memory depending on the type of the channel.
|
|
Gets the PLC register to read for the type of the channel.
|
|
Gets the PLC register to write for the type of the channel.
|
|
Takes read value and decomposes into ODB key values. The CONTROL type of channel has several status bits in the passed value.
|
|
Attaches the hotlink callback functions to the specified channel. The type of the channel and the associated callbacks are determined.
|
|
Hotlink callback function for turning on controlled channel.
|
|
Exit function that closes all device driver conections.
|
|
The idle task routine. All channels are read from the PLC.
|
|
This routine is used to initialize the instance of the equipment. The connection to the ODB is established, space is allocated to store all the parameters for the devices in the equipment. Values are initialized. The device driver is initialized, and a first collection of data is made.
|
|
This routine collects data from all the signal sources and writes them to the ODB if they have changed.
|
|
Compare the channel and mirror info to see if anything changed. If there is a change, send the updated info to the ODB.
|