NDS client API


Classes

struct  DAQDChannel
 Channel data-base entry. More...
struct  DAQDRecHdr
 DAQD header record. More...
class  DAQSocket
 The DAQD socket class. More...

Data Access API (C++)

Access channel data through the network data server

This API provides a client interface for the "classic" NDS server. It allows the user to get channel data over the network. The syntax implemented by this interface is:
Function DAQSocket method NDS command
Get data from specified time RequestData start net-writer <start> <duration> [{"channel" ...} | all];
Get file names RequestNames start name-writer all;
Get available channel list Available status channels [2];
Get fast online data RequestOnlineData start fast-writer [{"channel" ...} | all];
Get slow online data RequestOnlineData start net-writer [{"channel" ...} | all];
Get trend data RequestTrendData start trend [60] net-writer <start> <duration> [{"channel" ...} | all];
Stop a net-writer StopWriter kill net-writer nnnnnnnn;

A typical online NDS client would do the following:

    //---------  Construct a DAQD socket 
    DAQSocket nds;

    //---------  Open a socket to the specified server port.
    const char* servername = "nds-server:port";
    nds.open(servername);
    if (!nds.TestOpen()) fail("Open failed!");

    //---------  Specify the channel to be read.
    const char* chan = "channel name";
    if (!nds.AddChannel(chan)) fail("Add channel failed!");
    if (nds.RequestOnlineData()) fail("Data Request failed");

    //---------  Specify the channel to be read.
    float* Samples = new float[data_len];
    while (1) {
        int nData = nds.GetData((char*) Samples, data_len);
	if (nData <= 0) break;
        ...  Process data ...
    }
    
Author:
John Zweizig
Version:
0.1; Last modified March 5, 2008

Generated on Thu Mar 6 12:36:01 2008 for DMT-IO by  doxygen 1.5.3