Classes | |
| struct | DAQDChannel |
| Channel data-base entry. More... | |
| struct | DAQDRecHdr |
| DAQD header record. More... | |
| class | DAQSocket |
| The DAQD socket class. More... | |
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 ...
}
1.5.3