Jump to content

Reading data from machine with RS232

- - - - -

  • Please log in to reply
2 replies to this topic

#1
egetunks

egetunks

    Newbie

  • Members
  • Pip
  • 2 posts
I have a problem with my project, I try to read data from a machine that gives information, from the electrity that is produced, the data comes from an RS232 COM port.
If is send this(11 00 00 00 B6 00 00 00 C7) hexadecimal data to the machine with the program COM port toolkit, then i get the hexadecimal code that I want. But this program doesnt want to read.
It says: Overload resolution failed because no accessible 'Read' accepts this number of arguments
this error is in the error list.
I use Visual Basic 2010

Public Class Form1


    Private Sub btnread_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnread.Click

        Try

            soladin.Open()


        Catch ex As Exception

            MessageBox.Show("Controleer of de Soladin verbonden is met de computer zijn seriële poort COM 1", "Fout!")

        End Try

        Try

            Dim soladinTX As Byte() = {&H11, &H0, &H0, &H0, &HB6, &H0, &H0, &H0, &HC7}


            soladin.Write(soladinTX, 0, soladinTX.Length)

            [COLOR="red"][U]txtread.Text = soladin.Read(Int32.Parse(9))[/U][/COLOR]

            MessageBox.Show(soladin.ToString)

            soladin.Close()

        Catch ex As Exception

            MessageBox.Show("Fout", "fout")

        End Try


    End Sub

End Class


I hope tou can help me with my problem, thanks.

Edited by egetunks, 18 February 2011 - 04:27 AM.


#2
LuthfiHakim

LuthfiHakim

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 765 posts
I am not an expert with VB.NET, but from the error message I deduce that soladin's class does not have Read method with argument as used in the red line. With overload, a class may has several methods with the same name. But they must different in argument types or counts. And in your case no method of soladin support call with the supplied argument.

Check the code for soladin to find acceptable argument list.

#3
egetunks

egetunks

    Newbie

  • Members
  • Pip
  • 2 posts
Thanks for trying to help me. I already finnished my project, this thread may be closed.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users