public frm8536Count() { // This call is required by the Windows Form Designer. InitializeComponent(); // Initiate error handling // activating error handling will trap errors like // bad channel numbers and non-configured conditions. // Parameters: // MccDaq.ErrorReporting.PrintAll :all warnings and errors encountered will be printed // MccDaq.ErrorHandling.StopAll :if an error is encountered, the program will stop MccDaq.ErrorInfo ULStat = MccDaq.MccService.ErrHandling(MccDaq.ErrorReporting.PrintAll, MccDaq.ErrorHandling.StopAll); // Create a new MccBoard object for Board 0 DaqBoard = new MccDaq.MccBoard(0); // Init the counter for desired operation // Parameters: // ChipNum :the chip to be setup // Ctr1Output :how the counter output is used short ChipNum = 1; MccDaq.CtrlOutput Ctr1Output = MccDaq.CtrlOutput.NotLinked; ULStat = DaqBoard.C8536Init(ChipNum, Ctr1Output); // Configure the counter for desired operation // Parameters: // CounterNum :which counter // OutputControl :which counter output signal is used // RecycleMode :reload at 0 ? // TrigType :trigger type CounterNum = 1; MccDaq.C8536OutputControl OutputControl = MccDaq.C8536OutputControl.ToggleOnTc; MccDaq.RecycleMode RecycleMode = MccDaq.RecycleMode.Recycle; MccDaq.C8536TriggerType TrigType = MccDaq.C8536TriggerType.HWStartTrig; ULStat = DaqBoard.C8536Config(CounterNum, OutputControl, RecycleMode, TrigType); }
private void frm8536Count_Load(object sender, EventArgs e) { InitUL(); NumCtrs = CtrProps.FindCountersOfType(DaqBoard, CounterType, out CounterNum); if (NumCtrs == 0) { lblNoteFreqIn.Text = "Board " + DaqBoard.BoardNum.ToString() + " has no 8536 counters."; cmdStart.Enabled = false; } else { // Init the counter for desired operation // Parameters: // ChipNum :the chip to be setup // Ctr1Output :how the counter output is used short ChipNum = 1; MccDaq.CtrlOutput Ctr1Output = MccDaq.CtrlOutput.NotLinked; MccDaq.ErrorInfo ULStat = DaqBoard.C8536Init(ChipNum, Ctr1Output); // Configure the counter for desired operation // Parameters: // CounterNum :which counter // OutputControl :which counter output signal is used // RecycleMode :reload at 0 ? // TrigType :trigger type CounterNum = 1; MccDaq.C8536OutputControl OutputControl = MccDaq.C8536OutputControl.ToggleOnTc; MccDaq.RecycleMode RecycleMode = MccDaq.RecycleMode.Recycle; MccDaq.C8536TriggerType TrigType = MccDaq.C8536TriggerType.HWStartTrig; ULStat = DaqBoard.C8536Config(CounterNum, OutputControl, RecycleMode, TrigType); this.lblNoteFreqIn.Text = "NOTE: There must be a TTL frequency at counter 1 input on board " + DaqBoard.BoardNum.ToString() + "."; } }