<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="http://forum.robosavvy.com/feed.php?f=5&amp;t=2415" />

<title>RoboSavvy Forum</title>
<subtitle>Robosavvy Forum: The largest online community of Humanoid Robot Builders</subtitle>
<link href="http://forum.robosavvy.com/index.php" />
<updated>2008-04-08T09:12:15+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=5&amp;t=2415</id>
<entry>
<author><name><![CDATA[markus]]></name></author>
<updated>2008-04-08T09:12:15+01:00</updated>
<published>2008-04-08T09:12:15+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2415&amp;p=15243#p15243</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2415&amp;p=15243#p15243"/>
<title type="html"><![CDATA[Usage USB2Dynamixel Bus Interfaces with C]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2415&amp;p=15243#p15243"><![CDATA[
It was just a copy&amp;past error. <br />Replace DWORD buff[] = { 0xff, 0xff, 0x9, 0x2, 0x1, 0xf3 }; <br />trough unsigned char buff[] = { 0xff, 0xff, 0x9, 0x2, 0x1, 0xf3 }; <br /><br />Thanks to all<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=975">markus</a> — Tue Apr 08, 2008 9:12 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[JonHylands]]></name></author>
<updated>2008-04-08T02:02:04+01:00</updated>
<published>2008-04-08T02:02:04+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2415&amp;p=15242#p15242</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2415&amp;p=15242#p15242"/>
<title type="html"><![CDATA[Usage USB2Dynamixel Bus Interfaces with C]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2415&amp;p=15242#p15242"><![CDATA[
It seems to me like you might be not waiting long enough. Stock AX-12 servos have a response delay of about 500 us before they even start sending back a response...<br /><br />- Jon<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=373">JonHylands</a> — Tue Apr 08, 2008 2:02 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Bullit]]></name></author>
<updated>2008-04-08T00:41:53+01:00</updated>
<published>2008-04-08T00:41:53+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2415&amp;p=15240#p15240</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2415&amp;p=15240#p15240"/>
<title type="html"><![CDATA[Usage USB2Dynamixel Bus Interfaces with C]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2415&amp;p=15240#p15240"><![CDATA[
While I haven't used the huv board explicitly I do use the same chip to communicate with my dynamixels with embedded linux on a gumstix.  I use ftdilib which for my solution has proved to have the lowest latency.<br /> <a href="http://www.intra2net.com/de/produkte/opensource/ftdi/" class="postlink">http://www.intra2net.com/de/produkte/opensource/ftdi/</a><br />I have looked into the D2XX drivers but the source isn't available for embedded projects.  From speaking to the folks at ftdi I think the D2XX driver has similar latency to the ftdilib that I use.  <br /><br />From looking at your code it seems to me that you are checking the status before the bytes come in.<br />Shouldn't you be using some thing like<br />dwRxSize = 0;<br />while ((dwRxSize &lt; BUF_SIZE) &amp;&amp; (ftStatus == FT_OK)) <br />     {<br />     ftStatus = FT_GetQueueStatus(ftHandle[i], &amp;dwRxSize);<br />     }<br />This is from one of the examples that comes with the d2xx linux driver.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=173">Bullit</a> — Tue Apr 08, 2008 12:41 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[markus]]></name></author>
<updated>2008-04-05T21:31:22+01:00</updated>
<published>2008-04-05T21:31:22+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=2415&amp;p=15209#p15209</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=2415&amp;p=15209#p15209"/>
<title type="html"><![CDATA[Usage USB2Dynamixel Bus Interfaces with C]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=2415&amp;p=15209#p15209"><![CDATA[
Hallo,<br /><br />i bought the USB2Dynamixel interface from <!-- m --><a class="postlink" href="http://www.huvrobotics.com">http://www.huvrobotics.com</a><!-- m -->.<br />Now i try to connect to a AX12 from a linux pc with C. <br /><br />I installed the D2XX Driver from <!-- m --><a class="postlink" href="http://www.ftdichip.com">http://www.ftdichip.com</a><!-- m --> and wrote a little program to test in C.<br /><br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>#include &lt;stdio&gt;<br />#include &lt;stdlib&gt;<br />#include &lt;string&gt;<br />#include &quot;ftd2xx.h&quot;<br /><br />int main &#40;int argc, char * const argv&#91;&#93;&#41; <br />&#123;<br />    FT_STATUS   ftStatus;<br />    FT_HANDLE ftHandle;<br />    <br />    char deviceid&#91;&#93; = &quot;A4004t6d&quot;;<br />    <br />    ftStatus = FT_OpenEx&#40;deviceid, FT_OPEN_BY_SERIAL_NUMBER, &amp;ftHandle&#41;;<br />    if&#40; ftStatus != FT_OK &#41;&#123;<br />         printf&#40;&quot;Error FT_OpenEx&#40;%d&#41;\n&quot;, ftStatus&#41;;<br />         return -1;<br />    &#125;<br /><br />    printf&#40;&quot;Opened device %s\n&quot;, deviceid&#41;;<br />    <br />    ftStatus = FT_SetBaudRate&#40;ftHandle, 1000000&#41;;<br />    if&#40; ftStatus != FT_OK &#41;&#123;<br />      printf&#40;&quot;Error FT_SetBaudRate&#40;%d&#41;\n&quot;, ftStatus&#41;;<br />    &#125;<br />    <br />    ftStatus = FT_SetDataCharacteristics&#40;ftHandle, FT_BITS_8, FT_STOP_BITS_1, FT_PARITY_NONE&#41;;<br />    if&#40; ftStatus != FT_OK &#41;&#123;<br />      printf&#40;&quot;Error FT_SetDataCharacteristics&#40;%d&#41;\n&quot;, ftStatus&#41;;<br />    &#125;<br /><br />    ftStatus = FT_SetFlowControl&#40;ftHandle, FT_FLOW_NONE, 0, 0&#41;;<br />    if&#40; ftStatus != FT_OK &#41;&#123;<br />      printf&#40;&quot;Error FT_SetFlowControl&#40;%d&#41;\n&quot;, ftStatus&#41;;<br />    &#125;    <br /><br />    // &#40;FT_HANDLE ftHandle, DWORD dwReadTimeout, DWORD dwWriteTimeout&#41; <br />    ftStatus = FT_SetTimeouts&#40;ftHandle,1000,1000&#41;;<br />    if&#40; ftStatus != FT_OK &#41;&#123;<br />      printf&#40;&quot;Error FT_SetTimeouts&#40;%d&#41;\n&quot;, ftStatus&#41;;<br />    &#125;  <br /><br />    DWORD buff&#91;&#93; = &#123; 0xff, 0xff, 0x9, 0x2, 0x1, 0xf3 &#125;;<br />    DWORD written;<br />    DWORD len = 6;<br />    ftStatus = FT_Write&#40;ftHandle, buff, len, &amp;written&#41;;<br />    <br />    if&#40; ftStatus != FT_OK &#41;&#123;<br />      printf&#40;&quot;Error FT_Write&#40;%d&#41;\n&quot;, ftStatus&#41;;<br />    &#125;  <br />    <br />    printf&#40;&quot;Bytes written: %i\n&quot;, written&#41;;<br /><br />    DWORD EventDWord; <br />    DWORD TxBytes, RxBytes; <br />    DWORD BytesReceived; <br />    char RxBuffer&#91;256&#93;; <br />    FT_GetStatus&#40;ftHandle,&amp;RxBytes,&amp;TxBytes,&amp;EventDWord&#41;;<br />    printf&#40;&quot;RxBytes: %i\n&quot;, RxBytes&#41;;<br />    printf&#40;&quot;TxBytes: %i\n&quot;, TxBytes&#41;;<br />    if &#40;RxBytes &gt; 0&#41; &#123; <br />      ftStatus = FT_Read&#40;ftHandle,RxBuffer,RxBytes,&amp;BytesReceived&#41;; <br />      if &#40;ftStatus == FT_OK&#41; &#123; <br />        for&#40;int i=0; i&lt;RxBytes; i++&#41;&#123;<br />          printf&#40;&quot;0x%x &quot;, RxBuffer&#91;i&#93;&#41;;<br />        &#125;<br />        printf&#40;&quot;\n&quot;&#41;;<br />      &#125; <br />      else &#123; <br />        printf&#40;&quot;Error FT_Read&#40;%d&#41;\n&quot;, ftStatus&#41;; <br />      &#125; <br />    &#125;  <br /><br />    FT_Close&#40;ftHandle&#41;;<br />    return 0;<br />&#125;<br /></code></dd></dl><br /><br />This should pring the AX12 with ID 9, but i get no response:<br /><blockquote class="uncited"><div><br />Opened device A4004t6d<br />Bytes written: 6<br />RxBytes: 0<br />TxBytes: 0<br /></div></blockquote><br /><br />Is anyone else using this board with C/C++?<br /><br />Thanks for help<br />Markus<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=975">markus</a> — Sat Apr 05, 2008 9:31 pm</p><hr />
]]></content>
</entry>
</feed>