private void UpdateButton_Click(object sender, System.EventArgs e) { bool IsValidNumber = true; float EngUnits = 0.0f; IsValidNumber = float.TryParse(txtVoltsToSet.Text, out EngUnits); if (IsValidNumber) { // Parameters: // Chan :the D/A output channel // Range :ignored if board does not have programmable rage // DataValue :the value to send to Chan ushort DataValue = 0; float OutVal; MccDaq.ErrorInfo ULStat = DaqBoard.FromEngUnits(Range, EngUnits, out DataValue); ULStat = DaqBoard.AOut(Chan, Range, DataValue); lblValueSent.Text = "The count sent to DAC channel " + Chan.ToString("0") + " was:"; lblVoltage.Text = "The voltage at DAC channel " + Chan.ToString("0") + " is:"; lblShowValue.Text = DataValue.ToString("0"); OutVal = ConvertToVolts(DataValue); lblShowVoltage.Text = OutVal.ToString("0.0#####") + " Volts"; } }
internal StructProperty ToStructProperty() { PropertyCollection props = new PropertyCollection(); props.Add(new FloatProperty(InVal, "InVal")); props.Add(OutVal.ToStructProperty("X", "Y", "Z", "OutVal")); props.Add(ArriveTangent.ToStructProperty("X", "Y", "Z", "ArriveTangent")); props.Add(LeaveTangent.ToStructProperty("X", "Y", "Z", "LeaveTangent")); props.Add(new EnumProperty(InterpMode.ToString(), "EInterpCurveMode", MERFileSystem.Game, "InterpMode")); return(new StructProperty("nterpCurvePointVector", props)); }