TEquipmentModule is the a TINE server's equipment module class.
More...
Public Member Functions | |
int | AppendAlarmInfoTable (ref ADS ads) |
Inserts an alarm definition into the alarm definition table. More... | |
int | AppendAlarmWatchTable (string prp, string dev, Int32 siz, Int32 fmt, Int32 atyp, Int32 sev, Int32 sys, ref ALM_THRESHOLDS thr) |
Inserts a property to be monitored into the local alarm server's Watch Table. More... | |
int | AppendHistoryInformation (string prp, string dev, Int32 len, Int32 fmt, Int32 idx, ref HistorySpecification hspec) |
Inserts a local history element into the local history server. More... | |
int | CallPropertyInSeparateThread (string property, Boolean value) |
Determines whether the specified property is called in a separate handler thread or not. More... | |
void | ClearAlarm (Int32 devNr) |
Instructs the local alarm server table that the given alarm is to be cleared. More... | |
void | ClearAlarm (string devName) |
Instructs the local alarm server table that the given alarm is to be cleared. More... | |
unsafe ClnInfo | GetCallerInformation () |
Returns a ClnInfo structure containing relevant information of the current caller of this equipment module. More... | |
Int32 | GetDeviceNumber (string device) |
Returns the registered device number for the device name given. More... | |
Int32 | GetDeviceNumber (string device, string property) |
Returns the registered device number for the device name and property given. More... | |
Int32 | GetPropertyId (string property) |
Returns the registered property identification number for the property entered. More... | |
int | RegisterDeviceName (String devName, Int32 devNr) |
Assigns a device name to the specified device number. More... | |
int | RegisterPropertyAlias (string property, string alias) |
assigns an alias name to the specified propert More... | |
int | RegisterPropertyInformation (string property, TDataType dout, TDataType din, UInt16 acc, UInt16 atype, int rowLength, string dsc, int propId, string rdr) |
Assigns pertinent information for the specified property. More... | |
void | RemoveAlarm (string devName, UInt32 almCode) |
Instructs the local alarm server table that the given alarm is to be marked for removal. More... | |
int | RestorePropertyValues (string property, object values) |
Fills the given 'values' object with the last stored property values. The 'values' object passed should be large enough to contain the stored values for all devices (consecutively ordered). More... | |
int | SavePropertyValues (string property, string device, object values) |
Saves the values in the give 'values' object with the property and device provides. More... | |
Int32 | ScheduleProperty (string property) |
Schedules the given property for immediate delivery to all attached clients. More... | |
Int32 | ScheduleProperty (string property, Int32 scope) |
Schedules the given property for immediate delivery to all attached clients according scope specified. More... | |
int | SetAlarm (Int32 devNr, UInt32 almCode) |
Inserts an alarm into the local alarm server table. More... | |
int | SetAlarm (Int32 devNr, UInt32 almCode, object almData, byte almFlags) |
Inserts an alarm into the local alarm server table. More... | |
int | SetAlarm (Int32 devNr, UInt32 almCode, String tag) |
Inserts an alarm into the local alarm server table. More... | |
int | SetAlarm (Int32 devNr, UInt32 almCode, String tag, object almData, byte almFlags) |
Inserts an alarm into the local alarm server table. More... | |
int | SetAlarm (string devName, UInt32 almCode, object almData, byte almFlags) |
Inserts an alarm into the local alarm server table. More... | |
int | SetAlarm (string devName, UInt32 almCode, String tag, object almData, byte almFlags) |
Inserts an alarm into the local alarm server table. More... | |
void | SetCompletion (string statusString) |
Sets the error string to accompany the current server call More... | |
TEquipmentModule (string exp, string eqm, Int32 ndev, CallHandler hndlr, FcnDispatch ini, FcnDispatch bkg, Int32 bkgInterval, FcnDispatch exi) | |
Primary constructor for an equipment module object. More... | |
Properties | |
Boolean? | SchedulePropertyLazy [get, set] |
get/set the ScheduleProperty 'lazy' setting More... | |
TEquipmentModule is the a TINE server's equipment module class.
An equipment module represents a device server. This is ideally a class which manages like instances of a set of devices. The equipment module is responsible for handling dispatch actions pertaining to registered properties ('READ' or 'WRITE' actions).
|
inline |
Primary constructor for an equipment module object.
A FEC (front-end controller) process can contain more than one equipment module (which is exported as a device server or property server). However, a FEC process should contain at least one equipment module in order to be a useful element in the control system.
exp | is the equipment module's exported device or property server name (maximum 32 characters). This name must be unique within a given context. If a 'null' parameter is passed, then the exported name must be given by an underlying configuration file such as 'export.csv' or 'fec.xml' |
eqm | is the equipment module's internal 'local' name (maximum 6-characters). This name must be unique within the process only, and is used for internal de-referencing. |
ndev | gives the maximum device capacity (maximum number of device instances supported by this device server. |
hndlr | is the equipment module's dispatch call handler. This must be a function of the form: int CallHandler(string dev, string prp, TDataType dout, TDataType din, UInt16 acc, TEquipmentModule eqm); |
ini | is an optional initialization routine for the equipment module. This must be a function of the form: void FcnDispatch(); |
bkg | is an optional background routine for the equipment module, which will be called at the given background task interval. This must be a function of the form: void FcnDispatch(); |
bkgInterval | is the background task interval in play if a background task is registered. |
exi | is an optional background routine for the equipment module, which will be called at the given background task interval. This must be a function of the form: void FcnDispatch(); |
Example:
|
inline |
Inserts an alarm definition into the alarm definition table.
As an alternative to the 'local name'-alarms.csv configuration file, the front end server can make use of this API call in order to fill in the alarm definition table describing locally generated alarms. This is particularly useful for embedded platforms where there is no file system, or where a TINE server is used as a translation layer and needs to map a given alarm system onto the TINE alarm system.
ads | is a pointer to an Alarm Definition Structure (ADS) containing the alarm table information which is to be appended to the alarm definition table. |
|
inline |
Inserts a property to be monitored into the local alarm server's Watch Table.
Certain alarms are to be set whenever the value of a property exceeds a defineable threshold. Such alarms can be managed automatically by the local alarm server if the alarm criteria are entered into the alarm watch table. This can be achieved by calling this routine (or supplying a startup configuration file almwatch.csv).
prp | is the property which is to be called by the local alarm server. |
dev | is the device name associated with the property to be called by the local alarm server. |
siz | is the data array size to be called by the local alarm server. |
fmt | is the TINE data format to be called by the local alarm server. |
atyp | is the TINE data array type to be applied to the property called by the local alarm server. |
sev | is the severity of the alarm issued when the data returned by the call exceed the given thresholds. |
sys | is the alarm system identifier to be associated with the alarm. |
thr | is an ALM_THRESHOLDS object specifying the threshold criteria for setting the alarm. |
|
inline |
Inserts a local history element into the local history server.
A server can instruct the local history server to keep a history of the given property by utilizing this call. The local history server will periodically call the property as specified according to the following input parameters. /remarks>
prp | is the requested property for which a history is to be kept. |
dev | is the device name to be associated with the property name supplied as the second parameter. |
len | is the length of the local history call. |
fmt | is the TINE format of the local history call. |
idx | is the local history index to be identified with this local history element (Note: this must be unique with this server process and within the history data repository). |
hspec | is a pointer to a HistorySpecification structure, where the relevant filtering criteria are given. |
Example:
|
inline |
Determines whether the specified property is called in a separate handler thread or not.
property | the property which is to be called on a separate dispatch handler thread. |
value | determines whether the property is called in a separate thread or not (default: false). |
|
inline |
Instructs the local alarm server table that the given alarm is to be cleared.
A server can clear alarms for specific device by giving its device number. Note that all alarms for the device specified are cleared. Also note, that "clearing" an alarm means that its "clear" counter is incremented. It is not removed immediately from the local alarm list. For further information, please see the discussion of the local alarm server.
devNr | is the device number of the device for which all alarms is to be cleared. |
|
inline |
Instructs the local alarm server table that the given alarm is to be cleared.
A server can clear alarms for specific device by giving its device name. Note that all alarms for the device specified are cleared. Also note, that "clearing" an alarm means that its "clear" counter is incremented. It is not removed immediately from the local alarm list. For further information, please see the discussion of the local alarm server.
devName | is the registered device name of the device for which all alarms is to be cleared. |
|
inline |
Returns a ClnInfo structure containing relevant information of the current caller of this equipment module.
If multiple callers are behind the current contract, then only the 'head' of the list is returned.
Example:
|
inline |
Returns the registered device number for the device name given.
device | is the device name whose assigned device number is desired. If the device name entered does not correspond to a registered device the value '-1' is returned. |
|
inline |
Returns the registered device number for the device name and property given.
A pure device server will maintain a list of registered devices, each of which may support any particular given property. In such cases the 'property' parameter is irrelevant, as any associated device number is independent of the property.
On the other hand, a 'property' server will treat properties as the more relevant identifier, whereby each property may support an independent set of 'device' names (or more probably 'keyword' names). In such cases the property name entered is of paramount importance in determining the registered device (or keyword) number.
device | is the device name whose assigned device number is desired. If the device name entered does not correspond to a registered device the value '-1' is returned. |
property | is the property whose device set is being queried. |
Example:
|
inline |
Returns the registered property identification number for the property entered.
property | is the property whose assigned property identification is desired |
|
inline |
Assigns a device name to the specified device number.
Many servers handle instances of a given device type, such as a set of vacuum pumps, beam position monitors, magnet power supply controllers, etc. It is frequently very efficient to code in terms of device numbers which might be an index into an array, but to specify modules in calls by their human-readable names. For such purposes a device name can be assigned to a number at initialization via a call to RegisterDeviceName() (alias: RegisterModuleName()). An alternative is to provide a startup database file 'devices.csv' containing a cross-reference for numbers and names. Internally, a hash table is maintained for fast lookups inside equipment module routines.
devName | Up to 64 characters device name to be assigned |
devNr | The device number associated with the device name specified. |
Example:
References tine.TKernel.RegisterDeviceName().
|
inline |
assigns an alias name to the specified propert
property | is the property name in question |
alias | is an alias which maps to the property in question |
|
inline |
Assigns pertinent information for the specified property.
Servers export their behavior through Properties, which can be thought of as 'properties' in the Object Oriented sense with Get and Set methods. That is, any read or write access for a given property will call into the associated equipment module and be handled there. The general behavior of the property (including descriptions) can be specified with this call. Properties can also be (and frequently are) registered via the presence of an 'exports.csv' startup database file. Note: Properties which are overloaded can and should be registered more than once with the appropriate characteristics supplied in the registration call.
property | Property name in question (up to 32 characters, preferably 16 or less). |
dout | Atemplate data object giving the default format size, and structure tag (if any) of the output data set to be returned by the server to the caller. |
din | A template data object giving the default format size, and structure tag (if any) of the input data set to be supplied by the caller. |
acc | the data 'access' (e.g. CA_READ or CA_WRITE) accepted by the server. This parameter can be used to coerce client-side links into using preferred link attributes. For example, by applying the CA_NETWORK flag (CA_READ|CA_NETWORK) to the access, asynchronous NETWORK (i.g. multicast acquisition) will be enforced at the client side. Applying the CA_XREAD access flag will likewise allow exclusive READ access regarding the registered property (i.e. the same security rules applied to CA_WRITE will be in force for READ acquisitions, either permanently - no CA_READ flag, or temporarily in case of an applied access lock - if both CA_READ and CA_XREAD are applied). Applying the CA_SAVERESTORE flag will apply the internal save-and-restore logic to the registered property (restoring the last property settings upon server startup, and saving any changed property settings). |
atype | Data 'array type' (AT_SCALAR, AT_SINGLE, etc.) associated with the returned data. |
rowLength | if > 0 gives the row length of the returned array data. This is most relevant for double arrays, where the number of rows is then given by the output data size divided by the row length. |
dsc | The 64-character description of what the property reads or writes. |
propId | The property identifier to be associated with the property name returned in calls to GetPropertyId() |
rdr | A redirection string, if the property is to be redirected to another server. Most properties are not redirected, and this parameter is usually NULL. If used, it will be parsed according to device server/device name (device property), where the 'device name' and 'device property' are optional. If 'device name' is not present, all devices will be redirected to the specified device server. If 'device property' is not present then the identical property name as registered will be redirected to the device server specified. If on the other hand, the device property is present in the string to be parsed, then the property registered will be redirected to the device server specified as well as to the device property specified. |
Example:
References tine.TKernel.RegisterPropertyInformation().
|
inline |
Instructs the local alarm server table that the given alarm is to be marked for removal.
A server can remove alarms for specific device by giving its registered device name. Note that only the alarm specified for the device specified is removed. Also note, that "removing" an alarm means that termination bit will be set. It is subsequently marked for removal from the local alarm list. For further information, please see the discussion of the local alarm server.
devName | |
almCode |
|
inline |
Fills the given 'values' object with the last stored property values. The 'values' object passed should be large enough to contain the stored values for all devices (consecutively ordered).
property | the property for which the last stored values will be retrieved |
values | an object large enough to contain all stored values |
This is a do-it-yourself 'restore' routine. i.e. it is the caller's duty to somehow assign the values returned to the given property.
|
inline |
Saves the values in the give 'values' object with the property and device provides.
This is a do-it-yourself 'save' routine. If the associated property is a multi- channel array or other array variant or structure, then the 'device' parameter will ensure that the value are in fact stored in the appropriate spot in the appropriate file.
property | the property for which the values will be saved |
device | the device for which the values will be saved (if applicable) |
values | an object containing the values to associate with the property and device given |
|
inline |
Schedules the given property for immediate delivery to all attached clients.
When clients are attached to a particular property, they have specified a polling rate, which defines the maximum latency for receiving updates at the client side. This is usually fine. However, if a server knows that important data have changed and which properties depend on these data, it can signal the scheduler to call the given properties immediately and send the data to all attached callers, regardless of their registered polling rates. In this way, a server can signal an event to its attached clients. In this simple call, clients from all listening subsystems will be scheduled (i.e. the local history and alarm subsystem as well as any remote clients).
property | is (comma separated) list of properties which are to be scheduled. |
|
inline |
Schedules the given property for immediate delivery to all attached clients according scope specified.
When clients are attached to a particular property, they have specified a polling rate, which defines the maximum latency for receiving updates at the client side. This is usually fine. However, if a server knows that important data have changed and which properties depend on these data, it can signal the scheduler to call the given properties immediately and send the data to all attached callers, regardless of their registered polling rates. In this way, a server can signal an event to its attached clients. In this extended call, the caller can specify the 'scope' of the call : CA_NETWORK (all listening clients), CA_HIST (the local history subsystem) or CA_ALARM (the local alarm server).
property | is (comma separated) list of properties which are to be scheduled. |
scope | is any of CA_NETWORK, CA_HIST, or CA_ALARM ORed together. |
|
inline |
Inserts an alarm into the local alarm server table.
A server can set an alarm for a specific device by giving its device number. For further information, please see the discussion of the local alarm server.
devNr | is the device number of the device for which the alarm is to be set. |
almCode | is the registered alarm code which defines the alarm. |
|
inline |
Inserts an alarm into the local alarm server table.
A server can set an alarm for a specific device by giving its device number. This methods also allows passing associated alarm data and specific alarm flags. For further information, please see the discussion of the local alarm server.
devNr | is the device number of the device for which the alarm is to be set. |
almCode | is the registered alarm code which defines the alarm. |
almData | is (up to 64-byte) the optional alarm data set, which supplies additional information for the alarm. |
almFlags | is the optional set of alarm flags which is used in the alarm descriptor information. |
|
inline |
Inserts an alarm into the local alarm server table.
A server can set an alarm for a specific device by giving its device number. For further information, please see the discussion of the local alarm server.
devNr | is the device number of the device for which the alarm is to be set. |
almCode | is the registered alarm code which defines the alarm. |
tag | is an optional alarm message tag which will override the static tag contained in the alarm definition |
|
inline |
Inserts an alarm into the local alarm server table.
A server can set an alarm for a specific device by giving its device number. This methods also allows passing associated alarm data and specific alarm flags. For further information, please see the discussion of the local alarm server.
devNr | is the device number of the device for which the alarm is to be set. |
almCode | is the registered alarm code which defines the alarm. |
tag | is an optional alarm message tag which will override the static tag contained in the alarm definition |
almData | is (up to 64-byte) the optional alarm data set, which supplies additional information for the alarm. |
almFlags | is the optional set of alarm flags which is used in the alarm descriptor information. |
|
inline |
Inserts an alarm into the local alarm server table.
A server can set an alarm for a specific device by giving its device name (as opposed to its device number). This methods also allows passing associated alarm data and specific alarm flags. For further information, please see the discussion of the local alarm server.
devName | is the device name for which the alarm is to be set. |
almCode | is the registered alarm code which defines the alarm. |
almData | is (up to 64-byte) the optional alarm data set, which supplies additional information for the alarm. |
almFlags | is the optional set of alarm flags which is used in the alarm descriptor information. |
|
inline |
Inserts an alarm into the local alarm server table.
A server can set an alarm for a specific device by giving its device name (as opposed to its device number). This methods also allows passing associated alarm data and specific alarm flags. For further information, please see the discussion of the local alarm server.
devName | is the device name for which the alarm is to be set. |
almCode | is the registered alarm code which defines the alarm. |
tag | is an optional alarm message tag which will override the static tag contained in the alarm definition |
almData | is (up to 64-byte) the optional alarm data set, which supplies additional information for the alarm. |
almFlags | is the optional set of alarm flags which is used in the alarm descriptor information. |
|
inline |
Sets the error string to accompany the current server call
statusString | is the 96-character string which is to accompany the outgoing error code. |
|
getset |
get/set the ScheduleProperty 'lazy' setting