View Single Post
  #2   Spotlight this post!  
Unread 17-03-2009, 22:27
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: sending/Reading the Eathernet port

You will probably want to use the System.Net.UdpClient class to receive data from the cRio.

Here is the receive code from my code:
Code:
    Sub BeginGetDataAsync() Implements IDashboardClient.BeginGetDataAsync
        _listening = True
        _client = New UdpClient(DS_TO_PC_LOCAL_PORT)
        _client.BeginReceive(AddressOf Me.GetDataAsync, Nothing)
    End Sub

    Sub GetDataAsync(ByVal result As IAsyncResult) Implements IDashboardClient.GetDataAsync
        Try
            Dim endPoint As IPEndPoint = Nothing
            Dim bytes = _client.EndReceive(result, endPoint)
            ParseBytes(bytes)
        Catch ex As Exception
            Debug.WriteLine(ex.Message)
            Debug.Assert(False)
            Throw
        Finally
            If Listening Then
                _client.BeginReceive(AddressOf Me.GetDataAsync, Nothing)
            End If
        End Try
    End Sub
If you need more info you can ask me, or take a look at my dashboard viewer.
__________________
Eric Haskins KC9JVH