none
Visual basic real time process monitoring RRS feed

  • Question

  • I am doing a project on "Data Acquisition Using Visual basic express 2010" by using qpod dll file from inficon. i have to get the frequency values from quartz sensor and log it in .TXT. display the wave form in real time.  I am unable to use the functions from dll as am new to vb.   Also want to know, is it possible without using dll file , to collect frequency values from sensor in vb,, if so, please let me know how?


    Can anyone guide me in this-------------?


    • Edited by Sam12345vb Thursday, April 19, 2018 3:57 PM
    Thursday, April 19, 2018 3:56 PM

Answers

  • Well it looks like qpod.dll is ActiveX (COM) so it can be used from VB.NET, but you probably need to check with the vendor for examples of how to use the functions. Perhaps they have a VB example. It's a third-party product so unless there is someone here who has worked with the device we probably won't be able to help with anything unless we have a code example to work with.

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Thursday, April 19, 2018 5:27 PM
  • Well I looked at Infinicon's CDG045D High Precision Vacuum Gauge from their Library. These devices have serial IO interfaces. So it would be up to you to contact Infinicon and for each device get a list of the commands and replies used with each device you want to interface with.

    Then you could use the  Serial Port Class to communicate with each device directly.

    However it may be simplest on a LAN to use a 1 Port RS232 Serial to IP Ethernet Converter so you can poll numerous devices over the LAN using IP. You would need the correct serial interface DB9 or DB25 male or female or a converter female to female or male to male. Note that the device in the bottom image requires a separate power supply and there may be some that are powered by the serial interface or ethernet cable for all I know.


    La vida loca

    • Edited by Mr. Monkeyboy Thursday, April 19, 2018 7:53 PM
    • Marked as answer by Sam12345vb Saturday, April 21, 2018 5:07 AM
    Thursday, April 19, 2018 7:52 PM

All replies

  • Well it looks like qpod.dll is ActiveX (COM) so it can be used from VB.NET, but you probably need to check with the vendor for examples of how to use the functions. Perhaps they have a VB example. It's a third-party product so unless there is someone here who has worked with the device we probably won't be able to help with anything unless we have a code example to work with.

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Thursday, April 19, 2018 5:27 PM
  • Well I looked at Infinicon's CDG045D High Precision Vacuum Gauge from their Library. These devices have serial IO interfaces. So it would be up to you to contact Infinicon and for each device get a list of the commands and replies used with each device you want to interface with.

    Then you could use the  Serial Port Class to communicate with each device directly.

    However it may be simplest on a LAN to use a 1 Port RS232 Serial to IP Ethernet Converter so you can poll numerous devices over the LAN using IP. You would need the correct serial interface DB9 or DB25 male or female or a converter female to female or male to male. Note that the device in the bottom image requires a separate power supply and there may be some that are powered by the serial interface or ethernet cable for all I know.


    La vida loca

    • Edited by Mr. Monkeyboy Thursday, April 19, 2018 7:53 PM
    • Marked as answer by Sam12345vb Saturday, April 21, 2018 5:07 AM
    Thursday, April 19, 2018 7:52 PM
  • Public Class Form1
        '----------------------------------------------------------------------------------------------------------
        'Purpose:  Allow for data recieve event to update text box on different thread
        '----------------------------------------------------------------------------------------------------------
        Public Delegate Sub myDelegate()
    
        '----------------------------------------------------------------------------------------------------------
        'Purpose:  Close and exit
        '----------------------------------------------------------------------------------------------------------
        Private Sub btn_Close_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Close.Click
            Me.Close()
        End Sub
    
        '----------------------------------------------------------------------------------------------------------
        'Purpose:  Load Form
        '----------------------------------------------------------------------------------------------------------
        Private Sub frmSerialPortExample_Load(ByVal sender As Object, ByVal e As System.EventArgs)
            For i As Integer = 0 To My.Computer.Ports.SerialPortNames.Count - 1
                cboCommPorts.Items.Add(My.Computer.Ports.SerialPortNames(i))
            Next
            cmdDisconnect.Enabled = False
        End Sub
    
        '----------------------------------------------------------------------------------------------------------
        'Purpose:  Connect to comm port
        '----------------------------------------------------------------------------------------------------------
        Private Sub cmdConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdConnect.Click
            If SerialPort1.IsOpen Then
                SerialPort1.Close()
            End If
            Try
                With SerialPort1
                    .PortName = cboCommPorts.Text
                    .BaudRate = 9600
                    .Parity = IO.Ports.Parity.None
                    .DataBits = 8
                    .StopBits = IO.Ports.StopBits.One
                End With
                SerialPort1.Open()
    
                lblMessage.Text = SerialPort1.PortName & " connected"
                cmdDisconnect.Enabled = True
                cmdConnect.Enabled = False
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
        End Sub
    
        '----------------------------------------------------------------------------------------------------------
        'Purpose:  Disconnect from comm port
        '----------------------------------------------------------------------------------------------------------
        Private Sub cmdDisconnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDisconnect.Click
            Try
                SerialPort1.Close()
                lblMessage.Text = SerialPort1.PortName & " disconnected"
                cmdDisconnect.Enabled = False
                cmdConnect.Enabled = True
            Catch ex As Exception
    
            End Try
        End Sub
    
        '----------------------------------------------------------------------------------------------------------
        'Purpose:  Send message to selected comm port
        '----------------------------------------------------------------------------------------------------------
        Private Sub cmdSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSend.Click
            Try
                SerialPort1.Write(txtTextToSend.Text & vbCrLf)
                With txtDataReceived
                    .SelectionColor = Color.Black
                    .AppendText(txtTextToSend.Text & vbCrLf)
                    .ScrollToCaret()
                End With
                txtTextToSend.Text = String.Empty
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
        End Sub
    
        '----------------------------------------------------------------------------------------------------------
        'Purpose:  Update text box with data recieved from comm port
        '----------------------------------------------------------------------------------------------------------
        Public Sub updateTextBox()
            With txtDataReceived
                .Font = New Font("Garamond", 12.0!, FontStyle.Bold)
                .SelectionColor = Color.Red
                .AppendText(SerialPort1.ReadExisting)
                .ScrollToCaret()
            End With
        End Sub
    
        '----------------------------------------------------------------------------------------------------------
        'Purpose:  Receive data
        '----------------------------------------------------------------------------------------------------------
        Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
            txtDataReceived.Invoke(New myDelegate(AddressOf updateTextBox), New Object() {})  ', New Object()
        End Sub
    
        
        
    End Class
    
    

    First, thanks for the reply.   

    The above attached are the sample code and qpod functions . Can anyone please help me in including to get frequency values from the sensor using the above functions?

    Saturday, April 21, 2018 5:39 AM
  • Public Class Form1
        '----------------------------------------------------------------------------------------------------------
        'Purpose:  Allow for data recieve event to update text box on different thread
        '----------------------------------------------------------------------------------------------------------
        Public Delegate Sub myDelegate()
    
        '----------------------------------------------------------------------------------------------------------
        'Purpose:  Close and exit
        '----------------------------------------------------------------------------------------------------------
        Private Sub btn_Close_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Close.Click
            Me.Close()
        End Sub
    
        '----------------------------------------------------------------------------------------------------------
        'Purpose:  Load Form
        '----------------------------------------------------------------------------------------------------------
        Private Sub frmSerialPortExample_Load(ByVal sender As Object, ByVal e As System.EventArgs)
            For i As Integer = 0 To My.Computer.Ports.SerialPortNames.Count - 1
                cboCommPorts.Items.Add(My.Computer.Ports.SerialPortNames(i))
            Next
            cmdDisconnect.Enabled = False
        End Sub
    
        '----------------------------------------------------------------------------------------------------------
        'Purpose:  Connect to comm port
        '----------------------------------------------------------------------------------------------------------
        Private Sub cmdConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdConnect.Click
            If SerialPort1.IsOpen Then
                SerialPort1.Close()
            End If
            Try
                With SerialPort1
                    .PortName = cboCommPorts.Text
                    .BaudRate = 9600
                    .Parity = IO.Ports.Parity.None
                    .DataBits = 8
                    .StopBits = IO.Ports.StopBits.One
                End With
                SerialPort1.Open()
    
                lblMessage.Text = SerialPort1.PortName & " connected"
                cmdDisconnect.Enabled = True
                cmdConnect.Enabled = False
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
        End Sub
    
        '----------------------------------------------------------------------------------------------------------
        'Purpose:  Disconnect from comm port
        '----------------------------------------------------------------------------------------------------------
        Private Sub cmdDisconnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDisconnect.Click
            Try
                SerialPort1.Close()
                lblMessage.Text = SerialPort1.PortName & " disconnected"
                cmdDisconnect.Enabled = False
                cmdConnect.Enabled = True
            Catch ex As Exception
    
            End Try
        End Sub
    
        '----------------------------------------------------------------------------------------------------------
        'Purpose:  Send message to selected comm port
        '----------------------------------------------------------------------------------------------------------
        Private Sub cmdSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSend.Click
            Try
                SerialPort1.Write(txtTextToSend.Text & vbCrLf)
                With txtDataReceived
                    .SelectionColor = Color.Black
                    .AppendText(txtTextToSend.Text & vbCrLf)
                    .ScrollToCaret()
                End With
                txtTextToSend.Text = String.Empty
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
        End Sub
    
        '----------------------------------------------------------------------------------------------------------
        'Purpose:  Update text box with data recieved from comm port
        '----------------------------------------------------------------------------------------------------------
        Public Sub updateTextBox()
            With txtDataReceived
                .Font = New Font("Garamond", 12.0!, FontStyle.Bold)
                .SelectionColor = Color.Red
                .AppendText(SerialPort1.ReadExisting)
                .ScrollToCaret()
            End With
        End Sub
    
        '----------------------------------------------------------------------------------------------------------
        'Purpose:  Receive data
        '----------------------------------------------------------------------------------------------------------
        Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
            txtDataReceived.Invoke(New myDelegate(AddressOf updateTextBox), New Object() {})  ', New Object()
        End Sub
    
        
        
    End Class
    
    

    First, thanks for the reply.   

    The above attached are the sample code and qpod functions . Can anyone please help me in including to get frequency values from the sensor using the above functions?

    Saturday, April 21, 2018 5:42 AM