<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:14pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Dear friends,</p>
<p><br>
</p>
<p>we are now trying to add a new module into NURDLIB. At the beginning, we just want to have a 'software version' of the module, so no hardware involved yet.</p>
<p><br>
</p>
<p>We are stuck with the following code in crate.c (line 1262 and following):</p>
<p><br>
</p>
<p></p>
<div style="color: #cccccc;background-color: #1f1f1f;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;">
<div><span style="color: #cccccc;"> diff_module </span><span style="color: #d4d4d4;">=</span><span style="color: #cccccc;">
</span><span style="color: #dcdcaa;">COUNTER_DIFF</span><span style="color: #cccccc;">(</span><span style="color: #d4d4d4;">*</span><span style="color: #9cdcfe;">module</span><span style="color: #cccccc;">-></span><span style="color: #9cdcfe;">crate_counter</span><span style="color: #cccccc;">,</span></div>
<div><span style="color: #cccccc;"> </span><span style="color: #9cdcfe;">module</span><span style="color: #cccccc;">-></span><span style="color: #9cdcfe;">event_counter</span><span style="color: #cccccc;">,
</span><span style="color: #9cdcfe;">module</span><span style="color: #cccccc;">-></span><span style="color: #9cdcfe;">this_minus_crate</span><span style="color: #cccccc;">);</span></div>
<div><span style="color: #6a9955;"> /* TODO: Clean this. */</span></div>
<div><span style="color: #cccccc;"> </span><span style="color: #9cdcfe;">shadow_counter</span><span style="color: #cccccc;">.</span><span style="color: #9cdcfe;">value</span><span style="color: #cccccc;">
</span><span style="color: #d4d4d4;">=</span></div>
<div><span style="color: #cccccc;"> </span><span style="color: #9cdcfe;">module</span><span style="color: #cccccc;">-></span><span style="color: #9cdcfe;">shadow</span><span style="color: #cccccc;">.</span><span style="color: #9cdcfe;">data_counter_value</span><span style="color: #cccccc;">;</span></div>
<div><span style="color: #cccccc;"> </span><span style="color: #9cdcfe;">shadow_counter</span><span style="color: #cccccc;">.</span><span style="color: #9cdcfe;">mask</span><span style="color: #cccccc;">
</span><span style="color: #d4d4d4;">=</span><span style="color: #cccccc;"> </span>
<span style="color: #9cdcfe;">module</span><span style="color: #cccccc;">-></span><span style="color: #9cdcfe;">event_counter</span><span style="color: #cccccc;">.</span><span style="color: #9cdcfe;">mask</span><span style="color: #cccccc;">;</span></div>
<div><span style="color: #cccccc;"> diff_shadow </span><span style="color: #d4d4d4;">=</span><span style="color: #cccccc;">
</span><span style="color: #dcdcaa;">COUNTER_DIFF</span><span style="color: #cccccc;">(</span><span style="color: #d4d4d4;">*</span><span style="color: #9cdcfe;">module</span><span style="color: #cccccc;">-></span><span style="color: #9cdcfe;">crate_counter</span><span style="color: #cccccc;">,</span></div>
<div><span style="color: #cccccc;"> shadow_counter, </span><span style="color: #9cdcfe;">module</span><span style="color: #cccccc;">-></span><span style="color: #9cdcfe;">this_minus_crate</span><span style="color: #cccccc;">);</span></div>
</div>
<p></p>
<p><br>
</p>
<p>As we understand, the idea here is to check with a call of readout_dt if the module's internal counter agrees with the counter of the crate for the given module. Basicly when the crate thinks it has accessed the module n times, the module should report the
same number of access attempts. Is this understanding correct?</p>
<p><br>
</p>
<p>If yes, how exactly should the module increment it's internal counter? If this is done on readout_dt, a mismatch between the crate and the internal counter occurs as soon as we stop the aquisition.</p>
<p><br>
</p>
<p>I can explain in more details, but maybe first you can explain to us what the whole idea behind this check is? To us it looks like also the dummy module implementation will have problems with it.</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>Thank you very much!</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>Best greetings</p>
<p>Günter<br>
</p>
<br>
</div>
</body>
</html>