internet control of the rcx - chert.cs.ksu.educhert.cs.ksu.edu/internet_control_of_the_rcx.pdfthe...

3
ROBOLAB Online Documentation: Internet Control of the RCX www.LEGO.com/education/mindstorms ©2000 The LEGO Group. This page may be photocopied for non-commercial educational use. All other rights reserved. 1 Internet Control of the RCX An RCX unit can be controlled over the Internet. The program you write can be downloaded to an RCX located near any computer running ROBOLAB that is linked via the Internet. Note: you need two computers, an internet connection with a known IP address. One computer must have the IR Transmitter and RCX set up and ready to go. Running the ROBOLAB Server First, set up the computer which is going to receive the ROBOLAB program and download it to the waiting RCX. This computer must run a special software called ROBOLAB Server. The ROBOLAB Server is different than ROBOLAB. The ROBOLAB Server Program is in the Extras Folder. Before running ROBOLAB Server, make sure that ROBOLAB is not running on the remote computer. You may want to start by running ROBOLAB to test communications between the remote computer, the IR Transmitter, and the RCX. IMPORTANT Note: The ROBOLAB Server must be from version 2.0.1 or later to run properly. To start ROBOLAB Server, choose File Open. Next, open the Extras folder and then the Server folder. Double click on ROBOLAB Server.exe. Running the ROBOLAB Server opens a window on the remote computer. This window must be open for Internet control of the RCX to work. Testing Communication is successful when the RCX plays a rising sweep and the green indicator in the ROBOLAB Server window turns from red to green. Red test indicator light shows no communication between computer and RCX. After starting the ROBOLAB Server, the computer and RCX are ready to receive programs over the internet. Select COM Port Click on the COM Port list to specify which Port is being used. Test Communication Click to test for communication between the remote computer and RCX.

Upload: others

Post on 08-Oct-2019

1 views

Category:

Documents


0 download

TRANSCRIPT

ROBOLAB Online Documentation: Internet Control of the RCX

www.LEGO.com/education/mindstorms ©2000 The LEGO Group. This page may be photocopied for non-commercial educational use. All other rights reserved.

1

Internet Control of the RCX

An RCX unit can be controlled over the Internet. The program you write can be downloaded to an RCX locatednear any computer running ROBOLAB that is linked via the Internet.

Note: you need two computers, an internet connection with a known IP address. One computer must have the IRTransmitter and RCX set up and ready to go.

Running the ROBOLAB Server

First, set up the computer which is going to receive the ROBOLAB program and download it to thewaiting RCX. This computer must run a special software called ROBOLAB Server. TheROBOLAB Server is different than ROBOLAB. The ROBOLAB Server Program is in the ExtrasFolder.

Before running ROBOLAB Server, make sure that ROBOLAB is not running on the remotecomputer. You may want to start by running ROBOLAB to test communications between the remote computer, theIR Transmitter, and the RCX.

IMPORTANT Note: The ROBOLAB Server must be from version 2.0.1 or later to run properly.

To start ROBOLAB Server, choose File Open. Next, open the Extras folder and then the Server folder. Doubleclick on ROBOLAB Server.exe.

Running the ROBOLAB Serveropens a window on the remotecomputer. This window must beopen for Internet control of theRCX to work.

Testing Communication issuccessful when the RCX plays arising sweep and the greenindicator in the ROBOLABServer window turns from red togreen.

Red test indicator light shows no communication between computer and RCX.

After starting the ROBOLAB Server, the computer and RCX are ready to receive programs over the internet.

Select COM PortClick on the COMPort list to specifywhich Port is beingused.

Test CommunicationClick to test forcommunicationbetween the remotecomputer and RCX.

ROBOLAB Online Documentation: Internet Control of the RCX

www.LEGO.com/education/mindstorms ©2000 The LEGO Group. This page may be photocopied for non-commercial educational use. All other rights reserved.

2

How do you create ROBOLAB programs to send over the Internet?

There are two new types of ROBOLAB commands used for Internet control ofthe RCX. These commands are found in the Internet sub menu of theProgrammer - Inventor Level 4 or in the Investigator - Program Level 5.

They are the ÔInternet BeginÕ & ÔBegin InternetDirect ModeÕ, each with a corresponding endcommand.

Note: If you do not see these icons, you must installextras. Under Project choose Install Extras andfollow the prompts.

Internet Begin and EndThe Internet Begin command is used instead of the standard Begincommand in ROBOLAB programs. It is required as the first commandin every Investigator or Inventor Internet program that will bedownloaded to the remote RCX. The IP address of the remote

computer that will be transmitting the program to the RCX must bespecified. The remote computer must be running ROBOLAB Server.

The Internet End command is used at the end of every Investigator orInventor Internet program that begins with the Internet BeginCommand.

The String modifier is used to specify the IP address of the remote computer.

Example 1Download a program from a remote computer to run a motor for 2 seconds.

This program sends a program to the remotecomputer with IP address 130.62.208.54.This computer then downloads the programto the remote RCX. When the remote RCXis run the motor on Port A runs for 2seconds and stops.

Note: the remote computer must be runningthe ROBOLAB Server and have an IRTransmitter attached with the remote RCXon and nearby.

Behavior: When the program is downloaded the remote RCX must be run by pushing the red run button. Theremote RCX will then run the motor on Port A for 2 seconds.

Internet sub-menu Inventor Menu

Investigator Menu

Program InternetRCXex1.vi

ROBOLAB Online Documentation: Internet Control of the RCX

www.LEGO.com/education/mindstorms ©2000 The LEGO Group. This page may be photocopied for non-commercial educational use. All other rights reserved.

3

Direct Mode over the Internet

The Begin Internet Direct Mode command is used to actively control the remote RCX. It is used insteadof the standard Begin command or Internet Begin command. This command downloads and runs theprogram in the remote RCX. The IP address of the remote computer that will be transmitting the programto the RCX must be specified. The remote computer must be running ROBOLAB Server.

The End Internet Direct Mode command is used at the end of every direct mode program that beginswith the Begin Internet Direct Mode command.

Example 2Download and run a program to run a motor for 1second.

This program is sent to the remote computer withIP address 130.64.208.54. The remote computerthen downloads and runs the program in directmode on the remote RCX. The RCX runs themotor on Port A for 1 second and then stops.

Clicking on the run arrow sends the programvia the Internet to the remote computer where it isdownloaded and run on the RCX. There is noindication on the local computer if the program wascompleted successfully.

An error message appears if there are any problems with thetransmission from the local computer to the remote computer.

The programs in these examples use simple commands. Programs for Internet Control of the RCX can be ascomplex as any of the conventional RCX programs for your local computer. There are a few exceptions ÐROBOLAB Server does not support Internet Direct Mode for programs with Data Acquisition or Loopingstructures. These formats are supported by the Internet Mode.

See the Getting Started: TeacherÕs Guide to Robolab Software or Advanced Programming on the web atwww.lego.com/dacta/robolab for more information on the Programmer and Investigator commands.

Program InternetRCXex2.vi