Shop OBEX P1 Docs P2 Docs Learn Events
Three demo programs for the TCP and UDP support of the new RobotBAISC to be rel — Parallax Forums

Three demo programs for the TCP and UDP support of the new RobotBAISC to be rel

SamMishalSamMishal Posts: 468
edited 2009-05-01 13:10 in Robotics
Hi All,
·
See the attached· RobotBASIC_TCP_Demos.Zip ans RobotBASIC_TCP_Demos.Zip files.
·
In the zips there are 6 files, the source codes and exes for three programs.
·
The programs are UDP_IO_Demo.exe/bas, TCP_Server_Demo.exe/bas and TCP_Client_Demo.exe/bas.
·
The demos illustrate how you can send BINARY and TEXT··data simultaneously and do CONTROL from one machine to another on the LAN or WAN or even across the world using the Internet. You can even use·them as a CHAT program if you wish.

The demos use a slider bar to simulate analog input and 8 check boxes to simulate Digital data and a Memo box to illustrate sending text along with the numeric data.
·
The UDP is one program that you can run on two machines or you can have two instances on the same machine. And once you actuate the UDP sockets you can communicate between the two machines or the two instances of the program on the same machine. Moving the slider, clicking on the check boxes and typing in the memo box will be reflected immediately on the other instance. This illustrates how you can achieve control from one machine to another over the internet using the UDP internet protocol.

The very same actions are also possible using the TCP protocol, albeit slightly more complicated due to the fact that TCP is a Client/Server model as compared to UDP which is a Broadcast model….The TCP_Server program is the server end and the TCP_Client is the client end. You can run both programs on the same machine or on different machines.
·
Once a client is connected to a server you will be able to send Text/Binary data just like in the UDP demo. The TCP demos also demonstrate how the programming can check the validity of the link and take action if either the Server or the Client drops the link.
·
All the demos have instructions on how to use them in the program by pressing the Instructions button.
·
The source codes are quite informative to read....the code illustrates the new capabilities of RobotBASIC; have a look especially at the EVENT driven nature of the program.
·
I wrote the demos to test the new facilities and RB has passed with flying colors…no errors what so ever…yet… So now all I need is just to bring the help file up to bar and we are done….hop.gif··· I should easily meet the new deadline for release of May 8th...no worries...06.gif
·
Think about how you can use the new RB for controlling robots. You can control a robot:
·
-········· Wirelessly (Remote Computational Platform) using Bluetooth or Zigbee link to a robot controlled by a Basic Stamp that receives the data.
-········· Wirelessly using WiFi using the new TCP or UDP support in RB and a Basic Stamp that has a WiFi card that can be controlled by the BS2 and will send and receive UDP or TCP data. Many of these are available, see Servo or Nuts & Volts.
-········· Across the WORLD…using the RCP or UDP support.
·
And all this is possible with RobotBASIC, an extremely simple to use yet superbly capable language, that is not at all dissimilar to PBasic.
·
·
Regards
·
Sam

Post Edited (SamMishal) : 5/4/2009 5:25:23 PM GMT
Sign In or Register to comment.