Main Page | Features | Central Services | csv-Files | Types | Transfer | Access | API-C | API-.NET | API-Java | Examples | Downloads
page generated on 18.05.2024 - 04:45
Functions | Variables
Useful API Calls File Reference

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...
 

Detailed Description

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.

Function Documentation

◆ AcquireAndRegisterStruct()

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.

Parameters
devNameis the targeted device server where the structure is registered.
tagis the structure tag
numis 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.
Returns
a tine return code.
See also
SealTaggedStruct(), AddFieldToStruct()

◆ AppendHistoryLog()

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.

Parameters
stris a 'printf'-like variable argument list string containing the text to be appended
Returns
none
See also
fecLogFileDepth

◆ AssertRangeValid()

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.

Parameters
eqmNameis the local equipment module name.
prpNameis the name of the property whose values are to be restored
dinis a reference to input data to be checked against the registered range settings.
enforceLimitswill insert the corresponding maximum or minimum value into the din object reference should any range exception be detected.
Returns
TRUE if no range violation is detected.

References DUNION::bptr, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, DUNION::dptr, DUNION::fptr, GetRegisteredPropertyListStruct(), DUNION::lptr, DUNION::sptr, DUNION::ulptr, and DUNION::usptr.

◆ DataValueToString()

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.

Parameters
sbufis the string buffer to hold the converted string
datais a pointer to the data (value or array) which is to be converted to a string
idxis the starting array index if data points to an array
fmtis the TINE format code describing the data
tagis the data tag if the given data represents a tagged format (e.g. CF_STRUCT)
limitis the maximum array length, i.e. buffer length of the data passed.
Returns
the pointer passed as 'sbuf' if successful, else NULL

◆ FreeArchivedDataReadbackBuffer()

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.

See also
GetArchivedDataAsAny()

◆ GetArchivedData()

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.

Parameters
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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
Note
It is in general best to use the keyword-appended full device name in this call. For instance, if the horizontal orbit has been archived as keyword "ORBIT.X", a call to get the orbit position for a BPM with device name "MONITOR3" could be made by specifying "ORBIT.X" as the keyword and "3" as the keyindex and assume that this keyword is available at a central archive server named "HISTORY". Otherwise, if the name of the relevant archive server is known (either "HISTORY" or something else), then the call can be made by specifying "/<context>/<archive server>/MONITOR3/ORBIT.X" as the keyword and "0" as the keyindex. The latter although longer is a much more general way to obtain archive data via this call.
The data in this call are returned as an array of FLTINT objects, containing a data-point
  • timestamp pair.
If you desire the an entire trace or spectrum of data at a particular timestamp, you should make a call to GetArchivedTraceDataAsFloat() in which case an array of floats is returned at the first timestamp encountered while scanning from start to stop.
See also
GetArchivedDataAsText(), GetArchivedDataAsFloat(), GetArchivedTraceDataAsFloat()

References buffer_too_small, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, ExecLinkEx(), DUNION::ulptr, and DUNION::vptr.

◆ GetArchivedDataAsAny()

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.

Parameters
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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().

Example:

#include "tine.h";
...
int myGetHistoryAsAnyExample(void)
{
time_t stop = time(NULL);
time_t start = stop - 84600; // last 24 hours
HstHdr dataHdr[100]; // buffers 100 deep
DBLDBL data[100];
int cc, i, num = 100;
char *tgt = "/TEST/WinSineServer/#0[DDTest]"; // full target device name
cc = GetArchivedDataAsAny(tgt,start,stop,dataHdr,data,CF_DBLDBL,NULL,&num);
if (cc == 0)
{
printf("call returned %d stored values\n",num);
for (i=0; i<num; i++)
{
printf("data: %10.3f %10.3f @ %s [sys stamp %d, user stamp %d]\n",
data[i].d1val,data[i].d2val,
GetDataTimeString(dataHdr[i].timeStamp,FALSE),
dataHdr[i].sysStamp,dataHdr[i].usrStamp);
}
}
return cc;
}

generates the following output:

call returned 100 stored values
data: 348578685.447 -451421314.553 @ 25.09.12 15:11:25.697 CDT [sys stamp 5434181, user stamp 0]
data: 348578691.525 -451421308.475 @ 25.09.12 15:11:31.697 CDT [sys stamp 5434193, user stamp 0]
data: 348578697.932 -451421302.068 @ 25.09.12 15:11:37.932 CDT [sys stamp 5434205, user stamp 0]
data: 348578703.932 -451421296.068 @ 25.09.12 15:11:43.932 CDT [sys stamp 5434217, user stamp 0]
data: 348578709.932 -451421290.068 @ 25.09.12 15:11:50.167 CDT [sys stamp 5434229, user stamp 0]
data: 348578715.948 -451421284.052 @ 25.09.12 15:11:56.167 CDT [sys stamp 5434241, user stamp 0]
data: 348578722.105 -451421277.895 @ 25.09.12 15:12:02.167 CDT [sys stamp 5434253, user stamp 0]
data: 348578727.933 -451421272.067 @ 25.09.12 15:12:08.152 CDT [sys stamp 5434264, user stamp 0]
data: 348578733.933 -451421266.067 @ 25.09.12 15:12:14.152 CDT [sys stamp 5434276, user stamp 0]
data: 348578739.980 -451421260.020 @ 25.09.12 15:12:20.152 CDT [sys stamp 5434288, user stamp 0]
data: 348578746.121 -451421253.879 @ 25.09.12 15:12:26.387 CDT [sys stamp 5434300, user stamp 0]
data: 348578752.309 -451421247.691 @ 25.09.12 15:12:32.387 CDT [sys stamp 5434312, user stamp 0]
data: 348578757.950 -451421242.050 @ 25.09.12 15:12:38.372 CDT [sys stamp 5434323, user stamp 0]
data: 348578763.997 -451421236.003 @ 25.09.12 15:12:44.372 CDT [sys stamp 5434335, user stamp 0]
data: 348578770.106 -451421229.894 @ 25.09.12 15:12:50.372 CDT [sys stamp 5434347, user stamp 0]
.... etc. ....
See also
GetArchivedDataAsFloat(), GetArchivedData(), GetArchivedDataAsText(), GetArchivedDataAsAnyEx()

References GetArchivedDataAsAnyEx().

◆ 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.

Parameters
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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().

Example:

#include "tine.h";
...
int myGetHistoryAsAnyExample(void)
{
time_t stop = time(NULL);
time_t start = stop - 84600; // last 24 hours
HstHdr dataHdr[100]; // buffers 100 deep
DBLDBL data[100];
int cc, i, num = 100;
char *tgt = "/TEST/WinSineServer/#0[DDTest]"; // full target device name
cc = GetArchivedDataAsAny(tgt,start,stop,dataHdr,data,CF_DBLDBL,NULL,&num);
if (cc == 0)
{
printf("call returned %d stored values\n",num);
for (i=0; i<num; i++)
{
printf("data: %10.3f %10.3f @ %s [sys stamp %d, user stamp %d]\n",
data[i].d1val,data[i].d2val,
GetDataTimeString(dataHdr[i].timeStamp,FALSE),
dataHdr[i].sysStamp,dataHdr[i].usrStamp);
}
}
return cc;
}

generates the following output:

call returned 100 stored values
data: 348578685.447 -451421314.553 @ 25.09.12 15:11:25.697 CDT [sys stamp 5434181, user stamp 0]
data: 348578691.525 -451421308.475 @ 25.09.12 15:11:31.697 CDT [sys stamp 5434193, user stamp 0]
data: 348578697.932 -451421302.068 @ 25.09.12 15:11:37.932 CDT [sys stamp 5434205, user stamp 0]
data: 348578703.932 -451421296.068 @ 25.09.12 15:11:43.932 CDT [sys stamp 5434217, user stamp 0]
data: 348578709.932 -451421290.068 @ 25.09.12 15:11:50.167 CDT [sys stamp 5434229, user stamp 0]
data: 348578715.948 -451421284.052 @ 25.09.12 15:11:56.167 CDT [sys stamp 5434241, user stamp 0]
data: 348578722.105 -451421277.895 @ 25.09.12 15:12:02.167 CDT [sys stamp 5434253, user stamp 0]
data: 348578727.933 -451421272.067 @ 25.09.12 15:12:08.152 CDT [sys stamp 5434264, user stamp 0]
data: 348578733.933 -451421266.067 @ 25.09.12 15:12:14.152 CDT [sys stamp 5434276, user stamp 0]
data: 348578739.980 -451421260.020 @ 25.09.12 15:12:20.152 CDT [sys stamp 5434288, user stamp 0]
data: 348578746.121 -451421253.879 @ 25.09.12 15:12:26.387 CDT [sys stamp 5434300, user stamp 0]
data: 348578752.309 -451421247.691 @ 25.09.12 15:12:32.387 CDT [sys stamp 5434312, user stamp 0]
data: 348578757.950 -451421242.050 @ 25.09.12 15:12:38.372 CDT [sys stamp 5434323, user stamp 0]
data: 348578763.997 -451421236.003 @ 25.09.12 15:12:44.372 CDT [sys stamp 5434335, user stamp 0]
data: 348578770.106 -451421229.894 @ 25.09.12 15:12:50.372 CDT [sys stamp 5434347, user stamp 0]
.... etc. ....
See also
GetArchivedDataAsFloat(), GetArchivedData(), GetArchivedDataAsText(), GetArchivedDataAsAnyEx()

References argument_list_error, buffer_too_small, DTYPE::dArrayLength, and DTYPE::dFormat.

Referenced by GetArchivedDataAsAny().

◆ GetArchivedDataAsFloat()

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'.

Parameters
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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
Note
You must use the keyword-appended full device name in this call. For instance, if the horizontal orbit has been archived as keyword "ORBIT.X", a call to get the orbit position for a BPM with device name "MONITOR3" is to be made by specifying "/<context>/<archive server>/MONITOR3/ORBIT.X" as the keyword.
The data in this call are returned as an array of FLTINT objects, containing a data-point
  • timestamp pair.
If you desire the an entire trace or spectrum of data at a particular timestamp, you should make a call to GetArchivedTraceDataAsFloat() in which case an array of floats is returned at the first timestamp encountered while scanning from start to stop.
See also
GetArchivedDataAsText(), GetArchivedData(), GetArchivedTraceDataAsFloat()

References buffer_too_small, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, ExecLinkEx(), DUNION::ulptr, and DUNION::vptr.

◆ GetArchivedDataAsSnapshot()

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.

Parameters
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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetArchivedDataAsText(), GetArchivedDataAsFloat(), GetArchivedTraceDataAsFloat()

References argument_list_error, buffer_too_small, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, ExecLinkEx(), DUNION::ulptr, and DUNION::vptr.

◆ GetArchivedDataAsText()

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.

Parameters
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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
Note
This calls uses only the keyword-appended full device name in this call. If the name of the relevant archive server is known (either "HISTORY" or something else), then the call can be made by specifying "/<context>/<archive server>/MONITOR3/ORBIT.X" as the keyword. The archived data will be converted to a text string and entered into the "NAME32" part of the array of NAME32I doublets returned. This call must be used in order to retrieve data stored as strings, such as machine states, etc.
See also
GetArchivedData(), GetArchivedDataAsFloat(), GetArchivedTraceDataAsFloat()

References buffer_too_small, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, ExecLinkEx(), DUNION::ulptr, and DUNION::vptr.

◆ GetArchivedTraceDataAsFloat()

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.

Parameters
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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
Note
You must use the keyword-appended full device name in this call. For instance, if the horizontal orbit has been archived as keyword "ORBIT.X", a call to get the entire orbit at a given timestamp is to be made by specifying "/<context>/<archive server>/#0/ORBIT.X" as the keyword.
The archiver will start searching for a record beginning with the start time specified. It will stop scanning and return the record found as soon as it encounters a timestamp equal to or greater than than the start time and not exceeding the stop time.
See also
GetArchivedDataAsText(), GetArchivedData(), GetArchivedDataAsFloat()

References buffer_too_small, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, ExecLinkEx(), DUNION::ulptr, and DUNION::vptr.

◆ GetDeviceContexts()

int GetDeviceContexts ( NAME16 clist,
int *  num 
)

Retrieves a list of server contexts via query to the Equipment Name Server.

Deprecated:

This call retrieves a list of all server context managed by the Equipment Name Server

Parameters
clistis a pointer to a NAME16 buffer to receive the name list.
numis 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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetSystemContexts()

◆ GetDeviceContextsFromFile()

int GetDeviceContextsFromFile ( NAME16 clist,
int *  num 
)

Retrieves a list of server contexts via query to the local static database.

Deprecated:

This call retrieves a list of all server context managed by the local static database.

Parameters
clistis a pointer to a NAME16 buffer to receive the name list.
numis 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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetSystemContexts()

References argument_list_error, no_such_column, and no_such_file.

◆ GetDeviceNames()

int GetDeviceNames ( char *  srv,
NAME16 dlist,
int *  num 
)

Retrieves a list of device names via query to the server given.

Deprecated:

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.

Parameters
srvis the full device server name for which the property query is to be made
dlistis a pointer to a NAME16 buffer to receive the name list.
numis 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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetDeviceNamesEx()

References GetDeviceNamesEx().

◆ 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.

Deprecated:

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.

Parameters
srvis the full device server name for which the property query is to be made
prpis the property for which the device list is desired.
dlistis a pointer to a NAME16 buffer to receive the name list.
numis 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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetSystemDevices()

Referenced by GetDeviceNames().

◆ GetDeviceProperties()

int GetDeviceProperties ( char *  srv,
NAME32 plist,
int *  num 
)

Retrieves a list of properties via query to the server given.

Deprecated:

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.

Parameters
srvis the full device server name for which the property query is to be made
plistis a pointer to a NAME32 buffer to receive the name list.
numis 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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetDevicePropertyInformation(), GetTargetPropertyInformation(), GetDevicePropertyEGU()
Note
This call is deprecated. Please use GetSystemProperties() instead.

References buffer_too_small, DUNION::cptr, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, and ExecLinkEx().

◆ GetDevicePropertyEGU()

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.

Parameters
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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
Note
It is always assumed thar regardless of property format overloading, the maximum and minimum values as well as the engineering units remain the same.
See also
GetDevicePropertyInformation(), GetDeviceProperties(), GetTargetPropertyInformation()

References DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, ExecLinkEx(), DUSTRING::f1val, DUSTRING::f2val, DUSTRING::str, and DUNION::vptr.

◆ GetDevicePropertyInformation()

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.

Parameters
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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetTargetPropertyInformation(), GetDeviceProperties(), GetDevicePropertyInformationX()

References buffer_too_small, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, DTYPE::dTag, ExecLinkEx(), and DUNION::vptr.

◆ GetDeviceServers()

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().

Parameters
dslistis a pointer to a NAME16 buffer to receive the name list.
numis 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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetDeviceServersEx()

◆ GetDeviceServersEx()

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.

Parameters
contextis the context for which the query is to be made
dslistis a pointer to a NAME16 buffer to receive the name list.
numis 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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetDeviceServers()
Note
This call is deprecated. Please use GetSystemServers() instead.

◆ GetDeviceServersFromFile()

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.

Parameters
contextis the context for which the query is to be made
dslistis a pointer to a NAME16 buffer to receive the name list.
numis 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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetDeviceServers()

References argument_list_error, and no_such_file.

◆ GetMyServerAddress()

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.

Parameters
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.
Returns
0 if successful, otherwise a TINE completion code

◆ GetServers()

int GetServers ( NAME16 slist,
int *  num 
)

Retrieves a list of servers via query to the Equipment Name Server.

Deprecated:

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().

Parameters
slistis a pointer to a NAME16 buffer to receive the name list.
numis 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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetSystemServers()

◆ GetServersEx()

int GetServersEx ( char *  context,
NAME16 slist,
int *  num 
)

Retrieves a list of FECs via query to the Equipment Name Server.

Deprecated:

This call retrieves a list of all Front End Computer Names (FECs) associated with the server context given.

Parameters
contextis the context for which the query is to be made
slistis a pointer to a NAME16 buffer to receive the name list.
numis 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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetSystemServers()

◆ GetStockProperties()

int GetStockProperties ( NAME64 plist,
int *  num 
)

Retrieves a list of available stock properties.

Parameters
plistis a pointer to a NAME64 buffer to receive the name list.
numis 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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().

References argument_list_error, and buffer_too_small.

◆ GetStructureAsString()

int GetStructureAsString ( char *  tag,
void *  structref,
char *  strbuf,
int  buflen 
)

Prepares a string representation of the contents of the tagged structure provided.

Parameters
tagis 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'.
structrefis a pointer to the structure to be parsed into a string.
strbufis the buffer to receive the string representation.
buflenis the length of the string buffer provided. If this buffer is not large enough to hold the string representation, the structure parsing will stop.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().

References argument_list_error, DUNION::bptr, buffer_too_small, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, DTYPE::dTag, not_registered, and out_of_local_memory.

◆ GetSystemContexts()

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

Parameters
clistis a pointer to a NAME32 buffer to receive the name list.
numis 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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().

◆ GetSystemDevices()

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.

Parameters
srvis the full device server name for which the property query is to be made
prpis the property for which the device list is desired.
dlistis a pointer to a NAME64 buffer to receive the name list.
numis 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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().

◆ GetSystemFecs()

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.

Parameters
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.
slistis a pointer to a NAME16 buffer to receive the FEC name list.
numis 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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().

◆ GetSystemProperties()

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.

Parameters
srvis the full device server name for which the property query is to be made
plistis a pointer to a NAME64 buffer to receive the name list.
numis 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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetDevicePropertyInformation(), GetTargetPropertyInformation(), GetDevicePropertyEGU()

References GetSystemPropertiesEx().

◆ 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.

Parameters
srvis the full device server name for which the property query is to be made
plistis a pointer to a NAME64 buffer to receive the name list.
numis 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.
flagsgives specific query instructions, i.e. a combination of PRP_REGISTERED (default), PRP_STOCK, PRP_META
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetDevicePropertyInformation(), GetTargetPropertyInformation(), GetDevicePropertyEGU()

References argument_list_error, buffer_too_small, DUNION::cptr, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, and ExecLinkEx().

Referenced by GetSystemProperties().

◆ GetSystemPropertyInformation()

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.

Parameters
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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetTargetPropertyInformation(), GetDeviceProperties(), GetDevicePropertyInformation()

References DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, ExecLinkEx(), invalid_parameter, out_of_local_memory, and DUNION::vptr.

Referenced by GetTargetPropertyInformation().

◆ GetSystemServers()

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.

Parameters
contextis 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").
dslistis a pointer to a NAME32 buffer to receive the name list.
numis 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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetSystemContexts()

◆ GetTargetPropertyInformation()

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.

Parameters
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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
Note
In cases where property behavior has been overloaded, this call will only retrieve the properties "default" behavior, i.e. the information pertaining to the last registered property.
See also
GetDevicePropertyInformation(), GetDeviceProperties(), GetDevicePropertyEGU()

References GetSystemPropertyInformation().

◆ GetValuesAsAny()

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

Parameters
dis a TINE DTYPE data object from which the incoming data is to be used.
valis a pointer to the destination data
fmtis 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)
objectSizeInBytesis 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.
numis the number of array elements contained in the destination array
offsetis the starting point in the destination data array
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
PutValuesFromAny()

◆ GetValuesAsByte()

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.

Parameters
dis a TINE DTYPE data object containing the incoming data.
bvalis 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
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetValuesAsShort(), GetValuesAsLong(), GetValuesAsFloat(), GetValuesAsDouble()

◆ GetValuesAsDBLDBL()

int GetValuesAsDBLDBL ( DTYPE d,
DBLDBL ddval,
int  num 
)

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.

Parameters
dis a TINE DTYPE data object containing the incoming data.
ddvais a pointer to the buffer to receive the converted input data
numis the maximum size of the string buffer
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetValuesAsShort(), GetValuesAsLong(), GetValuesAsFloat(), GetValuesAsDouble()

References argument_list_error, DBLDBL::d1val, DBLDBL::d2val, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, dimension_error, illegal_format, and DUNION::vptr.

◆ GetValuesAsDouble()

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.

Parameters
dis a TINE DTYPE data object containing the incoming data.
dvalis a pointer to the double array to receive the converted input data
numis the maximum number of array elements which the double array can hold
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetValuesAsShort(), GetValuesAsLong(), GetValuesAsFloat()

Alias: GetValuesAsDouble()

Example: (see GetValuesAsShort() for example)

◆ GetValuesAsFloat()

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.

Parameters
dis a TINE DTYPE data object containing the incoming data.
fvalis a pointer to the float array to receive the converted input data
numis the maximum number of array elements which the float array can hold
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetValuesAsShort(), GetValuesAsLong(), GetValuesAsDouble()

Alias: GetValuesAsFloat()

Example: (see GetValuesAsShort() for example)

◆ GetValuesAsLong()

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.

Parameters
dis a TINE DTYPE data object containing the incoming data.
lvalis a pointer to the long 32-bit integer array to receive the converted input data
numis the maximum number of array elements which the long integer array can hold
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetValuesAsShort(), GetValuesAsFloat(), GetValuesAsDouble()

Example: (see getValuesAsShort() for example)

◆ GetValuesAsNAME64DBL()

int GetValuesAsNAME64DBL ( DTYPE d,
NAME64DBL ndval,
int  num 
)

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.

Parameters
dis a TINE DTYPE data object containing the incoming data.
ddvais a pointer to the buffer to receive the converted input data
numis the maximum size of the string buffer
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetValuesAsShort(), GetValuesAsLong(), GetValuesAsFloat(), GetValuesAsDouble()

References argument_list_error, DUNION::cptr, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, dimension_error, NAME64DBL::dval, illegal_format, and DUNION::vptr.

◆ GetValuesAsNAME64DBLDBL()

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.

Parameters
dis a TINE DTYPE data object containing the incoming data.
ddvais a pointer to the buffer to receive the converted input data
numis the maximum size of the string buffer
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetValuesAsShort(), GetValuesAsLong(), GetValuesAsFloat(), GetValuesAsDouble()

References argument_list_error, NAME64DBLDBL::d1val, NAME64DBLDBL::d2val, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, dimension_error, illegal_format, NAME64DBLDBL::name, and DUNION::vptr.

◆ GetValuesAsShort()

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.

Parameters
dis a TINE DTYPE data object containing the incoming data.
svalis 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
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetValuesAsLong(), GetValuesAsFloat(), GetValuesAsDouble()

Alias: GetValuesAsShort

Example:

#include "toolkit.h"
#include "bpmeqm.h"
...
int bpmeqm(char *devName,char *devProperty,DTYPE *dout, DTYPE *din,short access)
{
int devnr,prpid,i,cc;
short l_online;
devnr = GetDeviceNumber(BPMEQM_TAG,devName);
if (devnr < 0) return illegal_equipment_number;
prpid = GetPropertyId(BPMEQM_TAG,devProperty);
switch (prpid)
{
case PRP_ONLINE:
if (access&CA_WRITE)
{
if (din->dArrayLength == PRP_ONLINE_SIZE)
{
/* get the set value sent to us : */
if ((cc=getValuesAsShort(din,&l_online,1)) != 0) return cc;
/* do range checking : */
if (l_online < PRP_ONLINE_LOW || l_online > PRP_ONLINE_HIGH) return out_of_range;
/* apply the setting to the targetted BPM :*/
bpm[devnr].online = l_online;
}
else
{
}
}
if (dout->dArrayLength > 0)
{
if (dout->dArrayLength > PRP_ONLINE_SIZE) return dimension_error;
if ((cc=putValuesFromShort(dout,&bpm[devnr].online,1)) != 0) return cc;
}
return 0;
case PRP_STATUS:
...

◆ GetValuesAsString()

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.

Parameters
dis a TINE DTYPE data object containing the incoming data.
stris a pointer to the string buffer to receive the converted input data
strBufferSizeis the maximum size of the string buffer [input] and contains the number of characters written into the buffer on completion [output]
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
Note
this routine is suitable for 'dumping' the data as a string output. The elements of a string array will be separated by a carriage-return line-feed. For data conversion, it is perhaps more advisable to use GetValuesAsStringEx() (the counter part to PutValuesFromString()).
See also
GetValuesAsStringEx()

Alias: getValuesAsString()

◆ GetValuesAsStringEx()

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.

Parameters
dis a TINE DTYPE data object containing the incoming data.
stris a pointer to the string type which is to hold the converted data.
fmtis the TINE format specifier for the destination string type (i.e. one of CF_TEXT, CF_NAME16, etc.) of the converted data.
numis the maximum size of the destination string buffer holding the converted data.
offsetis the entry point of the destination string array (if an array is passed)
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetValuesAsShort(), GetValuesAsLong(), GetValuesAsFloat(), GetValuesAsDouble()

References argument_list_error, DUNION::cptr, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, dimension_error, illegal_format, and DUNION::strptr.

◆ PrintToLogbook()

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

Parameters
proxyis the logbook proxy server which receives the input and passes it along to the given logbook
logbookis the desired target electronic logbook
headeris the desired logbook header
severityis the desired logbook severity
authoris the author assigned to the logbook entry
messageis the desired logbook message (up to 2048 ascii characters)
imageBytesif non-NULL provides an image (as BASE64 bytes)
imageLengthgives the number of bytes in imageBytes
addStatusInformationif TRUE (i.e. non zero) instructs the logbook entry to provide addition machine status information.
Returns
0 upon success or a TINE error code

◆ PutArchivedData()

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.

Parameters
devsrvmust be the full device server name for the target central archiver. The context is primarily used.
datais a reference to the data array to be sent to the archive server.
dataFmtis the format of the data passed
numis the number of elements in the data array reference
dataTimeis the UTC double timestamp of the data passed.
sysStampis the system stamp of the data passed.
usrStampis the user stamp of the data passed.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().

References argument_list_error, DUNION::bptr, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, ExecLinkEx(), illegal_context, illegal_format, invalid_parameter, and out_of_local_memory.

◆ PutValuesFromAny()

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.

Parameters
dis a TINE DTYPE data object into which the outgoing data is to be copied.
valis a pointer to the source data
fmtis 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
sgnis 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.
objectSizeInBytesis 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.
numis the number of array elements contained in the source array
offsetis the starting point in the source data array
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetValuesAsAny()

Example:

typedef struct
{
NAME16 units;
double spm;
double spr;
double tgtPosition;
double position;
double positionMaximum;
double positionMinimum;
double positionOffset;
double positionScale;
double limits[3];
double acceleration;
double velocity;
double current;
UINT32 msps;
UINT32 tgtMicroPosition;
UINT32 rotationmoveallowed;
UINT32 stepcounter;
UINT32 microstepcounter;
short status;
short online;
MonitorScan monScan;
} Motor;
Motor mstTbl[NUM_MSTEQM_DEVICES];
// equipment module dispatch routine
int msteqm(char *devName,char *devProperty,DTYPE *dout, DTYPE *din,short access)
{
// declarations omitted ...
switch (prpId)
{
// ...
case PRP_ACCELERATION:
if (isGroupedCall) return illegal_device;
if (access&CA_WRITE)
{
if (din->dArrayLength > 0)
{
if (din->dArrayLength > 1) return dimension_error;
if ((cc=GetValuesAsDouble(din,&dval,1)) != 0) return cc;
if (dval > mstTbl[devnr].limits[ACC_UPR_IDX]) return out_of_range;
if (dval < 0) return out_of_range;
cc = setMotorAcceleration(devnr,dval);
if (cc == 0) mstTbl[devnr].acceleration = dval; else return cc;
}
}
if (dout->dArrayLength > 0)
{
if (dout->dArrayLength > (UINT32)gNumMotors) return dimension_error;
// information kept in structure array :
if ((cc=PutValuesFromAny(dout,&mstTbl[0].acceleration,CF_DOUBLE,TRUE,sizeof(Motor),gNumMotors,devnr)) != 0) return cc;
}
return 0;
// ...
}

References DTYPE::dFormat, invalid_parameter, PutValuesFromByteEx(), PutValuesFromDoubleEx(), PutValuesFromFloatEx(), PutValuesFromLongEx(), PutValuesFromShortEx(), PutValuesFromUnsignedLongEx(), and PutValuesFromUnsignedShortEx().

◆ PutValuesFromByteEx()

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.

Parameters
dis a TINE DTYPE data object into which the outgoing data is to be copied.
bvalis a pointer to the byte (unsigned char) array containing the source data
numis the number of array elements contained in the source array
offsetis the starting point in the source data array
Note
This is the extended version of PutValuesFromByte(), the difference being that PutValuesFromByteEx() takes a pointer to the entire source array, will begin copying at the offset given, and will wrap the source array if necessary. This feature allows a caller to receive an entire array of data (an orbit for instance) but have the initial element begin at a location of his choosing.
The macro PutValuesFromByte is a call to PutValuesFromByteEx() with offset 0
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
PutValuesFromUnsignedShortEx(), PutValuesFromLongEx(), PutValuesFromFloatEx(), PutValuesFromDoubleEx()

Referenced by PutValuesFromAny().

◆ PutValuesFromDoubleEx()

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.

Parameters
dis a TINE DTYPE data object into which the outgoing data is to be copied.
fvalis a pointer to the double array containing the source data
numis the number of array elements contained in the source array
offsetis the starting point in the source data array
Note
This is the extended version of PutValuesFromDouble(), the difference being that PutValuesFromDoubleEx() takes a pointer to the entire source array, will begin copying at the offset given, and will wrap the source array if necessary. This feature allows a caller to receive an entire array of data (an orbit for instance) but have the initial element begin at a location of his choosing.
The macro PutValuesFromDouble is a call to PutValuesFromDoubleEx() with offset 0
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
PutValuesFromShortEx(), PutValuesFromLongEx(), PutValuesFromFloatEx()

Alias: PutValuesFromDoubleEx

Example: (see PutValuesFromFloatEx() for example)

Referenced by PutValuesFromAny().

◆ PutValuesFromFloatEx()

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.

Parameters
dis a TINE DTYPE data object into which the outgoing data is to be copied.
fvalis a pointer to the float array containing the source data
numis the number of array elements contained in the source array
offsetis the starting point in the source data array
Note
This is the extended version of PutValuesFromFloat(), the difference being that PutValuesFromFloatEx() takes a pointer to the entire source array, will begin copying at the offset given, and will wrap the source array if necessary. This feature allows a caller to receive an entire array of data (an orbit for instance) but have the initial element begin at a location of his choosing.
The macro PutValuesFromFloat is a call to PutValuesFromFloatEx() with offset 0
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
PutValuesFromUnsignedShortEx(), PutValues(), PutValuesFromLongEx(), PutValuesFromDoubleEx()

Alias: PutValuesFromFloatEx

Example:

#include "toolkit.h"
#include "bpmeqm.h"
int bpmeqm(char *devName,char *devProperty,DTYPE *dout, DTYPE *din,short access)
{
int devnr,prpid,i,cc;
short l_online;
devnr = GetDeviceNumber(BPMEQM_TAG,devName);
if (devnr < 0) return illegal_equipment_number;
prpid = GetPropertyId(BPMEQM_TAG,devProperty);
switch (prpid)
{
case PRP_ONLINE:
...
return 0;
case PRP_STATUS:
...
return 0;
case PRP_ORBIT_Y:
if (access&CA_WRITE) return illegal_read_write;
if (dout->dArrayLength > 0)
{
if (dout->dArrayLength > PRP_ORBIT_Y_SIZE) return dimension_error;
/* return the portion of the vertical orbit requested : */
if ((cc=putValuesFromFloatEx(dout,g_orbit_yBuffer,PRP_ORBIT_Y_SIZE,devnr)) != 0) return cc;
}
return 0;
case PRP_ORBIT_X:
...

Referenced by PutValuesFromAny().

◆ PutValuesFromLongEx()

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.

Parameters
dis a TINE DTYPE data object into which the outgoing data is to be copied.
lvalis a pointer to the long integer array containing the source data
numis the number of array elements contained in the source array
offsetis the starting point in the source data array
Note
This is the extended version of PutValuesFromLong(), the difference being that PutValuesFromLongEx() takes a pointer to the entire source array, will begin copying at the offset given, and will wrap the source array if necessary. This feature allows a caller to receive an entire array of data (an orbit for instance) but have the initial element begin at a location of his choosing.
The macro PutValuesFromLong is a call to PutValuesFromLongEx() with offset 0
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
PutValuesFromUnsignedLongEx(), PutValuesFromShortEx(), PutValuesFromFloatEx(), PutValuesFromDoubleEx()

Alias: PutValuesFromInt32

Example: (see PutValuesFromFloatEx() for example)

Referenced by PutValuesFromAny().

◆ PutValuesFromShortEx()

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.

Parameters
dis a TINE DTYPE data object into which the outgoing data is to be copied.
svalis a pointer to the short 16-bit integer array containing the source data
numis the number of array elements contained in the source array
offsetis the starting point in the source data array
Note
This is the extended version of PutValuesFromShort(), the difference being that PutValuesFromShortEx() takes a pointer to the entire source array, will begin copying at the offset given, and will wrap the source array if necessary. This feature allows a caller to receive an entire array of data (an orbit for instance) but have the initial element begin at a location of his choosing.
The macro PutValuesFromShort is a call to PutValuesFromShortEx() with offset 0
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
PutValuesFromUnsignedShortEx(), PutValuesFromLongEx(), PutValuesFromFloatEx(), PutValuesFromDoubleEx()

Alias: PutValuesFromInt16

Example:

#include "toolkit.h"
#include "bpmeqm.h"
int bpmeqm(char *devName,char *devProperty,DTYPE *dout, DTYPE *din,short access)
{
int devnr,prpid,i,cc;
short l_online;
devnr = GetDeviceNumber(BPMEQM_TAG,devName);
if (devnr < 0) return illegal_equipment_number;
prpid = GetPropertyId(BPMEQM_TAG,devProperty);
switch (prpid)
{
case PRP_ONLINE:
...
return 0;
case PRP_STATUS:
if (access&CA_WRITE) return illegal_read_write;
if (dout->dArrayLength > 0)
{
if (dout->dArrayLength > PRP_STATUS_SIZE) return dimension_error;
/* return the portion of the global status array buffer requested : */
if ((cc=putValuesFromShortEx(dout,g_statusBuffer,PRP_STATUS_SIZE,devnr)) != 0) return cc;
}
return 0;
case PRP_ORBIT_Y:
...

Referenced by PutValuesFromAny().

◆ PutValuesFromString()

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.

Parameters
dis a TINE DTYPE data object to contain the outgoing data.
stris a pointer to the string type containing the data to be converted.
fmtis the TINE format specifier for the string type (i.e. one of CF_TEXT, CF_NAME16, etc.; CF_STRING is also supported here).
numis the number of array elements contained in the source array
offsetis the starting point in the source data array
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
PutValuesAsShort(), PutValuesAsLong(), PutValuesAsFloat(), PutValuesAsDouble()

Example:

// equipment module dispatch routine
int myeqm(char *devName,char *devProperty,DTYPE *dout, DTYPE *din,short access)
{
char str[256];
static int scount = 0;
// other declarations omitted ...
switch (prpId)
{
// ...
case PRP_TESTSTRING:
if (dout->dArrayLength > 0)
{
if (dout->dFormat != CF_TEXT) return illegal_format;
sprintf(str,"call %d",scount++);
PutValuesFromString(dout,str,CF_TEXT,256,0);
}
return 0;
// ...
}
}

References argument_list_error, DUNION::bptr, DUNION::cptr, DTYPE::dArrayLength, DTYPE::data, DTYPE::dFormat, dimension_error, and illegal_format.

◆ PutValuesFromUnsignedLongEx()

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.

Parameters
dis a TINE DTYPE data object into which the outgoing data is to be copied.
lvalis a pointer to the long integer array containing the source data
numis the number of array elements contained in the source array
offsetis the starting point in the source data array
Note
This is the extended version of PutValuesFromUnsignedLong(), the difference being that PutValuesFromUnsignedLongEx() takes a pointer to the entire source array, will begin copying at the offset given, and will wrap the source array if necessary. This feature allows a caller to receive an entire array of data (an orbit for instance) but have the initial element begin at a location of his choosing.
The macro PutValuesFromLong is a call to PutValuesFromLongEx() with offset 0
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
PutValuesFromUnsignedLongEx(), PutValuesFromShortEx(), PutValuesFromFloatEx(), PutValuesFromDoubleEx()

Alias: PutValuesFromUInt32

Example: (see PutValuesFromFloatEx() for example)

Referenced by PutValuesFromAny().

◆ PutValuesFromUnsignedShortEx()

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.

Parameters
dis a TINE DTYPE data object into which the outgoing data is to be copied.
fvalis a pointer to the unsigned short integer array containing the source data
numis the number of array elements contained in the source array
offsetis the starting point in the source data array
Note
This is the extended version of PutValuesFromUnsignedShort(), the difference being that PutValuesFromUnsignedShortEx() takes a pointer to the entire source array, will begin copying at the offset given, and will wrap the source array if necessary. This feature allows a caller to receive an entire array of data (an orbit for instance) but have the initial element begin at a location of his choosing.
The macro PutValuesFromUnsignedShort is a call to PutValuesFromUnsignedShortEx() with offset 0
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
PutValuesFromShortEx(), PutValuesFromFloatEx(), PutValuesFromDoubleEx()

Alias: PutValuesFromUnsignedUInt16

Example: (see PutValuesFromFloatEx() for example)

Referenced by PutValuesFromAny().

◆ RestorePropertyValues()

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.

Parameters
eqmNameis the local equipment module name.
prpNameis the name of the property whose values are to be restored
valuesis a reference to the values to be restored
formatis the format of the values to be restored (simple format type)
sizeis the array size (not the size in bytes) of the values to be restored.
Returns
0 if successful, otherwise a TINE completion code

◆ SavePropertyValues()

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.

Parameters
eqmNameis the local equipment module name.
prpNameis the name of the property whose values are to be stored
valuesis a reference to the values to be stored
formatis the format of the values to be stored (simple format type)
sizeis the array size (not the size in bytes) of the values to be stored.
Returns
0 if successful, otherwise a TINE completion code

◆ SavePropertyValuesEx()

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.

Parameters
eqmNameis the local equipment module name.
devNameis the name of the device whose property prpName is being referred to
prpNameis the name of the property whose values are to be stored
valuesis a reference to the values to be stored
formatis the format of the values to be stored (simple format type)
sizeis the array size (not the size in bytes) of the values to be stored.
Returns
0 if successful, otherwise a TINE completion code

◆ SendEventTrigger()

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.

Parameters
devnamespecifies, 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".
cmtis 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.).
triggerLevelis 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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
GetDeviceServersEx(), SendEventTriggerEx()

◆ SendEventTriggerEx()

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.

Parameters
devnamespecifies, 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".
cmtis 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.).
triggerLevelis 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.
triggerTimecan 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.
rangeStartprovides 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.
rangeStopprovides 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.
rangeMaxprovides 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).
optionsprovides 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.
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().
See also
SendEventTrigger()
SendEventTriggerEx(char *dev,char *cmt,int triggerLevel,int triggerTime,int rangeStart,int rangeStop,int rangeMax, int options)
char cmt[256];
// prepare a comment string describing the trigger ...
...
// send trigger 'bpmintlk' to event server for MY context
cc = SendEventTriggerEx("bpmintlk",cmt,1,0,0,0,-1,0);
// the above is equivalent to the simple call
cc = SendEventTrigger("bpmintlk",cmt,1);
...
// send trigger '/PETRA/EVENTSTORE/rfcavity1' i.e. context is specified in the trigger
cc = SendEventTriggerEx("/PETRA/EVENTSTORE/rfcavity1",cmt,1,0,0,0,-1,0);
...
// send trigger '/PETRA/EVENTSTORE/pscintlk' i.e. context is specified in the trigger
// use 'now' as the time of trigger and search from now minus 5 seconds to now + 5 secs and
// look for system stamp = '123456789', and others incrementing by '1' each step for up to '1000' steps.
cc = SendEventTriggerEx("/PETRA/EVENTSTORE/pscintlk",cmt,1,0,123456789,1,1000,0);
...
// send trigger '/PETRA/EVENTSTORE/pscintlk' i.e. context is specified in the trigger
// use '1411483977' as the time of trigger and search from 141148392 to 141148402 and
// look for system stamp = '123456789', and others incrementing by '1' each step for up to '1000' steps.
cc = SendEventTriggerEx("/PETRA/EVENTSTORE/pscintlk",cmt,1,1411483977,123456789,1,1000,0);
...
// send trigger '/PETRA/EVENTSTORE/pscintlk' i.e. context is specified in the trigger
// use '1411483977' as the time of trigger
// look for UTC time stamp = '141148397' minus '60', and others incrementing by '1' each step for up to '100' steps.
cc = SendEventTriggerEx("/PETRA/EVENTSTORE/pscintlk",cmt,1,1411483977,-60,1,100,0);
...
// send trigger '/PETRA/EVENTSTORE/pscintlk' i.e. context is specified in the trigger
// use '1411483977' as the time of trigger and search from 141148392 to 141148402 and
// look for user stamp = '12345', and others incrementing by '1' each step for up to '1000' steps.
cc = SendEventTriggerEx("/PETRA/EVENTSTORE/pscintlk",cmt,1,1411483977,12345,1,1000,EVNT_TRIGGER_USE_USERSTAMP);
...
if (cc != 0) printf("SendEventTriggerEx to %s failed: %.32s\n",dev,cc2str(cc));

◆ SetDisplayExtraDigits()

void SetDisplayExtraDigits ( int  value)

prints double variables with with precision in log files

Parameters
valueis the desired setting (boolean: 0 = FALSE, anything else is TRUE)

◆ SetValuesAsStringSeparator()

int SetValuesAsStringSeparator ( char *  str)

sets the separator to be used by getValuesAsString() and GetValuesArrayAsString()

Parameters
stris a pointer to the string (length of 1) to be used as separator i.e. ", "
Returns
0 if successful, otherwise a TINE completion code which can be interpreted by a call to GetLastLinkError().

References invalid_parameter.

◆ StringToDataValue()

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.

Parameters
datais the data buffer to receive the data
sbufis the string containing either the data to be parsed or a pipe reference to a binary file containing a array of (primitive) data
idxis the index into the data parameter in which to copy the parsed or read data
fmtis the TINE format of the data
tagis a structure tag (not yet implemented)
limitis the array length or string limit if applicable

used in some save-and-restore routines, etc.

Note
string contained in sbuf is 'trimmed' prior to call
Returns
0 upon success, otherwise a TINE error code

Variable Documentation

◆ fecLogFileDepth

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.

See also
AppendHistoryLog()
GetDeviceNumber
int GetDeviceNumber(char *eqm, char *devname)
Gives the registered device number for the specified device name.
Definition: srvdbase.c:7753
illegal_read_write
@ illegal_read_write
Definition: errors.h:161
NAME16
Defines a TINE 16-character fixed-length string data object.
Definition: tinetype.h:242
GetDataTimeString
char * GetDataTimeString(double ts, int useLongStringFormat)
Returns the TINE data timestamp as a human-readable string.
Definition: syslib.c:5764
illegal_property
@ illegal_property
Definition: errors.h:118
PutValuesFromString
int PutValuesFromString(DTYPE *d, char *str, int fmt, int num, int offset)
Prepares outgoing data as a string type.
Definition: Useful API Calls:3870
SendEventTriggerEx
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.
Definition: Useful API Calls:4440
DTYPE::dFormat
short dFormat
Definition: tinetype.h:999
illegal_format
@ illegal_format
Definition: errors.h:78
DTYPE
Defines a TINE data object.
Definition: tinetype.h:996
illegal_device
@ illegal_device
Definition: errors.h:117
out_of_range
@ out_of_range
Definition: errors.h:119
illegal_equipment_number
@ illegal_equipment_number
Definition: errors.h:115
dimension_error
@ dimension_error
Definition: errors.h:102
SendEventTrigger
int SendEventTrigger(char *dev, char *cmt, short triggerLevel)
Sends a Post-Mortem (i.e. event) Trigger to the designated Post-Mortem Server.
Definition: Useful API Calls:4450
GetPropertyId
int GetPropertyId(char *eqm, char *prpName)
Gives the associated property identifier for the given property name.
Definition: srvdbase.c:7785
GetValuesAsDouble
int GetValuesAsDouble(DTYPE *d, double *dval, int num)
Retrieves incoming data as an array of doubles.
Definition: Useful API Calls:3549
GetArchivedDataAsAny
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.
Definition: Useful API Calls:1256
PutValuesFromAny
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.
Definition: Useful API Calls:4020
DBLDBL
Defines a TINE pairwise data object containing a pairwise double doublet.
Definition: tinetype.h:389
DTYPE::dArrayLength
UINT32 dArrayLength
Definition: tinetype.h:998

Impressum   |   Imprint   |   Datenschutzerklaerung   |   Data Privacy Policy   |   Declaration of Accessibility   |   Erklaerung zur Barrierefreiheit
Generated for TINE API by  doxygen 1.5.8