![]() |
Connecting to the robot - C#
Hello,
I've been trying to use NetworkStream in C# to connect to the robot, but I can't find a good resource to help me recieve packets from the robot. I've got the labview code that will run using TCP but I'm needing some help on the client side. Anyone Know C# well enough to help, or at least point me to the right resource? Thanks! |
Re: Connecting to the robot - C#
You should just call NetworkStream.Read, but it sounds like you've already made it that far. What exactly isn't working?
|
Re: Connecting to the robot - C#
It never actually connects to the robot to get any data:/
|
Re: Connecting to the robot - C#
Have you looked into the TcpClient class?
|
Re: Connecting to the robot - C#
I have not, do you have any good resources you can give me on that?
|
Re: Connecting to the robot - C#
MSDN is the place to go for C#. There are some examples further down.
|
Re: Connecting to the robot - C#
I can't believe I didn't think of MSDN before, I guess my version of VS doesn't have in implemented because I got Express 2012:/
Thanks! |
Re: Connecting to the robot - C#
I've got a small labview program writing a string to the stream and then on the client side (written in C#), when I read the stream every 20ms, it comes back jumbled after the first read.
For instance, if I wrote a string "a b c" to the stream, it would read like this for the first four iterations (each line is what is read at 20ms): Quote:
Do I need to change the speed at which I'm reading the string or what's causing the inconsistency? |
Re: Connecting to the robot - C#
Can you post a screenshot of your LV server you have running and copy/paste some of the C# you're using?
|
Re: Connecting to the robot - C#
Yep!
Here's the server code, really simple LV server, went off a youtube tutorial ![]() Here's the C# code to read the stream, note that this reads every 20ms. Code:
private void timUpdate_Tick(object sender, EventArgs e) |
| All times are GMT -5. The time now is 03:11. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi