//declare all modes enum DAQModes { NONE=0, BEAM_DAQ, COSMIC_DAQ, BEAM_COSMIC_DAQ, FULL_DAQ_2S, WAGASCI_60US_AND_6X5MS }; void ScriptMain() { Console.WriteLine("Script begins..."); // change the COM port name here var l_port = App.MCBOpenPort("COM10"); // chosen DAQ mode DAQModes l_DAQmode = DAQModes.BEAM_COSMIC_DAQ; // will configure the MCB Console.WriteLine("MCB configure with DAQ mode = " + l_DAQmode.ToString()); App.MCBConfigure(l_port, (int)l_DAQmode); var l_nb = App.MCBGetSpillNb(l_port); if(l_nb < 0 ) Console.WriteLine("Error during MCB get spill nb."); else Console.WriteLine("Spill number = " + l_nb.ToString()); Dialog.ShowDialog("Press OK to start the readout with a GReset of counters"); App.MCBReadout(l_port, true, true); Dialog.ShowDialog("Press OK to stop the readout"); App.MCBReadout(l_port, false, false); l_port.Close(); // We're done! Console.WriteLine("Script ended"); }