<x-html><html>
Gary,<br>
<br>
I could not resist. I am sure you already have better code, but I needed
to see if the CBC would work. Here is the input to the calc block
compiler that I dreamed up.<br>
<br>
/* Comment */<br>
#pragma CP (CP0401)<br>
#pragma BLKTYPE (CALCA)<br>
Compnd:Block <br>
{<br>
&nbsp; /* RI1 is the frequency adjuster<br>
&nbsp;&nbsp;&nbsp;&nbsp; RI2 is the bias<br>
&nbsp;&nbsp;&nbsp;&nbsp; RI3 is the gain<br>
&nbsp; */<br>
&nbsp; const M1 0.0166; /* 1/60th of a minute */<br>
&nbsp; M2 = M2 + M1;<br>
&nbsp; RO1 = RI3 * sin(RI1 * M2) + RI2;<br>
&nbsp; /* reset the value of M2 so it does not get too huge */<br>
&nbsp; if (M2 &gt; 2*3.14159)<br>
&nbsp; {<br>
&nbsp;&nbsp;&nbsp; M2 = M2 - 2*3.14159;<br>
&nbsp; }<br>
}<br>
<br>
Here is the output.<br>
<br>
# Calc Block code compiled for Winston Jenks in order to create a sine
wave<br>
# Compiled on: Thu Aug 24 09:27:40 CDT 2000 <br>
<font face="Courier New, Courier">OPEN CP0401 MODIFY cbc<br>
MODIFY Compnd:Block<br>
&nbsp;STEP01 = IN M02&nbsp; <br>
&nbsp;STEP02 = ADD M01&nbsp; <br>
&nbsp;STEP03 = STM M02&nbsp; <br>
&nbsp;STEP04 = IN RI03&nbsp; <br>
&nbsp;STEP05 = IN RI01&nbsp; <br>
&nbsp;STEP06 = MUL M02&nbsp; <br>
&nbsp;STEP07 = SIN&nbsp;&nbsp; <br>
&nbsp;STEP08 = MUL&nbsp;&nbsp; <br>
&nbsp;STEP09 = ADD RI02&nbsp; <br>
&nbsp;STEP10 = OUT RO01&nbsp; <br>
&nbsp;STEP11 = IN M02&nbsp; <br>
&nbsp;STEP12 = LAC 2&nbsp; <br>
&nbsp;STEP13 = MUL M24&nbsp;&nbsp; ;3.14159<br>
&nbsp;STEP14 = SUB&nbsp;&nbsp; <br>
&nbsp;STEP15 = BIP 17&nbsp; <br>
&nbsp;STEP16 = GTO 22&nbsp; <br>
&nbsp;STEP17 = IN M02&nbsp; <br>
&nbsp;STEP18 = LAC 2&nbsp; <br>
&nbsp;STEP19 = MUL M24&nbsp;&nbsp; ;3.14159<br>
&nbsp;STEP20 = SUB&nbsp;&nbsp; <br>
&nbsp;STEP21 = STM M02&nbsp; <br>
&nbsp;STEP22 = END&nbsp;&nbsp; <br>
#Info(Compnd:Block): uses 22 calculation steps.<br>
&nbsp;M24 = 3.14159<br>
&nbsp;M01 = 0.0166<br>
#Info(Compnd:Block): 2 symbol locations used.<br>
END<br>
#Info(): 5 STEPs were optimized away<br>
CLOSE<br>
<br>
I have not tried this.&nbsp; </font><br>
<div>Winston Jenks</div>
Technical Director, Cape Software, Inc.
</html>
</x-html>

Reply via email to