| 1 | <html> |
|---|
| 2 | <head> |
|---|
| 3 | <title>Command Layer Structure</title> |
|---|
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
|---|
| 5 | <link type="text/css" rel="stylesheet" href="../style.css"> |
|---|
| 6 | </head> |
|---|
| 7 | |
|---|
| 8 | <body bgcolor="#FFFFFF" text="#000001"> |
|---|
| 9 | <p class="header">RWTH - Mindstorms NXT Toolbox</p> |
|---|
| 10 | <p align="center"> |
|---|
| 11 | <h1>Command Layer Structure</h1> |
|---|
| 12 | </p> |
|---|
| 13 | <hr> |
|---|
| 14 | <p> |
|---|
| 15 | The functions of the RWTH - Mindstorms NXT Toolbox can be categorized into a multiple layer structure. On the lowest layer <b>Low Level and Helper Functions</b> are available, |
|---|
| 16 | which mostly convert parameter modes to bytes words, determined by the LEGO direct commands documentation. The second layer includes <b>Direct NXT Commands</b> which are mapped |
|---|
| 17 | from the LEGO direct command documentation without any limitations and can be identified by the <tt>NXT_*</tt> prefix. Also Bluetooth packet related functions can be found |
|---|
| 18 | in this layer. Layer 3 provides <b>High Level Functions</b> for controlling the NXT motors, sensors and the Bluetooth connection. These functions are basically using the |
|---|
| 19 | Direct NXT Commands of layer 2 to make the motor and sensor controlling more convenient and easily readable for the user. The top layer provides <b>High Level Regulation</b> |
|---|
| 20 | functions for precise motor regulation and various utilities. |
|---|
| 21 | </p> |
|---|
| 22 | |
|---|
| 23 | <br><br> |
|---|
| 24 | <table border="2" cellpadding="10" align="center"> |
|---|
| 25 | |
|---|
| 26 | <tr bgcolor="#80FFFF"> |
|---|
| 27 | <td align="center"><b>Layer</b></td> |
|---|
| 28 | <td><b>Description</b></td> |
|---|
| 29 | <td valign="top"><b>Output/Motors</b></td> |
|---|
| 30 | <td valign="top"><b>Input/Sensors</b></td> |
|---|
| 31 | <td valign="top"><b>General</b></td> |
|---|
| 32 | <td valign="top"><b>Bluetooth / USB</b></td> |
|---|
| 33 | </tr> |
|---|
| 34 | |
|---|
| 35 | <!-- Layer 4 --> |
|---|
| 36 | <tr bgcolor="#B5F1B4"> |
|---|
| 37 | <td align="center" width="40"><b>4</b></td> |
|---|
| 38 | <td><b>High Level Regulation / Utilities</b></td> |
|---|
| 39 | <td valign="top"><b>MotorRotateAbs</b> (o)<br><br><b>WaitForMotor</b> (o)</td> |
|---|
| 40 | <td valign="top"> </td> |
|---|
| 41 | <td valign="top"><b>OptimizeToolboxPerformance</b></td> |
|---|
| 42 | <td valign="top"><b>COM_MakeBTConfigFile</b></td> |
|---|
| 43 | </tr> |
|---|
| 44 | |
|---|
| 45 | <!-- Layer 3 --> |
|---|
| 46 | <tr bgcolor="#FFFF80"> |
|---|
| 47 | <th align="center" rowspan="2"><b>3</b></th> |
|---|
| 48 | <th align="left" rowspan="2"><b>High Level Functions</b></th> |
|---|
| 49 | <td align="left" valign="top"><b>NXTmotor</b><br>ReadFromNXT<br>SendToNXT<br>Stop<br>WaitFor<br>ResetPosition<br><br><b>NXC_MotorControl</b></td> |
|---|
| 50 | <th align="left" valign="top" rowspan="2"><b>OpenLight<br>OpenSound<br>OpenSwitch<br>OpenUltrasonic<br>OpenAccelerator<br>OpenInfrared<br>OpenCompass<br><br>GetLight<br>GetSound<br>GetSwitch<br>GetAccelerator<br>GetInfrared<br>GetUltrasonic</b><br>USMakeSnapshot<br>USGetSnapshotResults<br><b>GetCompass</b><br>CalibrateCompass<br><br><b>CloseSensor</b></th> |
|---|
| 51 | <th align="left" valign="top" rowspan="2">readFromIniFile<br><br>MAP_GetCommModule<br>MAP_GetInputModule<br>MAP_GetOutputModule<br>MAP_GetSoundModule<br>MAP_GetUIModule<br><br>MAP_SetOutputModule</th> |
|---|
| 52 | <th align="left" valign="top" rowspan="2"><b>COM_OpenNXT</b><br>COM_OpenNXTEx<br><br><b>COM_CloseNXT</b><br><br><b>COM_ReadI2C</b><br></th> |
|---|
| 53 | </tr> |
|---|
| 54 | <tr bgcolor="#FFFF80"> |
|---|
| 55 | <td align="left" valign="top"><b>SendMotorSettings</b> (o)<br>SetMotor (o)<br>SetPower (o)<br>SetAngleLimit (o)<br>SetRampMode (o)<br>SpeedRegulation (o)<br>SyncToMotor (o)<br><br><b>StopMotor</b><br><br><b>GetMotorSettings</b> (o)<br>GetMotor (o)<br><br><b>ResetMotorAngle</b> (o)<br><br><b>SwitchLamp</b><br><br>SetMemoryCount (o)<br>GetMemoryCount (o)</td> |
|---|
| 56 | </tr> |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | <!-- Layer 2 --> |
|---|
| 60 | <tr bgcolor="#F5BB80"> |
|---|
| 61 | <td align="center"><b>2</b></td> |
|---|
| 62 | <td><b>Direct NXT Commands</b></td> |
|---|
| 63 | <td valign="top"><b>NXT_SetOutputState<br><br>NXT_GetOutputState<br><br>NXT_ResetMotorPosition</b></td> |
|---|
| 64 | <td valign="top"><b>NXT_SetInputMode<br><br>NXT_GetInputValues</b><br><br>NXT_ResetInputScaledValue<br><br>NXT_LSRead<br>NXT_LSWrite<br>NXT_LSGetStatus</td> |
|---|
| 65 | <td valign="top"><b>NXT_PlayTone</b><br>NXT_PlaySoundFile<br>NXT_StopSoundPlayback<br><br>NXT_StartProgram<br>NXT_StopProgram<br><br>NXT_SendKeepAlive<br>NXT_GetBatteryLevel<br>NXT_GetFirmwareVersion<br>NXT_SetBrickName<br><br>NXT_ReadIOMap<br>NXT_WriteIOMap<br><br>NXT_MessageWrite<br></td> |
|---|
| 66 | <td valign="top">COM_CreatePacket<br>COM_SendPacket<br>COM_CollectPacket<br><br>COM_SetDefaultNXT<br>COM_GetDefaultNXT<br></td> |
|---|
| 67 | </tr> |
|---|
| 68 | |
|---|
| 69 | <!-- Layer 1 --> |
|---|
| 70 | <tr bgcolor="#FF80FF"> |
|---|
| 71 | <td align="center"><b>1</b></td> |
|---|
| 72 | <td><b>Low Level Functions:<br>Helper, Conversion and<br> Lookup Functions</b></td> |
|---|
| 73 | <td valign="top">MOTOR_A<br>MOTOR_B<br>MOTOR_C<br><br><i>byte2outputmode<br>byte2regmode<br>byte2runstate<br>outputmode2byte<br>regmode2byte<br>runstate2byte</i><br><br><i>initializeGlobalMotorStateVar</i> (o)<br><i>resetMotorRegulation</i> (o)</td> |
|---|
| 74 | <td valign="top">SENSOR_1<br>SENSOR_2<br>SENSOR_3<br>SENSOR_4<br><br><i>byte2sensortype<br>byte2sensormode<br>sensortype2byte<br>sensormode2byte</i></td> |
|---|
| 75 | <td valign="top">DebugMode<br><i>isdebug</i><br><br>textOut<br><br>tictic (o)<br>toctoc (o)<br><br><i>dec2wordbytes<br>name2commandbytes<br>commandbyte2name<br>wordbytes2dec</i></td> |
|---|
| 76 | <td valign="top">checkStatusByte<br><br><i>createHandleStruct</i><br><i>checkHandleStruct</i><br><br><i>getLibusbErrorString</i><br><i>getVISAErrorString</i><br><i>getReplyLengthFromCmdByte</i><br><br><i>fantom_proto</i><br><i>libusb_proto</i></td> |
|---|
| 77 | </tr> |
|---|
| 78 | |
|---|
| 79 | <!-- Legend --> |
|---|
| 80 | <tr> |
|---|
| 81 | <td colspan="6" >legend: NXT_* = NXT Direct commands without any limitations (mapped to the LEGO direct command documentation)<br> |
|---|
| 82 | |
|---|
| 83 | COM_* = Functions related to the NXT communication<br> |
|---|
| 84 | |
|---|
| 85 | MAP_* = Functions related to the NXT module maps<br> |
|---|
| 86 | |
|---|
| 87 | <b>bold</b> = Main funcions or main group functions<br> |
|---|
| 88 | |
|---|
| 89 | <i>italic</i> = private functions<br> |
|---|
| 90 | |
|---|
| 91 | (o) = obsolete functions (will be removed in a future release) |
|---|
| 92 | </td> |
|---|
| 93 | </tr> |
|---|
| 94 | </table> |
|---|
| 95 | <br><br> |
|---|
| 96 | |
|---|
| 97 | <!-- </font> --> |
|---|
| 98 | |
|---|
| 99 | |
|---|
| 100 | </body> |
|---|
| 101 | </html> |
|---|