// // This example shows how to access different config variables // Note: variable names are case insensitive // // System.Console is directly available from the script // https://msdn.microsoft.com/en-us/library/system.console.aspx // void ScriptMain() { // Output initial value of SpillCntReset Console.WriteLine("SpillCntReset = " + BoardLib.GetBoolVariable("Board.DirectParam.SpillCntReset")); // Set HvOn BoardLib.SetVariable("Board.DirectParam.HvOn", true); // Send the parameters to the board BoardLib.SetDirectParameters(); // Read back HvOn and output its value Console.WriteLine("HvOn = " + BoardLib.GetBoolVariable("Board.StatusParam.HvOn")); // Also output the packet size var ps = BoardLib.GetUInt16Variable("Board.UsbParam.PacketSize"); Console.WriteLine("PacketSize = " + ps); // Set a bunch of values BoardLib.SetVariable("Board.DirectParam.SpillCntReset", true); BoardLib.SetVariable("Board.DataReadoutParam.GlobalTrigEn", true); // There are 2 valid syntaxic form to access an array: // 1) either use the bracket notation BoardLib.SetVariable("Asics[0].GlobalControl.Dac10b", 2); BoardLib.SetVariable("Asics[0].Channels[5].InputDAC", 3); // 2) or use the actual name of the array BoardLib.SetVariable("Asics.ASIC1.Channels.Channel5.InputDac_En", false); BoardLib.SetVariable("Asics.ASIC0.PowerModes.FastShaperEn", true); // More examples BoardLib.SetVariable("Fpga.GlobalControl.IntGenPeriod", 123); BoardLib.SetVariable("Fpga.GlobalControl.L1ThresholdMode", "Dynamic"); BoardLib.SetVariable("Fpga.ASIC0.GlobalControl.TempEN", false); BoardLib.SetVariable("Fpga[0].Channels[5].HitEN", false); }