×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

AD-converter

AD-converter

AD-converter

(OP)
we have a AD-converter (type tlc549cp) .

the code for reading this ADC in Visual Basic.Net is:



private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim i As Integer
        i = OPENCOM("COM1,1200,N,8,1")
        If i = 0 Then MsgBox("COM1 niet beschikbaar")
        Timer1.Interval = 1000
End Sub


Public Function AD()
        Dim i, bitwaarde, bitpositie, meting As Integer
        RTS(1)
        DELAYUS(10)
        RTS(0)
        DELAYUS(50)
        meting = 0
        bitwaarde = 128

        For bitpositie = 1 To 8
            If DSR = 1 Then meting = meting + bitwaarde
            DTR(1)
            DELAYUS(10)
            DTR(0)
            DELAYUS(10)
            bitwaarde = bitwaarde / 2
        Next bitpositie
        AD = meting

End Function

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Dim spanning As Double

        spanning = AD() / 255 * 5
        'spanning word in textvak gezet
        Text1.Text = CStr(spanning & " V ")
end sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Timer1.Enabled = True
End Sub


i have created a program in LabVIEW, it looks exactly the same, but it doesn't works, it gives constantly the same voltage.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources