by AlexanderHWUK » Tue Mar 16, 2010 12:13 am
by AlexanderHWUK
Tue Mar 16, 2010 12:13 am
Hi all!
First, if this is a personal discussion then I apologise and I will create my own thread, but as I am working on the same stuff it is logical for me to write my questions in here.
Anyways, had some time to try the code to communicate with the Robobuilder through the Com Port, and for once it is not as difficult as it looks!
I have tried using l3v3rz code
- Code: Select all
public int connect(string pn)
etc., but it seems I need some more code behind it (or I'm just a noob with C#), cause I can't get it to work. If there is more code, would you kindly release it?
However, mniki's code works like a charm! Also sticks with the RBC protocol which I have began to get used to. Nevertheless, I have some C# pitiful questions:
- I can send bytes through Com port, but how do I receive them? How can I read them, put them on screen, and save them as a string (or something else if more adequate)?
- Is it better for my project (I have an independent Artificial Neural Network code to calculate and learn depending on the Robobuilder PSD inputs), to put everything in the same code file? How do you co-ordinate different codes in C#? (Do you create a solution, and then have a code record its data in a file that another code can read at the same time?)
EDIT - Also forgot to add: In mniki's code, I send for example a motion command and the robot does it, but then it does not recognise if I send another one straight after that. I have tried putting delays (Using Thread.Sleep() ), but even if the delays work, the Robobuilder doesn't execute the next command

Any hints? What have I forgot?
As always, thanks for all the help
Alex
Hi all!
First, if this is a personal discussion then I apologise and I will create my own thread, but as I am working on the same stuff it is logical for me to write my questions in here.
Anyways, had some time to try the code to communicate with the Robobuilder through the Com Port, and for once it is not as difficult as it looks!
I have tried using l3v3rz code
- Code: Select all
public int connect(string pn)
etc., but it seems I need some more code behind it (or I'm just a noob with C#), cause I can't get it to work. If there is more code, would you kindly release it?
However, mniki's code works like a charm! Also sticks with the RBC protocol which I have began to get used to. Nevertheless, I have some C# pitiful questions:
- I can send bytes through Com port, but how do I receive them? How can I read them, put them on screen, and save them as a string (or something else if more adequate)?
- Is it better for my project (I have an independent Artificial Neural Network code to calculate and learn depending on the Robobuilder PSD inputs), to put everything in the same code file? How do you co-ordinate different codes in C#? (Do you create a solution, and then have a code record its data in a file that another code can read at the same time?)
EDIT - Also forgot to add: In mniki's code, I send for example a motion command and the robot does it, but then it does not recognise if I send another one straight after that. I have tried putting delays (Using Thread.Sleep() ), but even if the delays work, the Robobuilder doesn't execute the next command

Any hints? What have I forgot?
As always, thanks for all the help
Alex