Jump to content

TFisherIRA

Members
  • Posts

    9
  • Joined

  • Last visited

TFisherIRA's Achievements

  1. I tried unplugging the board again and it automatically reconnects.
  2. Is there a simple way to initiate a reconnect call for an MccBoard if it disconnects during a process? Specifically, I'd like to reconnect a USB-TC if it unplugs during a process while the program is still running.
  3. I resolved the issue by just using DigitalPortType.FirstPortA for bitValues 0-7 and then using DigitalPortType.FirstPortB for bitValues 8-11 when using the Dout() command. Private Sub OutputValue(value As Integer) Dim ULStat As ErrorInfo Dim PortType As DigitalPortType ' Determine the port type based on the state of CheckBox1 If CheckBox1.Checked Then PortType = DigitalPortType.FirstPortB Else PortType = DigitalPortType.FirstPortA End If ' Output the value using DOut(), converting it to UShort ' Parameters: ' PortType : The output port type ' DataValue: The value to be written to the port ULStat = DaqBoard.DOut(PortType, CUShort(value)) If ULStat.Value <> ErrorInfo.ErrorCode.NoErrors Then MessageBox.Show("Error occurred while outputting value: " & ULStat.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End If End Sub
  4. The section of code is supposed to convert an integer (value) into a byte string that tells the relay board which bits to flip on and flip off at once. Private Sub OutputValue(value As Integer) Dim ULStat As ErrorInfo ' Output the value using DOut(), converting it to UShort ' Parameters: ' PortNum : The output port ' DataValue: The value to be written to the port ULStat = DaqBoard.DOut(PortNum, CUShort(value)) If ULStat.Value <> ErrorInfo.ErrorCode.NoErrors Then MessageBox.Show("Error occurred while outputting value: " & ULStat.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End If End Sub This code works perfectly for the bitValues 0-7 but does nothing for bitValues 8-11 on my USB-ERB24 relay board. I believe this issue may be related to the DigitalPortType which I currently have set as AuxPort. I believe USB-ERB24 may use FIrstPortA and FirstPortB (?) The program works perfectly when I use the DBitOut() function, but I need to be able to use DOut() as well for the final program. I do not understand the DigitalPortType stuff at all. Are there any suggestions on how I should proceed to get this to work with Dout()?
  5. If I want to reference the MccDaq.dll on a Windows XP computer in Visual Basic 6.0, Do I have to manually declare the functions or is there a simpler way to reference the library?
  6. I receive this output when typing clrver into commandline so I assume I'm using .NET
  7. I've tried writing another program for reading thermocouples based on insipiration from DaqInScan03 and still no success Public Class Form1 Dim ULStat As MccDaq.ErrorInfo Dim DaqBoard As New MccDaq.MccBoard(0) Dim Temperature As Single ' Variable to store temperature value Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click ULStat = DaqBoard.GetTCValues({0}, Nothing, 1, IntPtr.Zero, 0, 1, MccDaq.TempScale.Celsius, Temperature) If ULStat.Value = MccDaq.ErrorInfo.ErrorCode.NoErrors Then Label1.Text = Temperature.ToString("0.000\°\C") Else Stop ' Handle error End If End Sub End Class
  8. I found the following code on a Youtube video from 11 years ago for reading a MCC DAQ analog output Public Class Form1 Dim mydaqboard As New MccDaq.MccBoard(0) Dim dataval As System.Int16 Dim engunit As Single Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Timer1.Start() End Sub Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick mydaqboard.AIn(0, MccDaq.Range.Bip10Volts, dataval) mydaqboard.ToEngUnits(MccDaq.Range.Bip10Volts, dataval, engunit) Label2.Text = engunit End Sub End Class The program executes without errors, however it only displays an output of -10 in Label2. Everything works as intended in DAQami so hardware is not the issue. How can get this program to readout properly in Visual Basic?
  9. Does anyone know how to obtain a copy of SoftWIRE for Visual Basic 6.0? It used to be the software that accompanied Measurement Computing Devices back in 2001 (very similar to LabVIEW), but is no longer in use. I have an old DIY hardware device that uses it and it needs to be debugged. Any information regarding where to obtain a copy would be helpful. Thank you.
×
×
  • Create New...