static void Main(string[] args) { UInt32 nInstance = 0; int inPort = 51002; int outPort = 51001; int bufsize = 8 * 1024 * 1024; string inIP = "127.0.0.1"; string outIP = ""; bool useDouble = false; // bool use_double = false; CereLinkConnection conn = new CereLinkConnection(nInstance, inPort, outPort, bufsize, inIP, outIP, useDouble); if (conn.IsOnline()) { for (int fetch_ix = 0; fetch_ix < 5; fetch_ix++) { conn.SetComment("TestCSharp fetch", 255, 0, 0, 0); conn.FetchData(out Int16[][] result); Console.WriteLine("Returned {0} chans.", result.Length); for (int chan_ix = 0; chan_ix < result.Length; chan_ix++) { Console.WriteLine("Chan {0} has {1} samples: [{2} ... {3}]", chan_ix, result[chan_ix].Length, result[chan_ix][0], result[chan_ix][result[chan_ix].Length - 1]); } System.Threading.Thread.Sleep(11); } } else { Console.WriteLine("Not online."); } }
// Use this for initialization void Start() { conn = new CereLinkConnection(nInstance, inPort, outPort, bufsize, inIP, outIP, useDouble); }