nScopeAPI  v0.8
Functions
nScopeAPI_requests.h File Reference

contains function headers for making requests to nScope More...

Functions

NSCOPE_API ErrorType nScope_request_data (ScopeHandle nScope, Request *newRequest_p, int numSamples, bool antiAliased)
 Request data from nScope. More...
 
NSCOPE_API ErrorType nScope_request_data_stream (ScopeHandle nScope, Request *newRequest_p)
 Request an infinite stream of data from nScope. More...
 
NSCOPE_API ErrorType nScope_stop_request (ScopeHandle nScope, Request reqHandle)
 stop a request that is in progress More...
 
NSCOPE_API ErrorType nScope_release_request (ScopeHandle nScope, Request *reqHandle_p)
 release a request that is finished or stopped More...
 
NSCOPE_API ErrorType nScope_wait_for_request_finish (ScopeHandle nScope, Request reqHandle)
 wait for a request to finish More...
 
NSCOPE_API ErrorType nScope_request_xfer_has_completed (ScopeHandle nScope, Request reqHandle, bool *hasCompleted)
 determine if a request has completed the transfer More...
 
NSCOPE_API ErrorType nScope_request_xfer_samples_remaining (ScopeHandle nScope, Request reqHandle)
 query the number of samples remaining in the request transfer More...
 
NSCOPE_API ErrorType nScope_stop_data_stream (ScopeHandle nScope, Request reqHandle)
 Stop an infinite stream of data from nScope. More...
 
NSCOPE_API ErrorType nScope_read_data (ScopeHandle nScope, Request reqHandle, int channel, double *data)
 Read data from the request. More...
 
NSCOPE_API ErrorType nScope_request_has_data (ScopeHandle nScope, Request reqHandle, bool *hasData)
 determine if a request has unread data still stored in it More...
 

Documentation

contains function headers for making requests to nScope

Function Documentation

NSCOPE_API ErrorType nScope_read_data ( ScopeHandle  nScope,
Request  reqHandle,
int  channel,
double *  data 
)

Read data from the request.

reads data from a specific channel on a request, and stores the result in data

Returns
ErrorType
Parameters
[in]nScopeScopeHandle object
[in]reqHandleRequest object to query
[in]channelchannel to read
[out]datapointer to double to store the read value on the request
NSCOPE_API ErrorType nScope_release_request ( ScopeHandle  nScope,
Request reqHandle_p 
)

release a request that is finished or stopped

Frees the memory for the request.

To prevent memory leaks, the developer must call this function after the request has finished an all data has been read.

On success, the Request handle will be a null pointer

Returns
ErrorType
Parameters
[in]nScopeScopeHandle object
[out]reqHandle_ppointer to Request object to release
NSCOPE_API ErrorType nScope_request_data ( ScopeHandle  nScope,
Request newRequest_p,
int  numSamples,
bool  antiAliased 
)

Request data from nScope.

Creates a request for data from nScope. Anti-aliasing algorithm is used for nScope GUI, not recommended for data acquisition

Returns
ErrorType
Parameters
[in]nScopeScopeHandle object
[out]newRequest_ppointer to a Request object to store the request handle
[in]numSamplesnumber of data samples (per channel) to request
[in]antiAliasedtrue: turn on anti-aliasing, false: turn it off.
NSCOPE_API ErrorType nScope_request_data_stream ( ScopeHandle  nScope,
Request newRequest_p 
)

Request an infinite stream of data from nScope.

Warning
not yet implemented
NSCOPE_API ErrorType nScope_request_has_data ( ScopeHandle  nScope,
Request  reqHandle,
bool *  hasData 
)

determine if a request has unread data still stored in it

Queries a request to see if there is still data to be read, stores the result in hasData

Returns
ErrorType
Parameters
[in]nScopeScopeHandle object
[in]reqHandleRequest object to query
[out]hasDatapointer to bool to store the result of the query
NSCOPE_API ErrorType nScope_request_xfer_has_completed ( ScopeHandle  nScope,
Request  reqHandle,
bool *  hasCompleted 
)

determine if a request has completed the transfer

Queries a request to see if the data has finished transferring, stores the result in hasCompleted

Returns
ErrorType
Parameters
[in]nScopeScopeHandle object
[in]reqHandleRequest object to query
[out]hasCompletedpointer to bool to store the result of the query
NSCOPE_API ErrorType nScope_request_xfer_samples_remaining ( ScopeHandle  nScope,
Request  reqHandle 
)

query the number of samples remaining in the request transfer

Warning
not yet implemented
NSCOPE_API ErrorType nScope_stop_data_stream ( ScopeHandle  nScope,
Request  reqHandle 
)

Stop an infinite stream of data from nScope.

Warning
not yet implemented
NSCOPE_API ErrorType nScope_stop_request ( ScopeHandle  nScope,
Request  reqHandle 
)

stop a request that is in progress

interrupts a current request from completing

Returns
ErrorType
Parameters
[in]nScopeScopeHandle object
[in]reqHandleRequest object to stop
NSCOPE_API ErrorType nScope_wait_for_request_finish ( ScopeHandle  nScope,
Request  reqHandle 
)

wait for a request to finish

Blocks program execution until a request has finished transferring data from nScope

Returns
ErrorType
Parameters
[in]nScopeScopeHandle object
[in]reqHandleRequest object on which to wait