Difference between pages "Order Of Operations" and "Creating an RBC file"

From ROBOTC API Guide
(Difference between pages)
Jump to: navigation, search
(Operations Level 8)
 
(Created page with "<yambe:breadcrumb self="Setting up NXT Bluetooth">NXT|NXT</yambe:breadcrumb> {| class="wikiText" |- |''For ROBOTC Bluetooth NXT ''functions'', see: NXT_Functions_Bluetooth...")
 
Line 1: Line 1:
{{DISPLAYTITLE: C Order of Operations}}
+
<yambe:breadcrumb self="Setting up NXT Bluetooth">NXT|NXT</yambe:breadcrumb>
<yambe:breadcrumb>General|General Programming</yambe:breadcrumb>
+
{{tl|1|}}
+
  
===Operations level 1===
+
 
{|class="wikitable"
+
{| class="wikiText"
 
|-
 
|-
! Operator !! Syntax !! Explanation
+
|''For ROBOTC Bluetooth NXT ''functions'', see: [[NXT_Functions_Bluetooth|NXT Bluetooth Functions]].''
|-
+
| ++ || x++ || a unary operator that increases the value of "x" by one
+
|-
+
| -- || x-- || A unary operator that decreases the value of "x" by one
+
 
|-
 
|-
 +
|''For information about Bluetooth and the NXT, see: [[NXT_Bluetooth_Overview|Bluetooth Overview]].''
 
|}
 
|}
 +
{{tl|1|}}
  
===Operations Level 2===
+
== What is an RBC file? ==
 
+
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;" width="100%" cellpadding="5%" cellspacing="0" border="0"
{|class="wikitable"
+
 
|-
 
|-
! Operator !! Syntax !! Explanation
+
|An RBC file is a special type of XML file that can be used with ROBOTC v3.52 or later. Once an RBC file is created properly, you will be able to configure ROBOTC's Platform Type, Compiler Target, Menu Level, and other important settings all with the click of a button. You can even configure the RBC program to load a user program and automatically download it to a robot or Virtual World of your choosing.
|-
+
| ++ || ++x || a unary operator that increases the value of "x" by one
+
|-
+
| -- || --x || A unary operator that decreases the value of "x" by one
+
|-
+
| + || +x || A unary operator that does ????????
+
|-
+
| - || -x || A unary operator that does ????????
+
|-
+
| ! || !x || A logical operator that returns a boolean value that is the opposite of "x" (If "x" is true, then "!x" returns false)
+
 
|-
 
|-
 
|}
 
|}
===Operations Level 3===
+
 
{|class="wikitable"
+
== How to create an RBC file ==
 +
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
|-
! Operator !! Syntax !! Explanation
+
|
|-
+
| / || a / b || An operator that returns the value of "a divided by b"
+
|-
+
| * || a * b || An operator that returns the value of "a multiplied by b"
+
|-
+
| % || a % b || An operator that returns the value of "the remainder of a divided by b"
+
 
|-
 
|-
 
|}
 
|}
===Operations Level 4===
+
 
{|class="wikitable"
+
== RBC File's XML parameters ==
|-
+
===XML Version===
! Operator !! Syntax !! Explanation
+
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;" width="100%" cellpadding="5%" cellspacing="0" border="0"
|-
+
| + || a + b || An operator that returns the value of "a plus b"
+
 
|-
 
|-
| - || a - b || An operator that returns the value of "a minus b"
+
| The XML Version parameter will identify the document as valid XML. This must always be at the top of the RBC document.
 +
*'''<?xml version="1.0" encoding="UTF-8"?>'''
 
|-
 
|-
 
|}
 
|}
===Operations Level 5===
+
===RBC Version===
{|class="wikitable"
+
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
|-
! Operator !! Syntax !! Explanation
+
| Identifies the current RBC specification being used.  As of today, this value should be specified as 1.0.0.
|-
+
*'''<RBCVersion>1.0.0</RBCVersion>'''
| / || a / b || An operator that returns the value of "a divided by b"
+
|-
+
| * || a * b || An operator that returns the value of "a multiplied by b"
+
|-
+
| % || a % b || An operator that returns the value of "the remainder of a divided by b"
+
 
|-
 
|-
 
|}
 
|}
 
+
===Platform Type===
===Operations Level 6===
+
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;" width="100%" cellpadding="5%" cellspacing="0" border="0"
{|class="wikitable"
+
|-
+
! Operator !! Syntax !! Explanation
+
|-
+
| >> || a >> b || A bitwise shift to the right ?????????
+
 
|-
 
|-
| << || a << b || A bitwise shift to the left ??????????
+
| Sets the platform type in ROBOTC. Requires the ROBOTC installation to have an appropriate license activated and valid in order to work properly.
 +
*'''<Platform>PlatformType</Platform>'''
 
|-
 
|-
 
|}
 
|}
===Operations Level 7===
+
===Compiler Mode===
Also known as "boolean operators" for returning boolean values
+
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
+
{|class="wikitable"
+
 
|-
 
|-
! Operator !! Syntax !! Explanation
+
| Sets ROBOTC’s compiler mode (Compiler Target) – used to switch between real robots, the PC-based emulator, and Virtual Worlds compiling targets.
|-
+
*'''<CompilerMode>CompilerTarget</CompilerMode>'''
| < || a < b || A logical statement that returns "true" if "a" is less than "b"
+
|-
+
| * || a <= b || A logical statement that returns "true" if "a" is less than or equal to "b"
+
|-
+
| > || a > b || A logical statement that returns "true" if "a" is greater than "b"
+
|-
+
| >= || a >= b || A logical statement that returns "true" if "a" is greater than or equal to "b"
+
 
|-
 
|-
 
|}
 
|}
===Operations Level 8===
+
===Cortex Download Method (VEX Cortex only)===
Also known as "boolean operators" for returning boolean values
+
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
+
{|class="wikitable"
+
|-
+
! Operator !! Syntax !! Explanation
+
|-
+
| == || a == b || A logical statement that returns "true" if "a" is equal to "b"
+
 
|-
 
|-
| != || a != b || A logical statement that returns "true" if "a" NOT equal to "b"
+
| Sets the Cortex Download Method – used to modify the cortex download method to allow the Cortex to either require a VEXnet/USB cable in order to run, or to allow “standalone” mode to run a user’s program without searching for a COMM link. If the Cortex is using the VEXNet system or will be physically tethered to a Joystick Controller using the USB A-to-A cable, the VEXNet option should be used. Otherwise, use the USB-Only mode
 +
*'''<CortexDLMethod>DownloadMode</CortexDLMethod>'''
 
|-
 
|-
 
|}
 
|}
 
+
===Virtual World Index===
===Operations Level 9===
+
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;" width="100%" cellpadding="5%" cellspacing="0" border="0"
{|class="wikitable"
+
 
|-
 
|-
! Operator !! Syntax !! Explanation
+
| Sets the numerical type of the RVW Level Pack Index that should be launched. – This is only a numerical number that references the RVW Level Pack “ID” number.
|-
+
*'''<VirtualWorldIndex>IndexNumber</VirtualWorldIndex>'''
| & || a & b || A bitwise operator AND ????????
+
 
|-
 
|-
 
|}
 
|}
===Operations Level 10===
+
===Compile and Download===
{|class="wikitable"
+
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;" width="100%" cellpadding="5%" cellspacing="0" border="0"
|-
+
! Operator !! Syntax !! Explanation
+
 
|-
 
|-
| ^ || a ^ b || A bitwise operator ExclusiveOR ????????
+
| Flag to specify if the source code should be “compiled” or “compiled and downloaded”. If set to “Yes”, the code will automatically be downloaded to the robot or Virtual World. Otherwise ("No", it will only be compiled.
 +
*'''<CompileAndDownload>Yes</CompileAndDownload>'''
 
|-
 
|-
 
|}
 
|}
===Operations Level 11===
+
===Menu Level===
{|class="wikitable"
+
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
|-
! Operator !! Syntax !! Explanation
+
| Sets the ROBOTC GUI Menu Level. Used to show/hide functionality by adjusting the menu level types (Basic, Advanced, and Super User)
|-
+
*'''<MenuLevel>Level</MenuLevel>'''
| <nowiki>|</nowiki> || <nowiki>a | b</nowiki> || A bitwise operator OR ????????
+
 
|-
 
|-
 
|}
 
|}
===Operations Level 12===
+
===RVW Parameters===
{|class="wikitable"
+
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;" width="100%" cellpadding="5%" cellspacing="0" border="0"
|-
+
! Operator !! Syntax !! Explanation
+
 
|-
 
|-
| && || a && b  || Returns "true" if both "a" and "b" are also true
+
| Command Line Parameters that will be passed the next time Robot Virtual Worlds is launched. If the “CompileAndDownload” flag is set to “NO”, these parameters will be stored for the next execution. After the Virtual Worlds has been executed once, these parameters are discarded.
 +
*'''<RVWParameters>parameter1 parameter2 parameter3</RVWParameters>'''
 
|-
 
|-
 
|}
 
|}
===Operations Level 13===
+
===Source File Name===
{|class="wikitable"
+
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
|-
! Operator !! Syntax !! Explanation
+
| Name of the file that will be saved/displayed on the ROBOTC tab-bar at compile time – Note this file only is used if SourceCode is provided.
|-
+
*'''<SourceFileName>Name_Of_Program.c</SourceFileName>'''
| <nowiki>||</nowiki> || <nowiki>a || b</nowiki> || Returns "true" if either "a" or "b" is true
+
 
|-
 
|-
 
|}
 
|}
===Operations Level 14===
+
===Circuit Board===
{|class="wikitable"
+
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
|-
! Operator !! Syntax !! Explanation
+
| This specifies the circuit board to be used. Has only real application with Arduino to differentiate between different board models (Uno,1280,2560,etc). Default value of blank (no value) for all other platforms.
|-
+
*'''<CircuitBoard></CircuitBoard>'''
| ?: || a ? b : c || Ternary operations: see [[Tertiary_operators]]
+
 
|-
 
|-
 
|}
 
|}
===Operations Level 15===
+
===Source Code===
{|class="wikitable"
+
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;" width="100%" cellpadding="5%" cellspacing="0" border="0"
|-
+
! Operator !! Syntax !! Explanation
+
|-
+
| = || a = b || Assigns the value of "b" to "a"
+
|-
+
| += || a += b || Assigns the value of "a + b" to "a"
+
|-
+
| -= || a -= b || Assigns the value of "a - b" to "a"
+
|-
+
| /= || a /= b || Assigns the value of "a / b" to "a"
+
|-
+
| *= || a *= b || Assigns the value of "a * b" to "a"
+
|-
+
| %= || a %= b || Assigns the value of "a % b" to "a"
+
|-
+
| <<= || a <<= b || Assigns the value of "a << b" to "a" ????????
+
|-
+
| >>= || a >>= b || Assigns the value of "a >> b" to "a" ????????
+
|-
+
| &= || a &= b || Assigns the value of "a & b" to "a" ?????????
+
|-
+
| ^= || a ^= b || Assigns the value of "a ^ b" to "a" ?????????
+
 
|-
 
|-
| <nowiki>|= </nowiki>|| <nowiki>a |= b</nowiki> || Assigns the value of <nowiki>"a |= b"</nowiki> to "a" ??????????
+
| Source Code of program to be open/compiled/downloaded. This is not a reference to an existing file but rather the actual contents of the file. Because the RBC file uses XML formatting, the file cannot contain any XML escape markups in the Source Code section. Instead, the escape markups must be replaced with the characters below:
 
|-
 
|-
 
|}
 
|}

Revision as of 20:24, 7 April 2014

NXT → Setting up NXT Bluetooth


For ROBOTC Bluetooth NXT functions, see: NXT Bluetooth Functions.
For information about Bluetooth and the NXT, see: Bluetooth Overview.

What is an RBC file?

An RBC file is a special type of XML file that can be used with ROBOTC v3.52 or later. Once an RBC file is created properly, you will be able to configure ROBOTC's Platform Type, Compiler Target, Menu Level, and other important settings all with the click of a button. You can even configure the RBC program to load a user program and automatically download it to a robot or Virtual World of your choosing.

How to create an RBC file

RBC File's XML parameters

XML Version

The XML Version parameter will identify the document as valid XML. This must always be at the top of the RBC document.
  • <?xml version="1.0" encoding="UTF-8"?>

RBC Version

Identifies the current RBC specification being used. As of today, this value should be specified as 1.0.0.
  • <RBCVersion>1.0.0</RBCVersion>

Platform Type

Sets the platform type in ROBOTC. Requires the ROBOTC installation to have an appropriate license activated and valid in order to work properly.
  • <Platform>PlatformType</Platform>

Compiler Mode

Sets ROBOTC’s compiler mode (Compiler Target) – used to switch between real robots, the PC-based emulator, and Virtual Worlds compiling targets.
  • <CompilerMode>CompilerTarget</CompilerMode>

Cortex Download Method (VEX Cortex only)

Sets the Cortex Download Method – used to modify the cortex download method to allow the Cortex to either require a VEXnet/USB cable in order to run, or to allow “standalone” mode to run a user’s program without searching for a COMM link. If the Cortex is using the VEXNet system or will be physically tethered to a Joystick Controller using the USB A-to-A cable, the VEXNet option should be used. Otherwise, use the USB-Only mode
  • <CortexDLMethod>DownloadMode</CortexDLMethod>

Virtual World Index

Sets the numerical type of the RVW Level Pack Index that should be launched. – This is only a numerical number that references the RVW Level Pack “ID” number.
  • <VirtualWorldIndex>IndexNumber</VirtualWorldIndex>

Compile and Download

Flag to specify if the source code should be “compiled” or “compiled and downloaded”. If set to “Yes”, the code will automatically be downloaded to the robot or Virtual World. Otherwise ("No", it will only be compiled.
  • <CompileAndDownload>Yes</CompileAndDownload>

Menu Level

Sets the ROBOTC GUI Menu Level. Used to show/hide functionality by adjusting the menu level types (Basic, Advanced, and Super User)
  • <MenuLevel>Level</MenuLevel>

RVW Parameters

Command Line Parameters that will be passed the next time Robot Virtual Worlds is launched. If the “CompileAndDownload” flag is set to “NO”, these parameters will be stored for the next execution. After the Virtual Worlds has been executed once, these parameters are discarded.
  • <RVWParameters>parameter1 parameter2 parameter3</RVWParameters>

Source File Name

Name of the file that will be saved/displayed on the ROBOTC tab-bar at compile time – Note this file only is used if SourceCode is provided.
  • <SourceFileName>Name_Of_Program.c</SourceFileName>

Circuit Board

This specifies the circuit board to be used. Has only real application with Arduino to differentiate between different board models (Uno,1280,2560,etc). Default value of blank (no value) for all other platforms.
  • <CircuitBoard></CircuitBoard>

Source Code

Source Code of program to be open/compiled/downloaded. This is not a reference to an existing file but rather the actual contents of the file. Because the RBC file uses XML formatting, the file cannot contain any XML escape markups in the Source Code section. Instead, the escape markups must be replaced with the characters below: