// // This example check for HvOn, load a config file and does a serie of acquisitions // void ScriptMain() { Console.WriteLine("Script begins..."); // We want a log file Sync.LogFileName = "Log"; // Test StatusParam BoardLib.SetVariable("Board.DirectParam.HvOn", true); BoardLib.SetDirectParameters(); if (BoardLib.GetBoolVariable("Board.StatusParam.HvOn")) { Dialog.ShowDialog("HvOn is on"); } else { Dialog.ShowDialog("Error, HvOn is not on"); return; } // Open a config file (path is relative to this file) BoardLib.OpenConfigFile(@"CFG\PDdiscri-A2-CH5.xml"); // Change file size limit BoardLib.SetVariable("Board.UsbParam.FileLimit", 200); // Set direct parameters BoardLib.SetDirectParameters(); // Perform a serie of acquisitions while changing a few parameters for (int gain = 50; gain <= 53; ++gain) { // Set HG gain BoardLib.SetVariable("Asics[2].Channels[5].HG_Gain", gain); for (int inputDAC = 130; inputDAC <= 140; ++inputDAC) { // Set input DAC BoardLib.SetVariable("Asics[2].Channels[5].InputDAC", inputDAC); // Configure the board BoardLib.BoardConfigure(); // Bug: we need to wait a bit Sync.Sleep(50); // Run the acquistion (it'll wait for the transfer to finish) // Note: there is an optional argument to pass specific DAQ options. // Ex: BoardLib.StartAcquisition("filename", AFE_AidaFrontEnd.DaqOptions.All) BoardLib.StartAcquisition("DAQ/Example4_G" + gain + "_in" + inputDAC); // Bug: we need to wait a bit Sync.Sleep(50); } } // We're done! Console.WriteLine("Script ended"); }