View Single Post
  #7   Spotlight this post!  
Unread 02-03-2009, 20:54
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: recieve data from cRIO

Thanks, but i figured it out:
(in C#.net just to irritate you VB bigot)
Code:
buffer= client.Receive...
string endresult = "";
foreach (byte databit in buffer)
{
    endresult+=((buffer==0)?"":((char)databit).ToString());//I love () to make sure thigs execute as i want (as well as ; semicolins;)
} 
textBox1.Text+="\n"+endresult;
the problem is it was sending something like this:
?hs\0546d\0jos\0MYDATAHERE\0jsfjnn\0
and it cut off after the \0 (or null (buffer = 0) (Nothing for you VB bigot))
i just had to set a breakpoint, see the data, and realize what was happening (the string was being chopped up!);
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib