private void cmdStartBgnd_Click(System.Object eventSender, System.EventArgs eventArgs) { int CurIndex; int CurCount; short Status; MccDaq.ErrorInfo ULStat; MccDaq.ScanOptions Options; cmdStartBgnd.Enabled = false; cmdStartBgnd.Visible = false; cmdStopConvert.Enabled = true; cmdStopConvert.Visible = true; cmdQuit.Enabled = false; UserTerm = 0; // initialize user terminate flag // Parameters: // LowChan :the lower channel of the scan // HighChan :the upper channel of the scan // Count :the number of D/A values to send // Rate :per channel sampling rate ((samples per second) per channel) // DAData :array of values to send to the scanned channels // Options :data send options FirstPoint = 0; int LowChan = 0; // First analog output channel int HighChan = 1; // Last analog output channel int Rate = 1000; // Rate of data update (ignored if board does not support timed analog output) MccDaq.Range Gain = MccDaq.Range.Bip5Volts; // Ignored if gain is not programmable Options = MccDaq.ScanOptions.Background | MccDaq.ScanOptions.Continuous | MccDaq.ScanOptions.ScaleData; ULStat = DaqBoard.AOutScan(LowChan, HighChan, Count, ref Rate, Gain, MemHandle, Options); ULStat = DaqBoard.GetStatus(out Status, out CurCount, out CurIndex, MccDaq.FunctionType.AoFunction); if (Status == MccDaq.MccBoard.Running) { lblShowStat.Text = "Running"; lblShowCount.Text = CurCount.ToString("D"); lblShowIndex.Text = CurIndex.ToString("D"); } tmrCheckStatus.Enabled = true; }
public double[] ReadDyno() { //Initialize Error Handling ULStat = MccDaq.MccService.ErrHandling(MccDaq.ErrorReporting.PrintAll, MccDaq.ErrorHandling.StopAll); //Create an object for board 0 DaqBoard = new MccDaq.MccBoard(0); //Set the range Range = MccDaq.Range.Bip10Volts; //Put in initial values in ForceVal ForceVal[0] = 0; ForceVal[1] = 0; ForceVal[2] = 0; ForceVal[3] = 0; ForceVal[4] = 0; //read in data from DaqBoard DaqBoard.AIn(0, Range, out DatVal[0]); DaqBoard.AIn(1, Range, out DatVal[1]); DaqBoard.AIn(2, Range, out DatVal[2]); DaqBoard.AIn(3, Range, out DatVal[3]); //Convert data to voltage DaqBoard.ToEngUnits(Range, DatVal[0], out VoltVal[0]); DaqBoard.ToEngUnits(Range, DatVal[1], out VoltVal[1]); DaqBoard.ToEngUnits(Range, DatVal[2], out VoltVal[2]); DaqBoard.ToEngUnits(Range, DatVal[3], out VoltVal[3]); //New Sheet ForceVal[0] = 487.33 * (double)VoltVal[0]; ForceVal[1] = 479.85 * (double)VoltVal[1]; ForceVal[2] = 2032.52 * (double)VoltVal[2]; ForceVal[3] = 18.91 * (double)VoltVal[3]; return(ForceVal); }
public void setRange(MccDaq.Range _range) { range = _range; }
public DAQBoardInterface(int boardNumber, int channel) { board = new MccDaq.MccBoard(boardNumber); range = MccDaq.Range.Bip10Volts; chan = channel; }