CS
CapsClientApi.h File Reference

Go to the source code of this file.

Macros

#define DLLEXPORT
#define STDCALL
#define C_EXTERN   extern

Functions

C_EXTERN unsigned long
DLLEXPORT STDCALL 
CapsClientConnect (const char *host, double rate)
C_EXTERN unsigned long
DLLEXPORT STDCALL 
CapsClientOpen (const char *name)
C_EXTERN void DLLEXPORT STDCALL CapsClientClose (unsigned long handle)
C_EXTERN int DLLEXPORT STDCALL CapsClientNumStages (unsigned long handle)
C_EXTERN int DLLEXPORT STDCALL CapsClientNumStageBlades (unsigned long handle, int stage)
C_EXTERN int DLLEXPORT STDCALL CapsClientNumStageProbes (unsigned long handle, int stage)
C_EXTERN double DLLEXPORT STDCALL CapsClientStageDiameter (unsigned long handle, int stage)
C_EXTERN void DLLEXPORT STDCALL CapsClientStageProbeLocations (unsigned long handle, int stage, int nangles, double angles[])
C_EXTERN void DLLEXPORT STDCALL CapsClientStageName (unsigned long handle, int stage, char name[], int maxsize)
C_EXTERN void DLLEXPORT STDCALL CapsClientProbeName (unsigned long handle, int stage, int probe, char name[], int maxsize)
C_EXTERN unsigned long
DLLEXPORT STDCALL 
CapsClientGetNextRev (unsigned long handle, double wait, int *error)
C_EXTERN unsigned long
DLLEXPORT STDCALL 
CapsClientRevNumber (unsigned long rhandle)
C_EXTERN int DLLEXPORT STDCALL CapsClientRevSpeed (unsigned long rhandle, double *speed)
C_EXTERN double DLLEXPORT STDCALL CapsClientRevRmsClearance (unsigned long rhandle, int stage, int probe)
C_EXTERN void DLLEXPORT STDCALL CapsClientRevDnsClearance (unsigned long rhandle, int stage, int probe, int ndata, double data[])
C_EXTERN void DLLEXPORT STDCALL CapsClientRevDeflection (unsigned long rhandle, int stage, int probe, int ndata, double data[])
C_EXTERN int DLLEXPORT STDCALL CapsClientRevScopeData (unsigned long rhandle, int stage, int probe, float data[4096])
C_EXTERN int DLLEXPORT STDCALL CapsClientRevProbeStatus (unsigned long rhandle, int stage, int probe, int *osc, int *gain, int *ac, int *filter, int *status, int *range)

Detailed Description

Network client API functions for retrieving data from a running CapaciSense acquisition server in user written applications. The API also supports opening CapaciSense data files and streaming data from them using the same calls. The functions in this file are distributed as a DLL that can be linked with a variety of languages such as C, C++, LabView, Matlab, Visual Basic, etc.


Macro Definition Documentation

#define C_EXTERN   extern

C++ linkage

#define DLLEXPORT

WIN32 DLL interface stuff

#define STDCALL

WIN32 DLL interface stuff


Function Documentation

C_EXTERN void DLLEXPORT STDCALL CapsClientClose ( unsigned long  handle)

Destroys the connection to the CapaciSense acquisition system.

Parameters:
handleThe handle value as returned by CapsClientConnect() or CapsClientOpen().
C_EXTERN unsigned long DLLEXPORT STDCALL CapsClientConnect ( const char *  host,
double  rate 
)

Establishes a connection to a running CapaciSense acquisition system. Once the connection is established the client starts receiving data continuously in the background. The received data is used to update a "current value" table. User code can retrieve the current values at its own pace. If the client retrieves data at a slower rate than it is received then the receivbed revolutions will be averaged between data retrieval calls.

Parameters:
hostThe name of the computer to which to connect. This should be any server host of a running CapaciSense configuration.
rateThe update rate in seconds with which the servers will send data packets to the client.
Returns:
A "handle" that should be passed to subsequent calls. The handle value is non zero upon successful connection, zero otherwise.
C_EXTERN unsigned long DLLEXPORT STDCALL CapsClientGetNextRev ( unsigned long  handle,
double  wait,
int *  error 
)

Retrieves the last received full revolution's data from the DLL's receive buffer and locks it into the "current value" buffer for later "disassembly" with the rev data processing DLL entries (below). If the handle was created by opening files, then a set of data blocks is read and stored for further processing. If no data is available the function will return immediately with a zero return value. In this case the error argument should be examined. If error is zero, then there is simply no new data available since the last call. If error is non-zero then some kind of error occurred (most likely the Capacisense acquisition system stopped). File mode never returns an error condition, if the handle is zero that means that the end of the file (or all opened files) has been reached.

Parameters:
handleThe handle value as returned by CapsClientConnect() or CapsClientOpen().
waitIf positive the call will block for the given time (in seconds) or until new data is available. If zero the call returns immediately. If negative the call waits until new data is available (or an error occurs). This parameter is ignored in file replay mode.
errorSet when the no data condition is caused by some kind of error.
Returns:
A handle to the buffered data. Use this for subsequenct data retrieval calls. 0 is returned when no data is available. This handle is valid until the next CapsClientGetNextRev or CapsClientClose call.
C_EXTERN int DLLEXPORT STDCALL CapsClientNumStageBlades ( unsigned long  handle,
int  stage 
)

Setup retrieval function.

Parameters:
handleThe handle value as returned by CapsClientConnect() or CapsClientOpen().
stageThe stage index. Must be in the range of [0 ... return value of CapsClientNumStages() - 1]
Returns:
The blade count on the indexed stage of the configuration.
C_EXTERN int DLLEXPORT STDCALL CapsClientNumStageProbes ( unsigned long  handle,
int  stage 
)

Setup retrieval function.

Parameters:
handleThe handle value as returned by CapsClientConnect() or CapsClientOpen().
stageThe stage index. Must be in the range of [0 ... return value of CapsClientNumStages() - 1]
Returns:
The number of probes on the indexed stage of the configuration.
C_EXTERN int DLLEXPORT STDCALL CapsClientNumStages ( unsigned long  handle)

Setup retrieval function.

Parameters:
handleThe handle value as returned by CapsClientConnect() or CapsClientOpen().
Returns:
The number of engine stages in the configuration.
C_EXTERN unsigned long DLLEXPORT STDCALL CapsClientOpen ( const char *  name)

Opens one or more Capacisense data files. If multiple files are opened they will be played in proper acqusition time order.

Parameters:
nameThe name of the file to open. Wildcards are accepted, in this case all files matching the pattern are opened. A directory name is also accepted, in this case the latest file and all matching configuration previous files in the given directory are opened.
Returns:
A "handle" that should be passed to subsequent calls. The handle value is non zero upon successful connection, zero otherwise.
C_EXTERN void DLLEXPORT STDCALL CapsClientProbeName ( unsigned long  handle,
int  stage,
int  probe,
char  name[],
int  maxsize 
)

Setup retrieval function. Retrieves the name of a probe

Parameters:
handleThe handle value as returned by CapsClientConnect() or CapsClientOpen().
stageThe stage index. Must be in the range of [0 ... return value of CapsClientNumStages() - 1]
probeThe index of the probe for which the name is to be retrieved. Must be in the range of [0 ... return value of CapsClientNumStageProbes() - 1]
nameThe character buffer into which the name will be copied. (Zero terminated "C" string.)
maxsizeThe maximum length of the character buffer for the name.
C_EXTERN void DLLEXPORT STDCALL CapsClientRevDeflection ( unsigned long  rhandle,
int  stage,
int  probe,
int  ndata,
double  data[] 
)

Retrieve information from the current locked revolutions's data. This function copies the deflection (distance between the blade tip's measured and nominal radial locations) values of all blades on an engine stage into a vector.

Parameters:
rhandleThe handle to the currently processed revolution's data as returned by CapsClientGetNextRev().
stageThe stage index. Must be in the range of [0 ... return value of CapsClientNumStages() - 1]
probeThe index of the probe for which the data is to be retrieved. Must be in the range of [0 ... return value of CapsClientNumStageProbes() - 1]
ndataThe size of the ndata array. Should be big enough to accommodate all the blades reported by CapsClientNumStageBlades() for this stage. If a smaller array is passed only the first ndata values are copied.
dataArray into which each blade's data is copied.
C_EXTERN void DLLEXPORT STDCALL CapsClientRevDnsClearance ( unsigned long  rhandle,
int  stage,
int  probe,
int  ndata,
double  data[] 
)

Retrieve information from the current locked revolutions's data. This function copies the DNS clearance values of all blades on an engine stage into a vector.

Parameters:
rhandleThe handle to the currently processed revolution's data as returned by CapsClientGetNextRev().
stageThe stage index. Must be in the range of [0 ... return value of CapsClientNumStages() - 1]
probeThe index of the probe for which the data is to be retrieved. Must be in the range of [0 ... return value of CapsClientNumStageProbes() - 1]
ndataThe size of the ndata array. Should be big enough to accommodate all the blades reported by CapsClientNumStageBlades() for this stage. If a smaller array is passed only the first ndata values are copied.
dataArray into which each blade's data is copied.
C_EXTERN unsigned long DLLEXPORT STDCALL CapsClientRevNumber ( unsigned long  rhandle)

Retrieve information from the current locked revolutions's data.

Parameters:
rhandleThe handle to the currently processed revolution's data as returned by CapsClientGetNextRev().
Returns:
The current revolution number. Revolutions are numbered from the start of the acquistion.
C_EXTERN int DLLEXPORT STDCALL CapsClientRevProbeStatus ( unsigned long  rhandle,
int  stage,
int  probe,
int *  osc,
int *  gain,
int *  ac,
int *  filter,
int *  status,
int *  range 
)

Retrieve information from the current locked revolutions's data.

Parameters:
rhandleThe handle to the currently processed revolution's data as returned by CapsClientGetNextRev().
stageThe stage index. Must be in the range of [0 ... return value of CapsClientNumStages() - 1]
probeThe index of the probe for which the data is to be retrieved. Must be in the range of [0 ... return value of CapsClientNumStageProbes() - 1]
oscReceives current oscillator power status value upon return
gainReceives current demodulator gain status value upon return
acReceives current demodulator coupling value upon return
filterReceives current demodulator filter setting upon return
statusReceives current PLL status value upon return
rangeReceives current A/D range setting (in millivolts) upon return
Returns:
A flag indicating the current calibration status of the probe, i.e. whether clearance data is valid or not.
C_EXTERN double DLLEXPORT STDCALL CapsClientRevRmsClearance ( unsigned long  rhandle,
int  stage,
int  probe 
)

Retrieve information from the current locked revolutions's data. This function copies the RMS clearance values of all blades on an engine stage into a vector.

Parameters:
rhandleThe handle to the currently processed revolution's data as returned by CapsClientGetNextRev().
stageThe stage index. Must be in the range of [0 ... return value of CapsClientNumStages() - 1]
probeThe index of the probe for which the data is to be retrieved. Must be in the range of [0 ... return value of CapsClientNumStageProbes() - 1]
Returns:
The averege RMS clearance for the entire revolution measured by the probe.
C_EXTERN int DLLEXPORT STDCALL CapsClientRevScopeData ( unsigned long  rhandle,
int  stage,
int  probe,
float  data[4096] 
)

Retrieve information from the current locked revolutions's data. This function copies the BPS waveform into a user supplied buffer.

Parameters:
rhandleThe handle to the currently processed revolution's data as returned by CapsClientGetNextRev().
stageThe stage index. Must be in the range of [0 ... return value of CapsClientNumStages() - 1]
probeThe index of the probe for which the data is to be retrieved. Must be in the range of [0 ... return value of CapsClientNumStageProbes() - 1]
dataarray into which the probe's time domain data is copied (scaled to volts). One revolution is always resampled to 4096 points.
Returns:
A flag indicating whether scope data was available or not. Note that scope data may ve received less frequently than clearance data so even though CapsClientGetNextRev() may lock a revolution's data, the scope record may not be available for this revolution.
C_EXTERN int DLLEXPORT STDCALL CapsClientRevSpeed ( unsigned long  rhandle,
double *  speed 
)

Retrieve information from the current locked revolutions's data.

Parameters:
rhandleThe handle to the currently processed revolution's data as returned by CapsClientGetNextRev().
speedReceives the current engine speed (in RPM units) upon return.
Returns:
A flag indicating whether the system is acquiring data synchronized with engine revolutions (locked) or not.
C_EXTERN double DLLEXPORT STDCALL CapsClientStageDiameter ( unsigned long  handle,
int  stage 
)

Setup retrieval function.

Parameters:
handleThe handle value as returned by CapsClientConnect() or CapsClientOpen().
stageThe stage index. Must be in the range of [0 ... return value of CapsClientNumStages() - 1]
Returns:
The diameter of the indexed stage of the configuration.
C_EXTERN void DLLEXPORT STDCALL CapsClientStageName ( unsigned long  handle,
int  stage,
char  name[],
int  maxsize 
)

Setup retrieval function. Retrieves the name of a stage

Parameters:
handleThe handle value as returned by CapsClientConnect() or CapsClientOpen().
stageThe stage index. Must be in the range of [0 ... return value of CapsClientNumStages() - 1]
nameThe character buffer into which the name will be copied. (Zero terminated "C" string.)
maxsizeThe maximum length of the character buffer for the name.
C_EXTERN void DLLEXPORT STDCALL CapsClientStageProbeLocations ( unsigned long  handle,
int  stage,
int  nangles,
double  angles[] 
)

Setup retrieval function. Copies the radial locations of all probes on an engine stage into a vector.

Parameters:
handleThe handle value as returned by CapsClientConnect() or CapsClientOpen().
stageThe stage index. Must be in the range of [0 ... return value of CapsClientNumStages() - 1]
nanglesThe size of the angles array. Should be big enough to accommodate all the probes reported by CapsClientNumStageProbes() for this stage. If a smaller array is passed only the first nangles values are copied.
anglesArray into which each probe's radial location is copied.