Setup and building

Jun 14, 2007 at 11:29 PM
Edited Jul 9, 2007 at 3:24 PM
Ok, you found this code and you want to build the system... how?

Step 1: Install Robotic Studio. Sounds simple until you try to build the system. You need to install Robotic studio into a short directory name (e.g. C:\RStudio). While Microsoft has supported long file names for a long time, Microchip has very small buffers for the file names and limits the full path to about 40 characters. Therefore don't make the base path a long name.

Step 2: Expand the ZIP file. The environment assumes it is in a directory called VEX under the SAMPLES directory. After you expand the ZIP, you will find three Visual Studio solutions in the VEX directory:

VEX.sln – a solution containing all projects. You need Visual Studio Standard edition or above to properly load this since it has both C# and C++ projects.

VEXCsharp.sln is for the C# services on the PC.

VEXCpp.sln is a C++ solution that uses nmake to build the controller code using the Microchip compiler. nmake is also used to copy the basic SquareBot definitions to the Samples\config directory.

If you are using the Express versions of Visual Studio, you will need both the C++ and C# versions. Note that you do not HAVE to use the C++ solution at all. You can just use nmake from the command line. (For the many who don’t know what I’m talking about, just get C++ express. You will be much happier)

Step 3: The default installation for EasyC is a problem for nmake. (Spaces are not allowed in paths.) The simplest solution is to install EasyC into C:\EasyC. If that is not an option, you will need to customize the makefile for VEXRobot to the path of your compiler. You probably also will need to have MPLab installed as well into a simple path location as well. (e.g. C:\mcc18)

Fixup the directories specified at the top of the makefile to where ever your installation of EasyC (and MCC is installed). Note that the lib file provided by Vex Labs requires the old compiler 2.40. To customize the makefile, open it with a text editor. The top 6 lines that begin with “dir_” need to be updated with your installation locations.

Note: You do NOT have to build the VEXRobot or SquareBot projects to use the VEX MSRS services. I’ve included the .HEX files in the VEXRobot directory that you can load onto the controller that use COM1 and COM2. Unless you change the communications protocol or add new commands for the robot to understand, the controller code should not change. (For SquareBot, just copy the XML files from that project directory into the SAMPLES\CONFIG directory.

Step 4: Build it. Again, easy to say, but due to my lack of knowledge about the Visual Studio C# environment, you need to build the solution twice. First time should build VEXHelper and VEX projects. VEXService should fail with errors about unresolved names for VEX.Y2006.M12.Proxy. Delete the reference in the VEXService project to VEX.Y2006.M12.Proxy. Add a reference back to the project (right click on the References folder and select Add Reference) referencing VEX.Y2006.M12.Proxy from the .NET tab. Building the solution again should have all projects build correctly.

Note: If you are using the Express version of Visual Studio, remember to load and compile the C++ solution as well.

Step 5: Load the robot controller code. Download the VexCOM1.hex or VexCOM2.hex file in the VEX\VEXRobot directory to your robot. Remember that VexCOM1 will communicate the the PC via the programming cable and VexCOM2 will comminicate via the COM port by the IO ports.

Step 6: Start the service You can start the service by making sure that the VEX project is selected as the “Startup Project” and pressing F5 (run). Alternately, you can setup a short cut as follows:

Location of item: C:\RStudio\bin\DssHost.exe
Name of shortcut: Start VEX Service

Edit the Properties and change

Target: C:\RStudio\bin\DssHost.exe -port:50000 -tcpport:50001 -manifest:"samples/vex/VEX/VEX.manifest.xml"
Start in: C:\RStudio

Note that it takes about 5 to 10 seconds before the communications have initialized and the service has correctly started.

If you have an error message:

      • Please make sure the VEX is turned on, connected
via Bluetooth, and configured to the proper port http://localhost:50000/vex

(and your robot is actually on), then you are not using the same COM port as I do. No big problem, just proceed on to the next step.

Step 7: Open a browser (Internet Explorer preferred) and type in the URL http://localhost:50000. Click on the VEX running service. You have the option to set the COM Port at the top of the display. Find out which port your system uses and enter the correct port and press connect. The error message at the top of the dialog should go away after about 5 to 10 seconds. You can now change the type of the motors or IO ports or even the interrupt handlers. Note that the ‘Set’ button at the end of each line will just change that one item. To change all motors or all ports, use the appropriate ‘Set All’ button at the end of the appropriate section. (You cannot update the entire robot in one shot…. No button! :>) I suggest setting the robot on a stand (e.g. several CD cases) and setting the appropriate motor value.

This test will only test the base VEX interface. Try going to the ‘Control Panel’ and starting the other VEX services. You should be able to use the generic Explorer service provided with MSRS. You just need the correct manifest loaded.

Help and comments provided by:

Vince Thompson - Kansas City Robotics Society
Jul 2, 2012 at 3:05 PM


In step number 3 where its instructed to change up the directory names, why do we need the Easy files? For instance, the EasyC VEX UserAPI. 




Jul 2, 2012 at 4:24 PM

EasyC has the header files for the VEX controller with various defines.

Unless you plan to edit the robot side code, don’t bother with it and just install one of the two already built files onto the controller.  (The directions are for anyone wanting to build and/or modify any part of the system.  Most users will probably never build the sources unless they are trying to run on a different version of MRS than what the installs were built for.


Jul 3, 2012 at 2:42 PM

Is this interface for the VEX PIC controller only? Or can it be used with the VEX Cortex controller? 



Jul 3, 2012 at 3:20 PM

The VEX Cortex is an ARM Cortex-M3 processor.  The VEX PIC (what this was written for) is a PIC18F8520.  Therefore the code cannot be directly moved over.  I'm sure it can be done (if by nothing else than a complete rewrite of the robot code to fit whatever the environment is for that controller).  I don't have a VEX Cortex to test with , otherwise I might give it a shot.


Jul 6, 2012 at 3:42 PM

Is there some sort of special configuration for the motors? When I'm setting the PWM value in the control panel browser page, for a PWM of 127, the motor is off and then at 0, the motor is at its full speed. So it's behaving in the opposite manner. 


Jul 8, 2012 at 9:08 PM

The range is from 0 to 255.  0 is full backwards.  255 is full forwards.  If you use one of the motor services, the range is -1.0 (full reverse) to +1.0 (full forwards).