<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PlaceType" /><o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PlaceName" /><o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place" /><o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName" /><!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]--><style>
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
@page Section1
{size:21.0cm 842.0pt;
margin:2.0cm 2.0cm 2.0cm 2.0cm;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang="EN-GB" link="blue" vlink="purple" style="word-wrap: break-word;
-webkit-nbsp-mode: space;-webkit-line-break: after-white-space">
<div class="Section1">
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">Hi,<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">We use the EL6021 module using RS422 mode.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">The PDO structures below look the same as what we've got. Other configuration (for RS422 mode) we set is:<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">0x8000:02
</span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings;
color:navy">à</span></font><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> 0 (= disable
XON/XOFF support for tx)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">0x8000:03
</span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings;
color:navy">à</span></font><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> 0 (= disable
XON/XOFF support for rx)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">0x8000:06
</span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings;
color:navy">à</span></font><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> 0 (= full duplex)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">0x8000:07
</span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings;
color:navy">à</span></font><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"> 1 (= RS422)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">You can also connect wires between the RX and TX channels on the module to loop back to the module itself.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">On Startup:<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">- do the usual ecrt_master_slave_config(), ecrt_slave_config_pdos() calls<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">- use ecrt_slave_config_reg_pdo_entry() to connect to each of the Control word, Write data, Status word & Read data<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">- I also use a couple of SDO state machines for 0x8000:11 (baud rate) and 0x8000:15 (data frame) so that these can be set by the user
at runtime<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">I have 3 state machines that control the reading/writing of the port data
<st1:place w:st="on">Main</st1:place>, Read & Write<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><st1:place w:st="on"><st1:PlaceName w:st="on"><b><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;
color:navy;font-weight:bold">Main</span></font></b></st1:PlaceName><b><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;
color:navy;font-weight:bold">
<st1:PlaceType w:st="on">State</st1:PlaceType></span></font></b></st1:place><b><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;
color:navy;font-weight:bold"> Machine<o:p></o:p></span></font></b></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">0 - STANDBY<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> reset m_connected<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> wait for m_connect = true
</span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings;color:navy">à</span></font><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:
"Courier New";color:navy"> 1<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">1 - SET CONFIG<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> set baud rate and data frame via SDO's<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> wait for Status.InitAccepted (SW.2) = false
</span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings;color:navy">à</span></font><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:
"Courier New";color:navy"> 2<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">2 - APPLY CONFIG<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> set Control.InitRequest (CW.2)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> wait for Status.InitAccepted (SW.2) = true
</span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings;color:navy">à</span></font><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:
"Courier New";color:navy"> 3<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">3 - CONFIGURED<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> clear Control.InitRequest (CW.2)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> clear Control.TransmitRequest (CW.0)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> clear Control.ReceiveAccepted (CW.1)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> reset m_transmitAccepted<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> reset m_receiveRequest<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> wait for Status.InitAccepted (SW.2) = false
</span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings;color:navy">à</span></font><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:
"Courier New";color:navy"> 4<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">4 - READY<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> set m_connected<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> wait for m_connect = false
</span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings;color:navy">à</span></font><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:
"Courier New";color:navy"> 0<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><st1:place w:st="on"><st1:PlaceName w:st="on"><b><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;
color:navy;font-weight:bold">Read</span></font></b></st1:PlaceName><b><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;
color:navy;font-weight:bold">
<st1:PlaceType w:st="on">State</st1:PlaceType></span></font></b></st1:place><b><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;
color:navy;font-weight:bold"> Machine<o:p></o:p></span></font></b></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">0 - STANDBY<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> wait for m_connected = true
</span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings;color:navy">à</span></font><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:
"Courier New";color:navy"> 1<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">1 - READY<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> wait for
<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> {<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> if m_connected = false
</span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings;color:navy">à</span></font><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:
"Courier New";color:navy"> 0<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> if m_receiveRequest != Status.ReceiveRequest (SW.1)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> {<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> set m_receiveRequest = Status.ReceiveRequest (SW.1)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> </span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:
Wingdings;color:navy">à</span></font><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";
color:navy">
2<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> }<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> if Status.ReceiveBufferFull (SW.3)
</span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings;color:navy">à</span></font><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:
"Courier New";color:navy"> 2<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> }<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">2 - READ DATA<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> cnt = Status.ReceiveCount (SW.8..SW.15)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> for (i = 0; i < cnt; i++)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> {<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> if (m_readCnt >= COMM_PORT_BUFF_SIZE)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> {<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> m_readErrors++<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> break;<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> }<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> idx = (m_readIdx + m_readCnt) % COMM_PORT_BUFF_SIZE<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> m_readData[idx] = ReceiveChar[i]<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> m_readCnt++<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> }<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> set Control.ReceiveAccepted (CW.1) = ! Control.ReceiveAccepted (CW.1)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">
</span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:
Wingdings;color:navy">à</span></font><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";
color:navy">
1<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><st1:place w:st="on"><st1:PlaceName w:st="on"><b><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;
color:navy;font-weight:bold">Write</span></font></b></st1:PlaceName><b><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;
color:navy;font-weight:bold">
<st1:PlaceType w:st="on">State</st1:PlaceType></span></font></b></st1:place><b><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;
color:navy;font-weight:bold"> Machine<o:p></o:p></span></font></b></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">0 - STANDBY<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> wait for m_connected = true
</span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings;color:navy">à</span></font><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:
"Courier New";color:navy">1<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">1 - READY<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> wait for<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> {<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> if m_connected = false
</span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings;color:navy">à</span></font><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:
"Courier New";color:navy"> 0<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> if m_writeCnt > 0
</span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings;color:navy">à</span></font><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:
"Courier New";color:navy"> 2<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> }<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">2 - WR<st1:PersonName w:st="on">IT</st1:PersonName>E DATA<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> cnt = min(m_writeCnt, 22)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> set Control.TransmitCount (CW.8..CW..15) = cnt<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> for (i = 0; i < cnt; i++)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> {<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> TransmitChar[i] = m_writeData[m_writeIdx]<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> m_writeIdx = (m_writeIdx + 1) % COMM_PORT_BUFF_SIZE<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> m_writeCnt--<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> }<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> set Control.TransmitRequest (CW.0) = ! Control.TransmitRequest (CW.0)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> wait for<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> {<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> if (TIME_IN_STEP > 1 second)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> {<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> set Control.TransmitRequest (CW.0) = ! Control.TransmitRequest (CW.0)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> reset TIME_IN_STEP<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> }<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> if m_connect = false
</span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:Wingdings;color:navy">à</span></font><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:
"Courier New";color:navy"> 0<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> if m_transmitAccepted != Status.TransmitAccepted (SW.0)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> {<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> m_transmitAccepted != m_transmitAccepted<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> </span></font><font size="2" color="navy" face="Wingdings"><span style="font-size:10.0pt;font-family:
Wingdings;color:navy">à</span></font><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";
color:navy">
1<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> }<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"> }<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">Variables:<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">bool m_connect<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">bool m_connected<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">bool m_transmitAccepted<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">bool m_receiveRequest<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">int m_readCnt<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">int m_readErrors<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">int m_readIdx<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">int m_readCnt<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">char m_readData[COMM_PORT_BUFF_SIZE]<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">int m_writeIdx<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">int m_writeCnt<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Courier New"><span style="font-size:10.0pt;font-family:"Courier New";color:navy">char m_writeData[COMM_PORT_BUFF_SIZE]<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">COMM_PORT_BUFF_SIZE is the size of your buffers that you are reading the data into and writing from.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">So in summary:<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">Open the connection:<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">- initialise the parameters by setting Control.InitRequest (CW.2) and waiting for Status.InitAccepted (SW.2)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">- reset Control.InitRequest (CW.2) and waiting for Status.InitAccepted (SW.2) to be reset then your good to go<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">To write data:<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">- set Control.TransmitCount (CW.8..CW..15) with the number of bytes you are going to write<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">- set the characters (up to max of 22 chars)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">- toggle Control.TransmitRequest (CW.0)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">- wait for Status.TransmitAccepted (SW.0) to be toggled<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">To read data:<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">- wait for Status.ReceiveRequest (SW.1) to be toggled (or buffer full, Status.ReceiveBufferFull (SW.3))<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">- get Status.ReceiveCount (SW.8..SW.15)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">- read the characters (making sure you don't full up your buffer)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">- toggle Control.ReceiveAccepted (CW.1)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">Hopefully this helps,<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">Graeme.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p> </o:p></span></font></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12.0pt">
<hr size="2" width="100%" align="center" tabindex="-1">
</span></font></div>
<p class="MsoNormal"><b><font size="2" face="Tahoma"><span lang="EN-US" style="font-size:10.0pt;font-family:Tahoma;font-weight:bold">From:</span></font></b><font size="2" face="Tahoma"><span lang="EN-US" style="font-size:10.0pt;font-family:Tahoma"> etherlab-users-bounces@etherlab.org
[mailto:etherlab-users-bounces@etherlab.org] <b><span style="font-weight:bold">On Behalf Of
</span></b>Derrill Vezina<br>
<b><span style="font-weight:bold">Sent:</span></b> Friday, 23 May 2014 06:43<br>
<b><span style="font-weight:bold">To:</span></b> <st1:PersonName w:st="on">etherlab-users@etherlab.org</st1:PersonName><br>
<b><span style="font-weight:bold">Subject:</span></b> [etherlab-users] Beckhoff EL6001/EL6021 Issues</span></font><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><o:p> </o:p></span></font></p>
<div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt">Has anyone implemented the Beckhoff EL6001 RS232 and EL6021 Modbus interfaces with the etherlab 1.5.2 master? I am having some trouble with both of the devices and I
think the same issue is happening with both modules.<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt">I am able to initialize each of the devices using the ctrl and status register bits doing the initialization sequence. Also, I can set 4073, 4074, 4075 SDO registers
for configuration on the port with setting the baud rate, data frame, etc.. <o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt">Where I am failing is to actually send out the data. Using the structure output from the ethercat tool in the ethercat 1.5.2 / tool folder, I get the following for PDO
outputs:<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><o:p> </o:p></span></font></p>
</div>
<div>
<div>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">// EL6021 PDO entries<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" color="#006141" face="Times New Roman"><span style="font-size:7.0pt;color:#006141">ec_pdo_entry_info_t</span></font><font size="1"><span style="font-size:7.0pt"> EL60XX_pdo_entries[] = {<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x01, 16},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* <u>Ctrl</u> */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x02, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 0 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x03, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 1 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x04, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 2 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x05, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 3 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x06, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 4 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x07, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 5 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x08, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 6 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x09, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 7 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x0a, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 8 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x0b, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 9 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x0c, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 10 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x0d, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 11 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x0e, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 12 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x0f, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 13 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x10, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 14 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x11, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 15 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x12, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 16 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x13, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 17 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x14, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 18 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x15, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 19 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x16, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 20 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3003, 0x17, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data Out 21 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x01, 16},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Status */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x02, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 0 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x03, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 1 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x04, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 2 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x05, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 3 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x06, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 4 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x07, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 5 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x08, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 6 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x09, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 7 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x0a, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 8 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x0b, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 9 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x0c, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 10 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x0d, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 11 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x0e, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 12 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x0f, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 13 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x10, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 14 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x11, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 15 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x12, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 16 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x13, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 17 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x14, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 18 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x15, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 19 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x16, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 20 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x3103, 0x17, 8},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* Data In 21 */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt">};<o:p></o:p></span></font></p>
</div>
<div style="min-height: 11px">
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">// EL6021 PDO information<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" color="#006141" face="Times New Roman"><span style="font-size:7.0pt;color:#006141">ec_pdo_info_t</span></font><font size="1"><span style="font-size:7.0pt"> EL60XX_pdos[] = {<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x1602, 23, EL60XX_pdo_entries + 0},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* RxPDO-Map Outputs */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0x1a02, 23, EL60XX_pdo_entries + 23},<span class="apple-tab-span"><o:p></o:p></span></span></font></p>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">/* TxPDO-Map Inputs */</span></font><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt">};<o:p></o:p></span></font></p>
</div>
<div style="min-height: 11px">
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" color="#4e9072" face="Times New Roman"><span style="font-size:7.0pt;color:#4E9072">// EL6021 <u>syncs</u><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" color="#006141" face="Times New Roman"><span style="font-size:7.0pt;color:#006141">ec_sync_info_t</span></font><font size="1"><span style="font-size:7.0pt"> EL60XX_syncs[] = {<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" color="black" face="Times New Roman"><span style="font-size:7.0pt;color:black"> {0, </span></font><i><font size="1" color="#0326cc"><span style="font-size:7.0pt;color:#0326CC;font-style:
italic">EC_DIR_OUTPUT</span></font></i><font size="1" color="black"><span style="font-size:7.0pt;color:black">,
0, NULL, </span></font><i><font size="1" color="#0326cc"><span style="font-size:7.0pt;color:#0326CC;font-style:
italic">EC_WD_DISABLE</span></font></i><font size="1" color="black"><span style="font-size:7.0pt;color:black">},</span></font><font size="1" color="#0326cc"><span style="font-size:7.0pt;color:#0326CC"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" color="black" face="Times New Roman"><span style="font-size:7.0pt;color:black"> {1, </span></font><i><font size="1" color="#0326cc"><span style="font-size:7.0pt;color:#0326CC;font-style:
italic">EC_DIR_INPUT</span></font></i><font size="1" color="black"><span style="font-size:7.0pt;color:black">,
0, NULL, </span></font><i><font size="1" color="#0326cc"><span style="font-size:7.0pt;color:#0326CC;font-style:
italic">EC_WD_DISABLE</span></font></i><font size="1" color="black"><span style="font-size:7.0pt;color:black">},</span></font><font size="1" color="#0326cc"><span style="font-size:7.0pt;color:#0326CC"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {2, <i><font color="#0326cc"><span style="color:#0326CC;
font-style:italic">EC_DIR_OUTPUT</span></font></i>, 1, EL60XX_pdos + 0, <i><font color="#0326cc"><span style="color:#0326CC;font-style:italic">EC_WD_DISABLE</span></font></i>},<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {3, <i><font color="#0326cc"><span style="color:#0326CC;
font-style:italic">EC_DIR_INPUT</span></font></i>, 1, EL60XX_pdos + 1, <i><font color="#0326cc"><span style="color:#0326CC;font-style:italic">EC_WD_DISABLE</span></font></i>},<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="1" face="Times New Roman"><span style="font-size:
7.0pt"> {0xff}<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><u><font size="1" face="Times New Roman"><span style="font-size:7.0pt">};</span></font></u><font size="1"><span style="font-size:7.0pt"><o:p></o:p></span></font></p>
</div>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt">I am using these as my defaults since I want to use the full 22 bytes (I know you can configure between 3, 5, and 22 bytes, in which I would like to stick with 22).
<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt">When I fill the data bytes and set the ctrl bit to transmit data, I get a transmit success status on the status byte in the next process data exchange but no data goes
out the port. I have the other side of the RS232 interface hooked up to procomm to verify there is no data coming out of the port. Plus the activity light does not blink.<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt">Has anyone else had any issues with this? <o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt">Thank you!<o:p></o:p></span></font></p>
</div>
</div>
</div>
</body>
</html>