ExamplePollDoubleDataΒΆ

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
// ExamplePollDoubleData is similar to ExamplePollDemodSample,
// but it subscribes and polls floating point data.
public static void ExamplePollDoubleData(string dev = DEFAULT_DEVICE)
{
  ziDotNET daq = connect(dev);
  String path = String.Format("/{0}/oscs/0/freq", dev);
  daq.getAsEvent(path);
  daq.subscribe(path);
  Lookup lookup = daq.poll(1, 100, 0, 1);
  Dictionary<String, Chunk[]> nodes = lookup.nodes;  // Iterable nodes
  Chunk[] chunks = lookup[path];  // Iterable chunks
  Chunk chunk = lookup[path][0];  // Single chunk
  ZIDoubleData[] doubleData = lookup[path][0].doubleData;  // Vector of samples
  ZIDoubleData doubleData0 = lookup[path][0].doubleData[0];  // Single sample
  daq.disconnect();

  AssertNotEqual(0ul, doubleData0.timeStamp);
}