| 1 | |
|---|
| 2 | <!DOCTYPE html |
|---|
| 3 | PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"> |
|---|
| 4 | <html xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd"> |
|---|
| 5 | <head> |
|---|
| 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
|---|
| 7 | |
|---|
| 8 | <!-- |
|---|
| 9 | This HTML is auto-generated from an M-file. |
|---|
| 10 | To make changes, update the M-file and republish this document. |
|---|
| 11 | --> |
|---|
| 12 | <title>NXT_SetOutputState</title> |
|---|
| 13 | <meta name="generator" content="MATLAB 7.5"> |
|---|
| 14 | <meta name="date" content="2008-07-19"> |
|---|
| 15 | <meta name="m-file" content="script_NXT_SetOutputState"> |
|---|
| 16 | <link type="text/css" rel="stylesheet" href="../../style.css"> |
|---|
| 17 | </head> |
|---|
| 18 | <body> |
|---|
| 19 | <p class="header">RWTH - Mindstorms NXT Toolbox</p> |
|---|
| 20 | <div class="content"> |
|---|
| 21 | <h1>NXT_SetOutputState</h1> |
|---|
| 22 | <introduction> |
|---|
| 23 | <p>Sends previously specified settings to current active motor.</p> |
|---|
| 24 | </introduction> |
|---|
| 25 | <h2>Contents</h2> |
|---|
| 26 | <div> |
|---|
| 27 | <ul> |
|---|
| 28 | <li><a href="#1">Syntax</a></li> |
|---|
| 29 | <li><a href="#3">Description</a></li> |
|---|
| 30 | <li><a href="#5">Example</a></li> |
|---|
| 31 | <li><a href="#6">See also</a></li> |
|---|
| 32 | <li><a href="#7">Signature</a></li> |
|---|
| 33 | </ul> |
|---|
| 34 | </div> |
|---|
| 35 | <h2>Syntax<a name="1"></a></h2> |
|---|
| 36 | <p><tt>status = NXT_SetOutputState(port, power, IsMotorOn, IsBrake, RegModeName, TurnRatio, RunStateName, TachoLimit, ReplyMode)</tt></p> |
|---|
| 37 | <p><tt>status = NXT_SetOutputState(port, power, IsMotorOn, IsBrake, RegModeName, TurnRatio, RunStateName, TachoLimit, ReplyMode, |
|---|
| 38 | handle)</tt></p> |
|---|
| 39 | <h2>Description<a name="3"></a></h2> |
|---|
| 40 | <p><tt>status = NXT_SetOutputState(OutputPort, Power, IsMotorOn, IsBrake, RegModeName, TurnRatio, RunStateName, TachoLimit, ReplyMode)</tt> sends the given settings like motor <tt>port</tt> (<tt>MOTOR_A</tt>, <tt>MOTOR_B</tt> or <tt>MOTOR_C</tt>), the <tt>power</tt> (<tt>-100...100</tt>, the <tt>IsMotorOn</tt> boolean flag, the <tt>IsBrake</tt> boolean flag, the regulation mode name <tt>RegModeName</tt> (<tt>'IDLE'</tt>, <tt>'SYNC'</tt>, <tt>'SPEED'</tt>), the <tt>TurnRatio</tt> (<tt>-100...100</tt>), the <tt>RunStateName</tt> (<tt>'IDLE'</tt>, <tt>'RUNNING'</tt>, <tt>'RAMUP'</tt>, <tt>'RAMPDOWN'</tt>), the <tt>TachoLimit</tt> (angle limit) in degrees, and the <tt>ReplyMode</tt>. By the <tt>ReplyMode</tt> one can request an acknowledgement for the packet transmission. The two strings <tt>'reply'</tt> and <tt>'dontreply'</tt> are valid. The return value <tt>status</tt> indicates if an error occures by the packet transmission. |
|---|
| 41 | </p> |
|---|
| 42 | <p><tt>status = NXT_SetOutputState(OutputPort, Power, IsMotorOn, IsBrake, RegModeName, TurnRatio, RunStateName, TachoLimit, ReplyMode, |
|---|
| 43 | handle)</tt> uses the given NXT connection <tt>handle</tt>. This should be a serial handle on a PC system and a file handle on a Linux system. |
|---|
| 44 | </p> |
|---|
| 45 | <h2>Example<a name="5"></a></h2><pre class="codeinput"> NXT_SetOutputState(MOTOR_A,80,1,1,<span class="string">'SPEED'</span>,0,<span class="string">'RUNNING'</span>,360,<span class="string">'dontreply'</span>); |
|---|
| 46 | </pre><h2>See also<a name="6"></a></h2> |
|---|
| 47 | <p><a href="SendMotorSettings.html">SendMotorSettings</a>, <a href="NXT_GetOutputState.html">NXT_GetOutputState</a>, <a href="GetMotorSettings.html">GetMotorSettings</a>, <a href="MOTOR_A.html">MOTOR_A</a>, <a href="MOTOR_B.html">MOTOR_B</a>, <a href="MOTOR_C.html">MOTOR_C</a></p> |
|---|
| 48 | <h2>Signature<a name="7"></a></h2> |
|---|
| 49 | <div> |
|---|
| 50 | <ul> |
|---|
| 51 | <li><b>Author:</b> Linus Atorf (see AUTHORS) |
|---|
| 52 | </li> |
|---|
| 53 | <li><b>Date:</b> 2007/10/15 |
|---|
| 54 | </li> |
|---|
| 55 | <li><b>Copyright:</b> 2007-2008, RWTH Aachen University |
|---|
| 56 | </li> |
|---|
| 57 | </ul> |
|---|
| 58 | </div> |
|---|
| 59 | <p class="footer"><br> |
|---|
| 60 | Published with wg_publish; V1.0<br></p> |
|---|
| 61 | </div> |
|---|
| 62 | <!-- |
|---|
| 63 | ##### SOURCE BEGIN ##### |
|---|
| 64 | %% NXT_SetOutputState |
|---|
| 65 | % Sends previously specified settings to current active motor. |
|---|
| 66 | %% |
|---|
| 67 | %% Syntax |
|---|
| 68 | % |status = NXT_SetOutputState(port, power, IsMotorOn, IsBrake, RegModeName, TurnRatio, RunStateName, TachoLimit, ReplyMode)| |
|---|
| 69 | %% |
|---|
| 70 | % |status = NXT_SetOutputState(port, power, IsMotorOn, IsBrake, RegModeName, TurnRatio, RunStateName, TachoLimit, ReplyMode, handle)| |
|---|
| 71 | %% |
|---|
| 72 | %% Description |
|---|
| 73 | % |status = NXT_SetOutputState(OutputPort, Power, IsMotorOn, IsBrake, RegModeName, TurnRatio, |
|---|
| 74 | % RunStateName, TachoLimit, ReplyMode)| sends the given settings like motor |port| (|MOTOR_A|, |
|---|
| 75 | % |MOTOR_B| or |MOTOR_C|), the |power| (|-100...100|, the |IsMotorOn| boolean flag, the |IsBrake| |
|---|
| 76 | % boolean flag, the regulation mode name |RegModeName| (|'IDLE'|, |'SYNC'|, |'SPEED'|), the |
|---|
| 77 | % |TurnRatio| (|-100...100|), the |RunStateName| (|'IDLE'|, |'RUNNING'|, |'RAMUP'|, |'RAMPDOWN'|), |
|---|
| 78 | % the |TachoLimit| (angle limit) in degrees, and the |ReplyMode|. By the |ReplyMode| one can request |
|---|
| 79 | % an acknowledgement for the packet transmission. The two strings |'reply'| and |'dontreply'| are |
|---|
| 80 | % valid. The return value |status| indicates if an error occures by the packet transmission. |
|---|
| 81 | %% |
|---|
| 82 | % |status = NXT_SetOutputState(OutputPort, Power, IsMotorOn, IsBrake, RegModeName, TurnRatio, |
|---|
| 83 | % RunStateName, TachoLimit, ReplyMode, handle)| uses the given NXT connection |handle|. |
|---|
| 84 | % This should be a serial handle on a PC system and a file handle on a Linux system. |
|---|
| 85 | %% |
|---|
| 86 | %% Example |
|---|
| 87 | NXT_SetOutputState(MOTOR_A,80,1,1,'SPEED',0,'RUNNING',360,'dontreply'); |
|---|
| 88 | %% |
|---|
| 89 | %% See also |
|---|
| 90 | % SendMotorSettings, NXT_GetOutputState, GetMotorSettings, MOTOR_A, MOTOR_B, MOTOR_C |
|---|
| 91 | %% |
|---|
| 92 | %% Signature |
|---|
| 93 | %% |
|---|
| 94 | % * *Author:* Linus Atorf (see AUTHORS) |
|---|
| 95 | % * *Date:* 2007/10/15 |
|---|
| 96 | % * *Copyright:* 2007-2008, RWTH Aachen University |
|---|
| 97 | % |
|---|
| 98 | |
|---|
| 99 | ##### SOURCE END ##### |
|---|
| 100 | --> |
|---|
| 101 | </body> |
|---|
| 102 | </html> |
|---|