// // This example does an acquisition and then converts the output file into a CSV file // void ScriptMain() { byte id = Dialog.ShowInputDialog("Enter board id"); BoardLib.SetBoardId(id); // Open a config file (path is relative to this file) BoardLib.OpenConfigFile("CFG/PDdiscri-A2-CH5"); // Configure the board BoardLib.BoardConfigure(); // SYNCHRONOUS DAQ // Run the acquistion (it'll wait for the transfer to finish) string now = string.Join("-", DateTime.Now.ToString().Split(Path.GetInvalidFileNameChars())).Replace(' ', '_'); string daqFilename = "DAQ/Example5_" + now; Console.WriteLine("Starting synchronous acquisition in file " + daqFilename); BoardLib.StartAcquisition(daqFilename); // Convert to CSV Console.WriteLine("Converting to CSV..."); App.DaqToCsv(daqFilename); // ASYNCHRONOUS DAQ now = string.Join("-", DateTime.Now.ToString().Split(Path.GetInvalidFileNameChars())).Replace(' ', '_'); daqFilename = "DAQ/Example5_" + now; Console.WriteLine("Starting asynchronous acquisition in file " + daqFilename); BoardLib.StartAcquisition(daqFilename, true); const int _SLEEP_TIME = 50; //ms while (BoardLib.IsTransferingData) { Sync.Sleep(_SLEEP_TIME); } // We're done! Console.WriteLine("Script ended"); }