<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=iso-8859-1">
<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="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@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;}
p
{mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle17
{mso-style-type:personal;
font-family:Arial;
color:windowtext;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-GB link=blue vlink=purple>
<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'>As far as I'm aware the answer is no. </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>ecrt_domain_process()
<font color=navy><span style='color:navy'>processes the response from the
EtherCAT frame and fills in the domain data.<o:p></o:p></span></font></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'>However, I have a similar situation and
what I'm doing is wrapping the access to the domain data in objects. On
startup I create two extra bits of memory the same size as the domains. One to
use as a cache and one to use as a mask. Each of the wrapper objects gets
pointers to the memory also.<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'>When an object needs to read its data you
can do something like:<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'> value = (
((*(_type *)cacheAddress) & \<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'> (*(_type
*)maskAddress)) | \<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'> ((*(_type
*)ecAddress) & \<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'> ~(*(_type
*)maskAddress)) );\<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'>When an object needs to write its data you
can do something like:<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'> *(_type *)cacheAddress
= value; \<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'> *(_type *)maskAddress
= (_type)~0ull; \<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'>Note: if it’s a readonly value then
you can just of course access the data directly.<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'>The inside the </span></font><font size=2
face=Arial><span style='font-size:10.0pt;font-family:Arial'>ecrt_domain_process(),ecrt_domain_queue()
calls I update the domain data with something like:<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 = domainSize;<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'> uint8_t
*data8 = (uint8_t *)domECAddress;<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'> uint8_t
*mask8 = (uint8_t *)domMaskAddress;<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'> uint8_t
*cache8 = (uint8_t *)domCacheAddress;<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 (*mask8
!= 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'> *data8 =
((*cache8) & (*mask8)) | ((*data8) & ~(*mask8));<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'> *mask8 =
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'><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'> data8++;<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'> mask8++;<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'> cache8++;<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'>Note: In practice I do the majority of the
data as uint64's, then revert to uint8's for the remainder.<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 wouldn't mind hearing how other people
deal with the issue.<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'>Regards,<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>
<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>WIEGAND Ralf<br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, 20 March 2012 01:03<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]
Modifying Domain Data</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>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hello,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>i have a problem modifying domain data in my ethercat-app.
All the examples provided with the etherlabmaster modify the domain data
between ecrt_domain_process() and ecrt_domain_queue(). I have the problem, that
I have to modify the domain data outside these functions (in another task), but
during ecrt_master_receive() my outputs were overwritten in the domain.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Is there any way to modify the domain data outside the
functions ecrt_domain_process() and ecrt_domain_queue() ?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Regards,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Ralf Wiegand<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=DE
style='font-size:12.0pt'><br>
<br>
<br>
<o:p></o:p></span></font></p>
<span id="ppe_1000037">
<p><b><font size=2 color=navy face=Arial><span lang=DE style='font-size:10.0pt;
font-family:Arial;color:navy;font-weight:bold'>Hexagon Metrology GmbH<br>
</span></font></b><font size=1 color=navy face=Arial><span lang=DE
style='font-size:9.0pt;font-family:Arial;color:navy'>Siegmund-Hiepe-Str. 2-12<br>
35578 Wetzlar<br>
Deutschland<br>
<br>
Phone: +49 6441 207-410<br>
Fax: +49 6441 207-387<br>
E-Mail: Ralf.Wiegand@hexagonmetrology.com </span></font><span lang=DE><o:p></o:p></span></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=DE
style='font-size:12.0pt'></span><br>
<br>
<br>
<o:p></o:p></span></font></p>
<span id="ppe_1000044">
<p><font size=1 color=navy face=Arial><span lang=DE style='font-size:9.0pt;
font-family:Arial;color:navy'>Hauptgeschäftsführer: Holger Fritze <br>
Geschäftsführer: Per Holmberg - Erik Steinbacher - Arno Seuren<br>
Amtsgericht Wetzlar, HRB 1201 </span></font><span lang=DE><o:p></o:p></span></p>
</span>
<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=DE
style='font-size:12.0pt'><br>
<br>
<br>
<o:p></o:p></span></font></p>
<span id="ppe_1000090">
<p><font size=3 face="Times New Roman"><span lang=DE style='font-size:12.0pt'><img
width=600 height=48 id="_x0000_i1025" src="cid:image001.jpg@01CD0686.68A7BCA0"
alt="Hexagon - Where quality come together..." border=0><o:p></o:p></span></font></p>
</div>
</span>
</body>
</html>