TINE API tools. More...
Functions | |
int | AcquireAndRegisterStruct (char *devName, char *tag, int num) |
Acquires the structure specified by the structure tag from the specified device server. More... | |
void | AppendHistoryLog (char *text,...) |
Appends a line of text to a server's secondary log file. More... | |
int | AssertRangeValid (const char *eqmName, const char *prpName, DTYPE *din, int enforceLimits) |
Helper routine to check input data against registered range limits. More... | |
char * | DataValueToString (char *sbuf, BYTE *data, int idx, short fmt, char *tag, int limit) |
returns the supplied buffer IF the data format fully converts the data into a string else returns NULL (but fills in some diagnostic information in the supplied buffer) More... | |
void | FreeArchivedDataReadbackBuffer (void) |
Frees the internal buffer used to retrieve complex archive data via calls to GetArchivedDataAsAny(). More... | |
int | GetArchivedData (char *devsrv, int index, time_t start, time_t stop, FLTINT *fiDataArray, short *num) |
Retrieves archive data from the 'Central Archiver'. More... | |
int | GetArchivedDataAsAny (char *devsrv, time_t start, time_t stop, HstHdr *dataHdr, BYTE *data, int dataFmt, char *dataTag, int *num) |
Retrieves archive data as requested in the call. More... | |
int | GetArchivedDataAsAnyEx (char *devsrv, time_t start, time_t stop, int index, int sampleRaster, HstHdr *dataHdr, BYTE *data, int dataFmt, char *dataTag, int *num) |
Retrieves archive data as requested in the call (extended form). More... | |
int | GetArchivedDataAsFloat (char *devsrv, time_t start, time_t stop, FLTINT *fiDataArray, int *num) |
Retrieves archive data from the 'Central Archiver' requested in the call. More... | |
int | GetArchivedDataAsSnapshot (char *devsrv, time_t *target, float *fDataArray, int size) |
Retrieves archive data array from the 'Central Archiver' as a snapshot at a given time. More... | |
int | GetArchivedDataAsText (char *devsrv, time_t start, time_t stop, NAME32I *niDataArray, int *num) |
Retrieves archive data as text from the 'Central Archiver'. More... | |
int | GetArchivedTraceDataAsFloat (char *devsrv, time_t start, time_t stop, float *fDataArray, int num) |
Retrieves archive data from the 'Central Archiver' requested in the call. More... | |
int | GetDeviceContexts (NAME16 *clist, int *num) |
Retrieves a list of server contexts via query to the Equipment Name Server. More... | |
int | GetDeviceContextsFromFile (NAME16 *clist, int *num) |
Retrieves a list of server contexts via query to the local static database. More... | |
int | GetDeviceNames (char *srv, NAME16 *devs, int *num) |
Retrieves a list of device names via query to the server given. More... | |
int | GetDeviceNamesEx (char *srv, char *prp, NAME16 *devs, int *num) |
Retrieves a list of device names associated with a given property via query to the server specified. More... | |
int | GetDeviceProperties (char *srv, NAME32 *props, int *num) |
Retrieves a list of properties via query to the server given. More... | |
int | GetDevicePropertyEGU (char *srv, char *prp, float *max, float *min, char *egu) |
Retrieves the maximum, minimum values and engineering units for the property specified. More... | |
int | GetDevicePropertyInformation (char *srv, PropertyQueryStruct *srvProps, int *num) |
Retrieves a list of property query structures for the device server specified. More... | |
int | GetDeviceServers (NAME16 *dslist, int *num) |
Retrieves a list of servers via query to the Equipment Name Server. More... | |
int | GetDeviceServersEx (char *context, NAME16 *dslist, int *num) |
Retrieves a list of servers via query to the Equipment Name Server. More... | |
int | GetDeviceServersFromFile (char *context, NAME16 *dslist, int *num) |
int | GetMyServerAddress (char *eqmName, char *expName, char *ctxName, char *fecName, int *port) |
Obtains FEC and Device server information from the Equipment Name Server based on the address and (optional) local equipment module name of the caller. More... | |
int | GetServers (NAME16 *slist, int *num) |
Retrieves a list of servers via query to the Equipment Name Server. More... | |
int | GetServersEx (char *context, NAME16 *slist, int *num) |
Retrieves a list of FECs via query to the Equipment Name Server. More... | |
int | GetStockProperties (NAME64 *plist, int *num) |
Retrieves a list of available stock properties. More... | |
int | GetStructureAsString (char *tag, void *structref, char *strbuf, int buflen) |
Prepares a string representation of the contents of the tagged structure provided. More... | |
int | GetSystemContexts (NAME32 *clist, int *num) |
Retrieves a list of server contexts via query to the Equipment Name Server. More... | |
int | GetSystemDevices (char *srv, char *prp, NAME64 *dlist, int *num) |
Retrieves a list of device names associated with a given property via query to the server specified. More... | |
int | GetSystemFecs (char *context, NAME16 *slist, int *num) |
Retrieves a list of FECs associated with a given context. More... | |
int | GetSystemProperties (char *srv, NAME64 *plist, int *num) |
Retrieves a list of properties via query to the server given. More... | |
int | GetSystemPropertiesEx (char *srv, NAME64 *plist, int *num, int flags) |
Retrieves a list of properties via query to the server given (extended call) More... | |
int | GetSystemPropertyInformation (char *srv, char *prp, PrpQueryStruct **pqs, int *num) |
Retrieves a list of extended property query structures for the device server and target property specified. More... | |
int | GetSystemServers (char *context, NAME32 *dslist, int *num) |
Retrieves a list of FECs via query to the Equipment Name Server. More... | |
int | GetTargetPropertyInformation (char *srv, char *prp, int *fmt, int *siz, char *dsc) |
Retrieves the default set of property information parameters for the property specified. More... | |
int | GetValuesAsAny (DTYPE *d, void *val, short fmt, int objectSizeInBytes, int num, int offset) |
Retrieves incoming data as an array of the format type given. More... | |
int | GetValuesAsByte (DTYPE *d, BYTE *bval, int num) |
Retrieves incoming data as an array of bytes. More... | |
int | GetValuesAsDBLDBL (DTYPE *d, DBLDBL *ddval, int num) |
Retrieves incoming data as an array of DBLDBL values. More... | |
int | GetValuesAsDouble (DTYPE *d, double *dval, int num) |
Retrieves incoming data as an array of doubles. More... | |
int | GetValuesAsFloat (DTYPE *d, float *fval, int num) |
Retrieves incoming data as an array of floats. More... | |
int | GetValuesAsLong (DTYPE *d, SINT32 *lval, int num) |
Retrieves incoming data as an array of long integers. More... | |
int | GetValuesAsNAME64DBL (DTYPE *d, NAME64DBL *ndval, int num) |
Retrieves incoming data as an array of NAME64DBL values. More... | |
int | GetValuesAsNAME64DBLDBL (DTYPE *d, NAME64DBLDBL *nddval, int num) |
Retrieves incoming data as an array of NAME64DBLDBL values. More... | |
int | GetValuesAsShort (DTYPE *d, short *sval, int num) |
Retrieves incoming data as an array of short integers. More... | |
int | GetValuesAsString (DTYPE *d, char *str, UINT32 *dsiz) |
Retrieves incoming data as a string buffer. More... | |
int | GetValuesAsStringEx (DTYPE *d, char *str, int fmt, int num, int offset) |
Prepares incoming data to a string type. More... | |
int | PrintToLogbook (char *proxy, char *logbook, char *header, char *severity, char *author, char *message, BYTE *imageBytes, int imageLength, int addStatusInformation) |
sends the given input to an electronic logbook More... | |
int | PutArchivedData (char *devsrv, BYTE *data, int dataFmt, int num, double dataTime, int sysStamp, int usrStamp) |
puts data and timestamps into the central archive system for 'SELF' entries More... | |
int | PutValuesFromAny (DTYPE *d, void *val, short fmt, int sgn, int objectSizeInBytes, int num, int offset) |
Submits outgoing data from an array of the given format data type. More... | |
int | PutValuesFromByteEx (DTYPE *d, BYTE *bval, int num, int offset) |
Submits outgoing data from an array of bytes. More... | |
int | PutValuesFromDoubleEx (DTYPE *d, double *dval, int num, int offset) |
Submits outgoing data from an array of doubles. More... | |
int | PutValuesFromFloatEx (DTYPE *d, float *fval, int num, int offset) |
Submits outgoing data from an array of floats. More... | |
int | PutValuesFromLongEx (DTYPE *d, SINT32 *lval, int num, int offset) |
Submits outgoing data from an array of long integers. More... | |
int | PutValuesFromShortEx (DTYPE *d, short *sval, int num, int offset) |
Submits outgoing data from an array of short integers. More... | |
int | PutValuesFromString (DTYPE *d, char *str, int fmt, int num, int offset) |
Prepares outgoing data as a string type. More... | |
int | PutValuesFromUnsignedLongEx (DTYPE *d, UINT32 *lval, int num, int offset) |
Submits outgoing data from an array of unsigned long (32-bit) integers. More... | |
int | PutValuesFromUnsignedShortEx (DTYPE *d, UINT16 *sval, int num, int offset) |
Submits outgoing data from an array of unsigned short integers. More... | |
int | RestorePropertyValues (const char *eqmName, const char *prpName, void *values, short format, int size) |
Retrieves the value settings of the property name given from disk. More... | |
int | SavePropertyValues (const char *eqmName, const char *prpName, void *values, short format, int size) |
Saves value settings of the property name given onto disk. More... | |
int | SavePropertyValuesEx (const char *eqmName, const char *devName, const char *prpName, void *values, short format, int size) |
Saves value settings of the property name given onto disk (extended version). More... | |
int | SendEventTrigger (char *dev, char *cmt, short triggerLevel) |
Sends a Post-Mortem (i.e. event) Trigger to the designated Post-Mortem Server. More... | |
int | SendEventTriggerEx (char *dev, char *cmt, int triggerLevel, int triggerTime, int rangeStart, int rangeStop, int rangeMax, int options) |
Sends a Post-Mortem (i.e. event) Trigger to the designated Post-Mortem Server. More... | |
void | SetDisplayExtraDigits (int value) |
prints double variables with with precision in log files More... | |
int | SetValuesAsStringSeparator (char *str) |
sets the separator to be used by getValuesAsString() and GetValuesArrayAsString() More... | |
int | StringToDataValue (BYTE *data, char *sbuf, int idx, short fmt, char *tag, int limit) |
parses input string into the designated array element of the format type given. More... | |
Variables | |
int | fecLogFileDepth = 500 |
Sets the depth in lines of a server's secondary log file (if utilized). More... | |
TINE API tools.
Many optional routines are offered to make programming easier. Below are API routines which are useful both for client-side programming and server-side programming. Some query calls such as GetDeviceNames(), etc. are clearly suitable for information gathering. The set of of data manipulation routines such at GetValuesAsFloat() or PutValuesFromLongEx() are designed for easy integration into server code, where format conversion, array-wrapping, array segmenting, etc. are automatically provided. Helper routines such as sendPMTrigger() are also provided.
int AcquireAndRegisterStruct | ( | char * | devName, |
char * | tag, | ||
int | num | ||
) |
Acquires the structure specified by the structure tag from the specified device server.
This routine is largly useful for generic applications which need to display results. Logic which requires knowing 'which field does what' will in general also require knowing a priori the structure fields.
devName | is the targeted device server where the structure is registered. |
tag | is the structure tag |
num | is the maximum number of structure objects of this type which can be stord locally. Note that due to alignment, byte-swapping and memory issues, the TINE kernel needs to reserve enough space to prepare incoming structures for the caller. |
void AppendHistoryLog | ( | char * | str, |
... | |||
) |
Appends a line of text to a server's secondary log file.
For most cases the system log file "fec.log" is sufficient for logging server activities. Furthermore, "fec.log" is retrievable via a systematic TINE call so that it can be viewed from a remote location without requiring a mount to a file system. However, for more detailing logging you may want to make use of a secondary log file whose name is given by <fecName>.log. This log file resides only on the local file system.
str | is a 'printf'-like variable argument list string containing the text to be appended |
int AssertRangeValid | ( | const char * | eqmName, |
const char * | prpName, | ||
DTYPE * | din, | ||
int | enforceLimits | ||
) |
Helper routine to check input data against registered range limits.
This routine returns TRUE if the given input does not violate the registered range settings for the property given.
Any errors in input will result in a 'TRUE' being returned. If the 'enforceLimits' parameter is 'TRUE' then the routine will always return TRUE but will mutate the DTYPE object so that any range exceptions are set to the registered maximum or minimum values.
This helper routine will only consider input data objects supplying a single valued 'primitive' numerical format type.
eqmName | is the local equipment module name. |
prpName | is the name of the property whose values are to be restored |
din | is a reference to input data to be checked against the registered range settings. |
enforceLimits | will insert the corresponding maximum or minimum value into the din object reference should any range exception be detected. |
References DUNION::bptr, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, DUNION::dptr, DUNION::fptr, GetRegisteredPropertyListStruct(), DUNION::lptr, DUNION::sptr, DUNION::ulptr, and DUNION::usptr.
char* DataValueToString | ( | char * | sbuf, |
BYTE * | data, | ||
int | idx, | ||
short | fmt, | ||
char * | tag, | ||
int | limit | ||
) |
returns the supplied buffer IF the data format fully converts the data into a string else returns NULL (but fills in some diagnostic information in the supplied buffer)
used in prepDumpData() as well as some save-and-restore routines, etc. where a string representation of data is needed.
sbuf | is the string buffer to hold the converted string |
data | is a pointer to the data (value or array) which is to be converted to a string |
idx | is the starting array index if data points to an array |
fmt | is the TINE format code describing the data |
tag | is the data tag if the given data represents a tagged format (e.g. CF_STRUCT) |
limit | is the maximum array length, i.e. buffer length of the data passed. |
void FreeArchivedDataReadbackBuffer | ( | void | ) |
Frees the internal buffer used to retrieve complex archive data via calls to GetArchivedDataAsAny().
Calls to GetArchivedDataAsAny() will make use of an archive data readback buffer which will be (re)allocated to maintain sufficient capactity to retrieve complex archive data via the CF_HISTORY data type. This buffer once allocated will remain in memory until explicity freed by making use of this routine.
int GetArchivedData | ( | char * | keyword, |
int | keyindex, | ||
time_t | start, | ||
time_t | stop, | ||
FLTINT * | fiDataArray, | ||
short * | num | ||
) |
Retrieves archive data from the 'Central Archiver'.
This call retrieves archive data from either the default 'Central Archive' or the archiver requested in the call.
keyword | [in] is either the keyword-appended full device server name for which the archive data is desired or simply the keyword, in which case the default central archiver is called (registered with export name "HISTORY"). |
keyindex | [in] is an optional index (if non-zero) into a keyword array (for instance if the keyword is a trace. |
start | [in] is the start time input (expressed as a UNIX timestamp) for which the archive data are desired. |
stop | [in] is the end time input (expressed as a UNIX timestamp) for which the archive data are desired. |
fiDataArray | [out] is a pointer to array of FLTINT objects to receive the archive data. |
num | [in/out] is a pointer to an integer giving (as input) the size of the FLTINT buffer which is to receive the archive data, and (as ouput) which contains the amount of archive data actually returned by the call. |
References buffer_too_small.
int GetArchivedDataAsAny | ( | char * | devsrv, |
time_t | start, | ||
time_t | stop, | ||
HstHdr * | dataHdr, | ||
BYTE * | data, | ||
int | dataFmt, | ||
char * | dataTag, | ||
int * | num | ||
) |
Retrieves archive data as requested in the call.
This call retrieves archive data from the archiver requested in the call. This call retrieves an archived data set according to the data format given.
devsrv | [in] must be the keyword-appended full device server name for which the archive data is desired. |
start | [in] is the start time input (expressed as a UNIX timestamp) for which the archive data are desired. |
stop | [in] is the end time input (expressed as a UNIX timestamp) for which the archive data are desired. |
dataHdr | [out] is a pointer to an array to hold the history header information. This is an array of HstHdr objects containing a TINE timestamp (UTC double), a system data stamp (32-bit integer) and the user data stamp (32-bit integer) in one-to-one correspondence with the data array returned. |
data | [out] is a pointer to an array of data objects to receive the archive data. This should an array of the desired data format (and large enough to hold the requested data). |
dataFmt | [in] is the TINE data format code of the requested data. If this doesn't match the stored format, an attempt will be made to reformat the data. However this will not always be possible and could lead to an error. |
dataTag | [in] is the TINE tagged structure tag to be used if the stored data is a TINE tagged structure. If the stored data is not a structure, this parameter is ignored. |
num | [in/out] is a pointer to an integer giving (as input) the size of the data buffer which is to receive the archive data, and (as ouput) which contains the amount of archive data actually returned by the call. |
Example:
generates the following output:
References GetArchivedDataAsAnyEx().
int GetArchivedDataAsAnyEx | ( | char * | devsrv, |
time_t | start, | ||
time_t | stop, | ||
int | index, | ||
int | sampleRaster, | ||
HstHdr * | dataHdr, | ||
BYTE * | data, | ||
int | dataFmt, | ||
char * | dataTag, | ||
int * | num | ||
) |
Retrieves archive data as requested in the call (extended form).
This call retrieves archive data from the archiver requested in the call. This call retrieves an archived data set according to the data format given. It differs from GetArchivedDataAsAny() in that it allows a specific array index as well as the desired sampling raster to be input.
devsrv | [in] must be the keyword-appended full device server name for which the archive data is desired. |
start | [in] is the start time input (expressed as a UNIX timestamp) for which the archive data are desired. |
stop | [in] is the end time input (expressed as a UNIX timestamp) for which the archive data are desired. |
index | [in] is the desired array index to be retrieved. This only applied if the value of index is > 0 and the target data record is an array. In case of multi-channel arrays, the device name generally gives the targeted array element index. |
sampleRaster | [in] gives the desired sampling raster for the targeted server to use. if <= 0 the sampling raster is determined by the server in order to best honor the desired time range (and insert any points of interest into the returned data set). |
dataHdr | [out] is a pointer to an array to hold the history header information. This is an array of HstHdr objects containing a TINE timestamp (UTC double), a system data stamp (32-bit integer) and the user data stamp (32-bit integer) in one-to-one correspondence with the data array returned. |
data | [out] is a pointer to an array of data objects to receive the archive data. This should an array of the desired data format (and large enough to hold the requested data). |
dataFmt | [in] is the TINE data format code of the requested data. If this doesn't match the stored format, an attempt will be made to reformat the data. However this will not always be possible and could lead to an error. |
dataTag | [in] is the TINE tagged structure tag to be used if the stored data is a TINE tagged structure. If the stored data is not a structure, this parameter is ignored. |
num | [in/out] is a pointer to an integer giving (as input) the size of the data buffer which is to receive the archive data, and (as ouput) which contains the amount of archive data actually returned by the call. |
Example:
generates the following output:
References argument_list_error, and buffer_too_small.
Referenced by GetArchivedDataAsAny().
int GetArchivedDataAsFloat | ( | char * | devsrv, |
time_t | start, | ||
time_t | stop, | ||
FLTINT * | fiDataArray, | ||
int * | num | ||
) |
Retrieves archive data from the 'Central Archiver' requested in the call.
This call retrieves archive data from the archiver requested in the call. This call supercedes GetArchivedData(), which still allows a simple call into the 'default central archiver'.
devsrv | [in] must be the keyword-appended full device server name for which the archive data is desired. |
start | [in] is the start time input (expressed as a UNIX timestamp) for which the archive data are desired. |
stop | [in] is the end time input (expressed as a UNIX timestamp) for which the archive data are desired. |
fiDataArray | [out] is a pointer to array of FLTINT objects to receive the archive data. |
num | [in/out] is a pointer to an integer giving (as input) the size of the FLTINT buffer which is to receive the archive data, and (as ouput) which contains the amount of archive data actually returned by the call. |
References buffer_too_small.
int GetArchivedDataAsSnapshot | ( | char * | devsrv, |
time_t * | target, | ||
float * | fDataArray, | ||
int | size | ||
) |
Retrieves archive data array from the 'Central Archiver' as a snapshot at a given time.
This call retrieves an archive data array from either the default 'Central Archive' or the archiver requested in the call.
devsrv | [in] must be the keyword-appended full device server name for which the archive data is desired. |
target | [in] is the target time input (expressed as a UNIX timestamp) for which the archive data are desired. |
fDataArray | [out] is a pointer to array of floats to receive the archive data. |
size | [in] gives the size of the float buffer which is to receive the archive data, and is likewise used to specify the size of the trace, waveform or spectrum which has been archived. |
References argument_list_error, and buffer_too_small.
int GetArchivedDataAsText | ( | char * | devsrv, |
time_t | start, | ||
time_t | stop, | ||
NAME32I * | niDataArray, | ||
int * | num | ||
) |
Retrieves archive data as text from the 'Central Archiver'.
This call retrieves archive data as text from the archiver requested in the call.
devsrv | [in] is the keyword-appended full device server name for which the archive data is desired. |
start | [in] is the start time input (expressed as a UNIX timestamp) for which the archive data are desired. |
stop | [in] is the end time input (expressed as a UNIX timestamp) for which the archive data are desired. |
niDataArray | [out] is a pointer to array of NAME32I objects to receive the archive data. |
num | [in/out] is a pointer to an integer giving (as input) the size of the FLTINT buffer which is to receive the archive data, and (as ouput) which contains the amount of archive data actually returned by the call. |
References buffer_too_small.
int GetArchivedTraceDataAsFloat | ( | char * | devsrv, |
time_t | start, | ||
time_t | stop, | ||
float * | fDataArray, | ||
int | num | ||
) |
Retrieves archive data from the 'Central Archiver' requested in the call.
This call retrieves archive data from the archiver requested in the call, and will deliver the contents of an archived keyword at a particular timestamp, which is particularly useful when the keyword represents a trace, waveform, or spectrum.
devsrv | [in] must be the keyword-appended full device server name for which the archive data is desired. |
start | [in] is the start time input (expressed as a UNIX timestamp) for which the archive data are desired. |
stop | [in] is the end time input (expressed as a UNIX timestamp) for which the archive data are desired. |
fDataArray | [out] is a pointer to array of floats to receive the archive data. |
num | [in] gives the size of the float buffer which is to receive the archive data, and is likewise used to specify the size of the trace, waveform or spectrum which has been archived. To this end, this must indeed match the size of the record archived or the call will fail. |
References buffer_too_small.
int GetDeviceContexts | ( | NAME16 * | clist, |
int * | num | ||
) |
Retrieves a list of server contexts via query to the Equipment Name Server.
This call retrieves a list of all server context managed by the Equipment Name Server
clist | is a pointer to a NAME16 buffer to receive the name list. |
num | is the size of the buffer pointed to by the first parameter. Note that this buffer space must be pre-allocated, otherwise a system crash will ensue. |
int GetDeviceContextsFromFile | ( | NAME16 * | clist, |
int * | num | ||
) |
Retrieves a list of server contexts via query to the local static database.
This call retrieves a list of all server context managed by the local static database.
clist | is a pointer to a NAME16 buffer to receive the name list. |
num | is the size of the buffer pointed to by the first parameter. Note that this buffer space must be pre-allocated, otherwise a system crash will ensue. |
References argument_list_error, no_such_column, and no_such_file.
int GetDeviceNames | ( | char * | srv, |
NAME16 * | dlist, | ||
int * | num | ||
) |
Retrieves a list of device names via query to the server given.
This call retrieves a list of all device names registered on the server. A classic device server will export its behavior through its properties, and export its "instances" through its "device names", according to the motto "All devices found on this server have the same set of properties, and all properties apply to any device found on this server". Under some circumstances this is not true, in which case a more generalized query GetDeviceNamesEx() is required to retrieve a device list associated with a given property.
srv | is the full device server name for which the property query is to be made |
dlist | is a pointer to a NAME16 buffer to receive the name list. |
num | is the size of the buffer pointed to by the first parameter. Note that this buffer space must be pre-allocated, otherwise a system crash will ensue. |
References GetDeviceNamesEx().
int GetDeviceNamesEx | ( | char * | srv, |
char * | prp, | ||
NAME16 * | dlist, | ||
int * | num | ||
) |
Retrieves a list of device names associated with a given property via query to the server specified.
This call retrieves a list of all device names registered on the server associated with the property specified in the call. A classic device server will export its behavior through its properties, and export its "instances" through its "device names", according to the motto "All devices found on this server have the same set of properties, and all properties apply to any device found on this server". For certain classes of server (in particular middle layer servers) the properties exported might refer to 'apples' and 'oranges' simply because the server is archiving them. Or there might be other reasons why the device list associated with a particular property has little or nothing to do with that associated with some other property. Use this call to obtain the device list associated with a particular property.
srv | is the full device server name for which the property query is to be made |
prp | is the property for which the device list is desired. |
dlist | is a pointer to a NAME16 buffer to receive the name list. |
num | is the size of the buffer pointed to by the first parameter. Note that this buffer space must be pre-allocated, otherwise a system crash will ensue. |
Referenced by GetDeviceNames().
int GetDeviceProperties | ( | char * | srv, |
NAME32 * | plist, | ||
int * | num | ||
) |
Retrieves a list of properties via query to the server given.
This call retrieves a list of all properties registered on the server associated with full device server name specified. A classic device server will export its behavior through its properties, and export its "instances" through its "device names", according to the motto "All devices found on this server have the same set of properties, and all properties apply to any device found on this server". In this case, simply specifying the device server name as the first input parameter will return the set of properties valid for all devices registered on the server. Under some circumstances, however, the set of properties associated with a particular device might be different from device to device. If this is the case, the full device server name should be used as the first parameter, where the target device name is also sent as part of the query.
srv | is the full device server name for which the property query is to be made |
plist | is a pointer to a NAME32 buffer to receive the name list. |
num | is the size of the buffer pointed to by the first parameter. Note that this buffer space must be pre-allocated, otherwise a system crash will ensue. |
References buffer_too_small, DUNION::cptr, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, and ExecLinkEx().
int GetDevicePropertyEGU | ( | char * | srv, |
char * | prp, | ||
float * | max, | ||
float * | min, | ||
char * | egu | ||
) |
Retrieves the maximum, minimum values and engineering units for the property specified.
This call retrieves the maximum, minimum values and engineering units for the property specified.
srv | [in] is the full device server name for which the property query is to be made |
prp | [in] is the property for which the information is desired. |
max | [out] is a pointer to receive maximum property value (if non-NULL) as registered. |
min | [out] is a pointer to receive minimum property value (if non-NULL) as registered. |
egu | [out] is a string buffer to receive the property engineering unit (if non-NULL). Note that buffer space must be pre-allocated, otherwise a system crash will ensue. |
References DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, ExecLinkEx(), DUSTRING::f1val, DUSTRING::f2val, DUSTRING::str, and DUNION::vptr.
int GetDevicePropertyInformation | ( | char * | srv, |
PropertyQueryStruct * | srvProps, | ||
int * | num | ||
) |
Retrieves a list of property query structures for the device server specified.
This call retrieves a list of property information parameters in the form of PropertyQueryStruct structures for the device server specified.
srv | [in] is the full device server name for which the property query is to be made |
srvProps | [out] is a pointer to an array of PropertyQueryStruct objects. Note that buffer space must be pre-allocated, otherwise a system crash will ensue. |
num | [in/out] as input is a pointer to the maximum number of PropertyQueryStruct objects which srvProps can hold. As output it contains the total number of properties. |
References buffer_too_small, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, DTYPE::dTag, ExecLinkEx(), and DUNION::vptr.
int GetDeviceServers | ( | NAME16 * | dslist, |
int * | num | ||
) |
Retrieves a list of servers via query to the Equipment Name Server.
This call simply retrieves a list of all devices servers irrespective of server context. For a context specific list, please use the extended call GetDeviceServersEx().
dslist | is a pointer to a NAME16 buffer to receive the name list. |
num | is the size of the buffer pointed to by the first parameter. Note that this buffer space must be pre-allocated, otherwise a system crash will ensue. |
int GetDeviceServersEx | ( | char * | context, |
NAME16 * | dslist, | ||
int * | num | ||
) |
Retrieves a list of servers via query to the Equipment Name Server.
\deprectated This call retrieves a list of all devices servers associated with the context given.
context | is the context for which the query is to be made |
dslist | is a pointer to a NAME16 buffer to receive the name list. |
num | is the size of the buffer pointed to by the first parameter. Note that this buffer space must be pre-allocated, otherwise a system crash will ensue. |
int GetDeviceServersFromFile | ( | char * | context, |
NAME16 * | dslist, | ||
int * | num | ||
) |
This call retrieves a list of all devices servers associated with the context given, as obtained from the local static database.
context | is the context for which the query is to be made |
dslist | is a pointer to a NAME16 buffer to receive the name list. |
num | is the size of the buffer pointed to by the first parameter. Note that this buffer space must be pre-allocated, otherwise a system crash will ensue. |
References argument_list_error, and no_such_file.
int GetMyServerAddress | ( | char * | eqmName, |
char * | expName, | ||
char * | ctxName, | ||
char * | fecName, | ||
int * | port | ||
) |
Obtains FEC and Device server information from the Equipment Name Server based on the address and (optional) local equipment module name of the caller.
A diskless (or otherwise 'in-a-box') server which does not know its address parameters such as fec name, export name, context, port offset, etc. can make this call prior to initializing. Upon success, a call to RegisterFecInformation() can then be made to fix these parameters within the server process.
ctxName | (output optional) the Context of local server. |
eqmName | (input/output optional)the local equipment module name of local server. |
expName | (output optional) the exported device server name of the local server. |
fecName | (output optional) is the FEC name of the local server. |
port | (output optional) is the port offset of the local server. to the call. |
int GetServers | ( | NAME16 * | slist, |
int * | num | ||
) |
Retrieves a list of servers via query to the Equipment Name Server.
This call simply retrieves a list of all Front End Computer Names (FECs) irrespective of server context. For a context specific list, please use the extended call GetServersEx().
slist | is a pointer to a NAME16 buffer to receive the name list. |
num | is the size of the buffer pointed to by the first parameter. Note that this buffer space must be pre-allocated, otherwise a system crash will ensue. |
int GetServersEx | ( | char * | context, |
NAME16 * | slist, | ||
int * | num | ||
) |
Retrieves a list of FECs via query to the Equipment Name Server.
This call retrieves a list of all Front End Computer Names (FECs) associated with the server context given.
context | is the context for which the query is to be made |
slist | is a pointer to a NAME16 buffer to receive the name list. |
num | is the size of the buffer pointed to by the first parameter. Note that this buffer space must be pre-allocated, otherwise a system crash will ensue. |
int GetStockProperties | ( | NAME64 * | plist, |
int * | num | ||
) |
Retrieves a list of available stock properties.
plist | is a pointer to a NAME64 buffer to receive the name list. |
num | is the size of the buffer pointed to by the first parameter. Note that this buffer space must be pre-allocated, otherwise a system crash will ensue. |
References argument_list_error, and buffer_too_small.
int GetStructureAsString | ( | char * | tag, |
void * | structref, | ||
char * | strbuf, | ||
int | buflen | ||
) |
Prepares a string representation of the contents of the tagged structure provided.
tag | is the structure tag corresponding to the structure passed If the tag provided does not correspond to a duly registered tagged structure then the function will return 'not_registered'. |
structref | is a pointer to the structure to be parsed into a string. |
strbuf | is the buffer to receive the string representation. |
buflen | is the length of the string buffer provided. If this buffer is not large enough to hold the string representation, the structure parsing will stop. |
References argument_list_error, DUNION::bptr, buffer_too_small, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, DTYPE::dTag, not_registered, and out_of_local_memory.
int GetSystemContexts | ( | NAME32 * | clist, |
int * | num | ||
) |
Retrieves a list of server contexts via query to the Equipment Name Server.
This call retrieves a list of all server context managed by the Equipment Name Server
clist | is a pointer to a NAME32 buffer to receive the name list. |
num | is the size of the buffer pointed to by the first parameter. Note that this buffer space must be pre-allocated, otherwise a system crash will ensue. |
int GetSystemDevices | ( | char * | srv, |
char * | prp, | ||
NAME64 * | dlist, | ||
int * | num | ||
) |
Retrieves a list of device names associated with a given property via query to the server specified.
This call retrieves a list of all device names registered on the server associated with the property specified in the call. A classic device server will export its behavior through its properties, and export its "instances" through its "device names", according to the motto "All devices found on this server have the same set of properties, and all properties apply to any device found on this server". For certain classes of server (in particular middle layer servers) the properties exported might refer to 'apples' and 'oranges' simply because the server is archiving them. Or there might be other reasons why the device list associated with a particular property has little or nothing to do with that associated with some other property. Use this call to obtain the device list associated with a particular property.
srv | is the full device server name for which the property query is to be made |
prp | is the property for which the device list is desired. |
dlist | is a pointer to a NAME64 buffer to receive the name list. |
num | is the size of the buffer pointed to by the first parameter. Note that this buffer space must be pre-allocated, otherwise a system crash will ensue. |
int GetSystemFecs | ( | char * | context, |
NAME16 * | slist, | ||
int * | num | ||
) |
Retrieves a list of FECs associated with a given context.
This call retrieves a list of all FEC names associated with the context specified in the call. The call is made the equipment name server.
context | (input) is the context for which the FEC list is desired. If NULL or an empty string, a list of all known FECS is returned. |
slist | is a pointer to a NAME16 buffer to receive the FEC name list. |
num | is the size of the buffer pointed to by the first parameter. Note that this buffer space must be pre-allocated, otherwise a system crash will ensue. |
int GetSystemProperties | ( | char * | srv, |
NAME64 * | plist, | ||
int * | num | ||
) |
Retrieves a list of properties via query to the server given.
This call retrieves a list of all properties registered on the server associated with full device server name specified. A classic device server will export its behavior through its properties, and export its "instances" through its "device names", according to the motto "All devices found on this server have the same set of properties, and all properties apply to any device found on this server". In this case, simply specifying the device server name as the first input parameter will return the set of properties valid for all devices registered on the server. Under some circumstances, however, the set of properties associated with a particular device might be different from device to device. If this is the case, the full device server name should be used as the first parameter, where the target device name is also sent as part of the query.
srv | is the full device server name for which the property query is to be made |
plist | is a pointer to a NAME64 buffer to receive the name list. |
num | is the size of the buffer pointed to by the first parameter. Note that this buffer space must be pre-allocated, otherwise a system crash will ensue. |
References GetSystemPropertiesEx().
int GetSystemPropertiesEx | ( | char * | srv, |
NAME64 * | plist, | ||
int * | num, | ||
int | flags | ||
) |
Retrieves a list of properties via query to the server given (extended call)
This call retrieves a list of all properties registered on the server associated with full device server name specified. A classic device server will export its behavior through its properties, and export its "instances" through its "device names", according to the motto "All devices found on this server have the same set of properties, and all properties apply to any device found on this server". In this case, simply specifying the device server name as the first input parameter will return the set of properties valid for all devices registered on the server. Under some circumstances, however, the set of properties associated with a particular device might be different from device to device. If this is the case, the full device server name should be used as the first parameter, where the target device name is also sent as part of the query.
srv | is the full device server name for which the property query is to be made |
plist | is a pointer to a NAME64 buffer to receive the name list. |
num | is the size of the buffer pointed to by the first parameter. Note that this buffer space must be pre-allocated, otherwise a system crash will ensue. |
flags | gives specific query instructions, i.e. a combination of PRP_REGISTERED (default), PRP_STOCK, PRP_META |
References argument_list_error, buffer_too_small, DUNION::cptr, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, and ExecLinkEx().
Referenced by GetSystemProperties().
int GetSystemPropertyInformation | ( | char * | srv, |
char * | prp, | ||
PrpQueryStruct ** | srvProps, | ||
int * | num | ||
) |
Retrieves a list of extended property query structures for the device server and target property specified.
This call retrieves a list of all relevant property information parameters in the form of PrpQueryStruct structures for the device server and target property specified.
srv | [in] is the full device server name for which the property query is to be made |
prp | [in] is the property name for which the extended property query is to be made. Passing a NULL for this parameter will result in the query returning information for all properties until the buffer space (given by 'num') is exhausted. Passing a wildcard character '*' will return information for those properties matching the pattern given. |
srvProps | [in/out] is a pointer to a pointer to an array of PrpQueryStruct objects. The property query objects contain all detailed information concerning the queried property. If this pointer points to a NULL pointer (unallocated), the buffer space will be allocated by the call and assigned to the pointer given, in which case it is the caller's duty to free the memory when no longer needed. If this pointer points to a non-NULL pointer (pre-allocated), the the buffer space pointed to must be sufficient to handle the number of structures given by the num parameter. |
num | [in/out] as input is a pointer to the maximum number of PrpQueryStruct objects which srvProps can hold. As output it contains the total number of properties found. If the number pointed to is 0, then the number of properties is ascertained from the target server. In this case, the srvProps parameter usually points to a NULL (unassigned) pointer. |
References DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, ExecLinkEx(), invalid_parameter, out_of_local_memory, and DUNION::vptr.
Referenced by GetTargetPropertyInformation().
int GetSystemServers | ( | char * | context, |
NAME32 * | dslist, | ||
int * | num | ||
) |
Retrieves a list of FECs via query to the Equipment Name Server.
This call retrieves a list of all Front End Computer Names (FECs) associated with the server context given. In addition, the context string can carry a targeted subsystem for a more specific list.
context | is the context for which the query is to be made. A narrower query can also be made, where only servers belonging to a specific subsystem are returned. If this is desired, then pass a context string of the form 'context/subsystem' (e.g. "PETRA/DIAG"). |
dslist | is a pointer to a NAME32 buffer to receive the name list. |
num | is the size of the buffer pointed to by the first parameter. Note that this buffer space must be pre-allocated, otherwise a system crash will ensue. |
int GetTargetPropertyInformation | ( | char * | srv, |
char * | prp, | ||
int * | fmt, | ||
int * | siz, | ||
char * | dsc | ||
) |
Retrieves the default set of property information parameters for the property specified.
This call retrieves the default set of property information parameters for the property specified.
srv | [in] is the full device server name for which the property query is to be made |
prp | [in] is the property for which the information is desired. |
fmt | [out] is a pointer to receive the TINE format data type (if non-NULL). |
siz | [out] is a pointer to receive the data size (if non-NULL) |
dsc | [out] is a string buffer (minimum 64 characters) to receive the property description (if non-NULL). Note that buffer space must be pre-allocated, otherwise a system crash will ensue. |
References GetSystemPropertyInformation().
int GetValuesAsAny | ( | DTYPE * | d, |
void * | val, | ||
short | fmt, | ||
int | objectSizeInBytes, | ||
int | num, | ||
int | offset | ||
) |
Retrieves incoming data as an array of the format type given.
This routine will convert incoming data if possible to an array of the given format
d | is a TINE DTYPE data object from which the incoming data is to be used. |
val | is a pointer to the destination data |
fmt | is the TINE format data type of the destination data. This should be one of CF_BYTE, CF_INT16, CF_INT32, CF_FLOAT, CF_DOUBLE, etc. (any valid TINE format) |
objectSizeInBytes | is the size in bytes of the containing object. For instance, 'val' might point to a float value embedded in a structure, so objectSizeInBytes should be the size of the structure in this case. If objectSizeInBytes is smaller than the size of 'fmt' then an error is returned. |
num | is the number of array elements contained in the destination array |
offset | is the starting point in the destination data array |
int GetValuesAsByte | ( | DTYPE * | d, |
BYTE * | bval, | ||
int | num | ||
) |
Retrieves incoming data as an array of bytes.
This routine will convert incoming data if possible to an array of bytes (unsigned chars). If it is not possible to convert to an array of bytes an error is returned.
d | is a TINE DTYPE data object containing the incoming data. |
bval | is a pointer to the byte array to receive the converted input data \num is the maximum number of array elements which the byte array can hold |
Retrieves incoming data as an array of DBLDBL values.
This routine will convert incoming data if possible to an array of DBLDBL doublets. For instance, FLTINT values or INTINT values will be cast into doubles. If it is not possible to convert to a string an error is returned.
d | is a TINE DTYPE data object containing the incoming data. |
ddva | is a pointer to the buffer to receive the converted input data |
num | is the maximum size of the string buffer |
References argument_list_error, DBLDBL::d1val, DBLDBL::d2val, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, dimension_error, illegal_format, and DUNION::vptr.
int GetValuesAsDouble | ( | DTYPE * | d, |
double * | dval, | ||
int | num | ||
) |
Retrieves incoming data as an array of doubles.
This routine will convert incoming data if possible to an array of doubles. If it is not possible to convert to an array of doubles an error is returned.
d | is a TINE DTYPE data object containing the incoming data. |
dval | is a pointer to the double array to receive the converted input data |
num | is the maximum number of array elements which the double array can hold |
Alias: GetValuesAsDouble()
Example: (see GetValuesAsShort() for example)
int GetValuesAsFloat | ( | DTYPE * | d, |
float * | fval, | ||
int | num | ||
) |
Retrieves incoming data as an array of floats.
This routine will convert incoming data if possible to an array of floats. If it is not possible to convert to an array of floats an error is returned.
d | is a TINE DTYPE data object containing the incoming data. |
fval | is a pointer to the float array to receive the converted input data |
num | is the maximum number of array elements which the float array can hold |
Alias: GetValuesAsFloat()
Example: (see GetValuesAsShort() for example)
int GetValuesAsLong | ( | DTYPE * | d, |
SINT32 * | lval, | ||
int | num | ||
) |
Retrieves incoming data as an array of long integers.
This routine will convert incoming data if possible to an array of long integers. If it is not possible to convert to an array of long integers an error is returned.
d | is a TINE DTYPE data object containing the incoming data. |
lval | is a pointer to the long 32-bit integer array to receive the converted input data |
num | is the maximum number of array elements which the long integer array can hold |
Example: (see getValuesAsShort() for example)
Retrieves incoming data as an array of NAME64DBL values.
This routine will convert incoming data if possible to an array of NAME64DBL doublets. For instance, NAME8INT values or NAME32INT values will be cast into NAME64DBL values. If it is not possible to convert to a string an error is returned.
d | is a TINE DTYPE data object containing the incoming data. |
ddva | is a pointer to the buffer to receive the converted input data |
num | is the maximum size of the string buffer |
References argument_list_error, DUNION::cptr, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, dimension_error, NAME64DBL::dval, illegal_format, and DUNION::vptr.
int GetValuesAsNAME64DBLDBL | ( | DTYPE * | d, |
NAME64DBLDBL * | nddval, | ||
int | num | ||
) |
Retrieves incoming data as an array of NAME64DBLDBL values.
This routine will convert incoming data if possible to an array of NAME64DBLDBL triplets. For instance, NAME16FLTINT values or NAME32DBLDBL values will be cast into NAME64DBLDBL values. If it is not possible to convert to a string an error is returned.
d | is a TINE DTYPE data object containing the incoming data. |
ddva | is a pointer to the buffer to receive the converted input data |
num | is the maximum size of the string buffer |
References argument_list_error, NAME64DBLDBL::d1val, NAME64DBLDBL::d2val, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, dimension_error, illegal_format, NAME64DBLDBL::name, and DUNION::vptr.
int GetValuesAsShort | ( | DTYPE * | d, |
short * | sval, | ||
int | num | ||
) |
Retrieves incoming data as an array of short integers.
This routine will convert incoming data if possible to an array of short integers. If it is not possible to convert to an array of short integers an error is returned.
d | is a TINE DTYPE data object containing the incoming data. |
sval | is a pointer to the short integer array to receive the converted input data \num is the maximum number of array elements which the short integer array can hold |
Alias: GetValuesAsShort
Example:
int GetValuesAsString | ( | DTYPE * | d, |
char * | str, | ||
UINT32 * | strBufferSize | ||
) |
Retrieves incoming data as a string buffer.
This routine will convert incoming data if possible to a string representation.
If it is not possible to convert to a string an error is returned.
d | is a TINE DTYPE data object containing the incoming data. |
str | is a pointer to the string buffer to receive the converted input data |
strBufferSize | is the maximum size of the string buffer [input] and contains the number of characters written into the buffer on completion [output] |
Alias: getValuesAsString()
int GetValuesAsStringEx | ( | DTYPE * | d, |
char * | str, | ||
int | fmt, | ||
int | num, | ||
int | offset | ||
) |
Prepares incoming data to a string type.
This routine will convert incoming string type data into other string type data if possible. If it is not possible to convert to a string an error is returned.
d | is a TINE DTYPE data object containing the incoming data. |
str | is a pointer to the string type which is to hold the converted data. |
fmt | is the TINE format specifier for the destination string type (i.e. one of CF_TEXT, CF_NAME16, etc.) of the converted data. |
num | is the maximum size of the destination string buffer holding the converted data. |
offset | is the entry point of the destination string array (if an array is passed) |
References argument_list_error, DUNION::cptr, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, dimension_error, illegal_format, and DUNION::strptr.
int PrintToLogbook | ( | char * | proxy, |
char * | logbook, | ||
char * | header, | ||
char * | severity, | ||
char * | author, | ||
char * | message, | ||
BYTE * | imageBytes, | ||
int | imageLength, | ||
int | addStatusInformation | ||
) |
sends the given input to an electronic logbook
proxy | is the logbook proxy server which receives the input and passes it along to the given logbook |
logbook | is the desired target electronic logbook |
header | is the desired logbook header |
severity | is the desired logbook severity |
author | is the author assigned to the logbook entry |
message | is the desired logbook message (up to 2048 ascii characters) |
imageBytes | if non-NULL provides an image (as BASE64 bytes) |
imageLength | gives the number of bytes in imageBytes |
addStatusInformation | if TRUE (i.e. non zero) instructs the logbook entry to provide addition machine status information. |
int PutArchivedData | ( | char * | devsrv, |
BYTE * | data, | ||
int | dataFmt, | ||
int | num, | ||
double | dataTime, | ||
int | sysStamp, | ||
int | usrStamp | ||
) |
puts data and timestamps into the central archive system for 'SELF' entries
Supported data types for self entries include (arrays of) any numerical type and nothing else.
devsrv | must be the full device server name for the target central archiver. The context is primarily used. |
data | is a reference to the data array to be sent to the archive server. |
dataFmt | is the format of the data passed |
num | is the number of elements in the data array reference |
dataTime | is the UTC double timestamp of the data passed. |
sysStamp | is the system stamp of the data passed. |
usrStamp | is the user stamp of the data passed. |
References argument_list_error.
int PutValuesFromAny | ( | DTYPE * | d, |
void * | val, | ||
short | fmt, | ||
int | sgn, | ||
int | objectSizeInBytes, | ||
int | num, | ||
int | offset | ||
) |
Submits outgoing data from an array of the given format data type.
This routine will convert outgoing data if possible from an array of the type specified. If it is not possible to convert to an array of unsigned short integers an error is returned.
d | is a TINE DTYPE data object into which the outgoing data is to be copied. |
val | is a pointer to the source data |
fmt | is the TINE format data type of the source data. This should be one of CF_BYTE, CF_INT16, CF_INT32, CF_FLOAT, or CF_DOUBLE |
sgn | is a boolean flag specifying whether format conversion should treat the source data as signed (TRUE) or unsgined (FALSE). This flag applies only to fmt == CF_INT16 or CF_INT32. |
objectSizeInBytes | is the size in bytes of the containing object. For instance, 'val' might point to a float value embedded in a structure, so objectSizeInBytes should be the size of the structure in this case. If objectSizeInBytes is smaller than the size of 'fmt' then an error is returned. |
num | is the number of array elements contained in the source array |
offset | is the starting point in the source data array |
Example:
References DTYPE::dFormat, invalid_parameter, PutValuesFromByteEx(), PutValuesFromLongEx(), PutValuesFromShortEx(), PutValuesFromUnsignedLongEx(), and PutValuesFromUnsignedShortEx().
int PutValuesFromByteEx | ( | DTYPE * | d, |
BYTE * | bval, | ||
int | num, | ||
int | offset | ||
) |
Submits outgoing data from an array of bytes.
This routine will convert outgoing data if possible from an array of bytes. If it is not possible to convert to an array of bytes an error is returned.
d | is a TINE DTYPE data object into which the outgoing data is to be copied. |
bval | is a pointer to the byte (unsigned char) array containing the source data |
num | is the number of array elements contained in the source array |
offset | is the starting point in the source data array |
Referenced by PutValuesFromAny().
int PutValuesFromDoubleEx | ( | DTYPE * | d, |
double * | dval, | ||
int | num, | ||
int | offset | ||
) |
Submits outgoing data from an array of doubles.
This routine will convert outgoing data if possible from an array of doubles. If it is not possible to convert to an array of doubles an error is returned.
d | is a TINE DTYPE data object into which the outgoing data is to be copied. |
fval | is a pointer to the double array containing the source data |
num | is the number of array elements contained in the source array |
offset | is the starting point in the source data array |
Alias: PutValuesFromDoubleEx
Example: (see PutValuesFromFloatEx() for example)
int PutValuesFromFloatEx | ( | DTYPE * | d, |
float * | fval, | ||
int | num, | ||
int | offset | ||
) |
Submits outgoing data from an array of floats.
This routine will convert outgoing data if possible from an array of floats. If it is not possible to convert to an array of floats an error is returned.
d | is a TINE DTYPE data object into which the outgoing data is to be copied. |
fval | is a pointer to the float array containing the source data |
num | is the number of array elements contained in the source array |
offset | is the starting point in the source data array |
Alias: PutValuesFromFloatEx
Example:
int PutValuesFromLongEx | ( | DTYPE * | d, |
SINT32 * | lval, | ||
int | num, | ||
int | offset | ||
) |
Submits outgoing data from an array of long integers.
This routine will convert outgoing data if possible from an array of long integers. If it is not possible to convert to an array of long integers an error is returned.
d | is a TINE DTYPE data object into which the outgoing data is to be copied. |
lval | is a pointer to the long integer array containing the source data |
num | is the number of array elements contained in the source array |
offset | is the starting point in the source data array |
Alias: PutValuesFromInt32
Example: (see PutValuesFromFloatEx() for example)
Referenced by PutValuesFromAny().
int PutValuesFromShortEx | ( | DTYPE * | d, |
short * | sval, | ||
int | num, | ||
int | offset | ||
) |
Submits outgoing data from an array of short integers.
This routine will convert outgoing data if possible from an array of short integers. If it is not possible to convert to an array of short integers an error is returned.
d | is a TINE DTYPE data object into which the outgoing data is to be copied. |
sval | is a pointer to the short 16-bit integer array containing the source data |
num | is the number of array elements contained in the source array |
offset | is the starting point in the source data array |
Alias: PutValuesFromInt16
Example:
Referenced by PutValuesFromAny().
int PutValuesFromString | ( | DTYPE * | d, |
char * | str, | ||
int | fmt, | ||
int | num, | ||
int | offset | ||
) |
Prepares outgoing data as a string type.
This routine will convert output string type data into other string type data if possible. If it is not possible to convert to a string an error is returned.
d | is a TINE DTYPE data object to contain the outgoing data. |
str | is a pointer to the string type containing the data to be converted. |
fmt | is the TINE format specifier for the string type (i.e. one of CF_TEXT, CF_NAME16, etc.; CF_STRING is also supported here). |
num | is the number of array elements contained in the source array |
offset | is the starting point in the source data array |
Example:
References argument_list_error, DUNION::bptr, DUNION::cptr, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, dimension_error, and illegal_format.
int PutValuesFromUnsignedLongEx | ( | DTYPE * | d, |
UINT32 * | lval, | ||
int | num, | ||
int | offset | ||
) |
Submits outgoing data from an array of unsigned long (32-bit) integers.
This routine will convert outgoing data if possible from an array of unsigned long integers. If it is not possible to convert to an array of long integers an error is returned.
d | is a TINE DTYPE data object into which the outgoing data is to be copied. |
lval | is a pointer to the long integer array containing the source data |
num | is the number of array elements contained in the source array |
offset | is the starting point in the source data array |
Alias: PutValuesFromUInt32
Example: (see PutValuesFromFloatEx() for example)
Referenced by PutValuesFromAny().
int PutValuesFromUnsignedShortEx | ( | DTYPE * | d, |
UINT16 * | sval, | ||
int | num, | ||
int | offset | ||
) |
Submits outgoing data from an array of unsigned short integers.
This routine will convert outgoing data if possible from an array of unsigned short integers. If it is not possible to convert to an array of unsigned short integers an error is returned.
d | is a TINE DTYPE data object into which the outgoing data is to be copied. |
fval | is a pointer to the unsigned short integer array containing the source data |
num | is the number of array elements contained in the source array |
offset | is the starting point in the source data array |
Alias: PutValuesFromUnsignedUInt16
Example: (see PutValuesFromFloatEx() for example)
Referenced by PutValuesFromAny().
int RestorePropertyValues | ( | const char * | eqmName, |
const char * | prpName, | ||
void * | values, | ||
short | format, | ||
int | size | ||
) |
Retrieves the value settings of the property name given from disk.
Using this routine will restore the given values of the named property from the disk file named <prpName>-settings.csv.
eqmName | is the local equipment module name. |
prpName | is the name of the property whose values are to be restored |
values | is a reference to the values to be restored |
format | is the format of the values to be restored (simple format type) |
size | is the array size (not the size in bytes) of the values to be restored. |
int SavePropertyValues | ( | const char * | eqmName, |
const char * | prpName, | ||
void * | values, | ||
short | format, | ||
int | size | ||
) |
Saves value settings of the property name given onto disk.
Using this routine will back out the given values of the named property to a disk file named <prpName>-settings.csv.
eqmName | is the local equipment module name. |
prpName | is the name of the property whose values are to be stored |
values | is a reference to the values to be stored |
format | is the format of the values to be stored (simple format type) |
size | is the array size (not the size in bytes) of the values to be stored. |
int SavePropertyValuesEx | ( | const char * | eqmName, |
const char * | devName, | ||
const char * | prpName, | ||
void * | values, | ||
short | format, | ||
int | size | ||
) |
Saves value settings of the property name given onto disk (extended version).
Using this routine will back out the given values of the named property to a disk file named <prpName>-settings.csv. The extended version allows passing a device name which is then assumed relevant for locating the targeted property.
eqmName | is the local equipment module name. |
devName | is the name of the device whose property prpName is being referred to |
prpName | is the name of the property whose values are to be stored |
values | is a reference to the values to be stored |
format | is the format of the values to be stored (simple format type) |
size | is the array size (not the size in bytes) of the values to be stored. |
int SendEventTrigger | ( | char * | devname, |
char * | cmt, | ||
short | triggerLevel | ||
) |
Sends a Post-Mortem (i.e. event) Trigger to the designated Post-Mortem Server.
By making this call, a configured Post-Mortem Server can be sent a trigger initializing the collection of data for the data set specified.
devname | specifies, at a minimum, the event trigger to be acquired. If given in this manner (typically from a server process), the standard event server for the registered context of the server process is assumed. e.g. "bpm-intlk" specifies the trigger "bpm-intlk" for the standard event server for the registered context of the server issuing the event trigger. Otherwise an event-trigger appending full device name is assumed, e.g. "/PETRA/EVENTSTORE/bpm-intlk". |
cmt | is any accompanying comment text which should be associated with the post-mortem event. This is typically the reason for the event archive (which modules signalled the alarm, or tripped the interlock, etc.). |
triggerLevel | is the level at which the post-mortem event is initialized. Typically a value of "1" should be used to signify beginning at the first step. If a value of "-1" is passed, the post-mortem event will forward the trigger to all other post-mortem servers indentifying itself as the initializer. Other post-mortem servers which may or may not have missed the event can then either react or not according to some pre-coded event critiera. A value of "0" has no effect, and values greater than "1" will step the data recording sequence at a higher (usually unknown) level. |
int SendEventTriggerEx | ( | char * | dev, |
char * | cmt, | ||
int | triggerLevel, | ||
int | triggerTime, | ||
int | rangeStart, | ||
int | rangeStop, | ||
int | rangeMax, | ||
int | options | ||
) |
Sends a Post-Mortem (i.e. event) Trigger to the designated Post-Mortem Server.
By making this call, a configured Post-Mortem Server can be sent a trigger initializing the collection of data for the data set specified.
devname | specifies, at a minimum, the event trigger to be acquired. If given in this manner (typically from a server process), the standard event server for the registered context of the server process is assumed. e.g. "bpm-intlk" specifies the trigger "bpm-intlk" for the standard event server for the registered context of the server issuing the event trigger. Otherwise an event-trigger appending full device name is assumed, e.g. "/PETRA/EVENTSTORE/bpm-intlk". |
cmt | is any accompanying comment text which should be associated with the post-mortem event. This is typically the reason for the event archive (which modules signalled the alarm, or tripped the interlock, etc.). |
triggerLevel | is the level at which the post-mortem event is initialized. Typically a value of "1" should be used to signify beginning at the first step. If a value of "-1" is passed, the post-mortem event will forward the trigger to all other post-mortem servers indentifying itself as the initializer. Other post-mortem servers which may or may not have missed the event can then either react or not according to some pre-coded event critiera. A value of "0" has no effect, and values greater than "1" will step the data recording sequence at a higher (usually unknown) level. |
triggerTime | can be used to specify a specific time of trigger if desired. A value of '0' will signal the event system to obtain a trigger time from the event server. This is the generally the best policy. |
rangeStart | provides the beginning of a system-stamp (or time-stamp) range to use when obtaining data from a server's local history. A positive value signals the system to treat the input as a system stamp specification. A negative value or '0' signals the system to treat the rangeStart value as an offset to the provided 'triggerTime' as to use the input as a time stamp specification. |
rangeStop | provides the end of a system-stamp (or time-stamp) range to use when obtaining data froma a server's local history. If rangeStop is less that rangeStart, then the value given is used as an increment to apply to the given rangeStart (with a maximum cutoff at 1000). In other words, if rangeStop < rangeStart then rangeStop = rangeStart + rangeStop. |
rangeMax | provides a maximum number of sequence entries to obtain over the range provided. A negative value will negate the range specifcations entirely. A value of '0' will signal the system to use a default maximum (typically = 100). |
options | provides additional 'flags' to define trigger criteria. Currently, the only available option is EVNT_TRIGGER_USE_USERSTAMP which signals the event server to focus on the 'user' data stamp (and not the system stamp) in the range specifications. |
void SetDisplayExtraDigits | ( | int | value | ) |
prints double variables with with precision in log files
value | is the desired setting (boolean: 0 = FALSE, anything else is TRUE) |
int SetValuesAsStringSeparator | ( | char * | str | ) |
sets the separator to be used by getValuesAsString() and GetValuesArrayAsString()
str | is a pointer to the string (length of 1) to be used as separator i.e. ", " |
References invalid_parameter.
int StringToDataValue | ( | BYTE * | data, |
char * | sbuf, | ||
int | idx, | ||
short | fmt, | ||
char * | tag, | ||
int | limit | ||
) |
parses input string into the designated array element of the format type given.
the input string can be a reference to a binary file (for array data) which is simply read into the supplied data buffer. it is assumed the the data array aligment is not an issue (as the buffer passed will have been allocated to the specifications of the format type passed.
data | is the data buffer to receive the data |
sbuf | is the string containing either the data to be parsed or a pipe reference to a binary file containing a array of (primitive) data |
idx | is the index into the data parameter in which to copy the parsed or read data |
fmt | is the TINE format of the data |
tag | is a structure tag (not yet implemented) |
limit | is the array length or string limit if applicable |
used in some save-and-restore routines, etc.
int fecLogFileDepth = 500 |
Sets the depth in lines of a server's secondary log file (if utilized).
For most cases the system log file "fec.log" is sufficient for logging server activities. Furthermore, "fec.log" is retrievable via a systematic TINE call so that it can be viewed from a remote location without requiring a mount to a file system. However, for more detailing logging you may want to make use of a secondary log file whose name is given by <fecName>.log. This log file resides only on the local file system. You can fix the depth of the this log file by setting this parameter.