<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>
/* RI1 is the frequency adjuster<br>
RI2 is the bias<br>
RI3 is the gain<br>
*/<br>
const M1 0.0166; /* 1/60th of a minute */<br>
M2 = M2 + M1;<br>
RO1 = RI3 * sin(RI1 * M2) + RI2;<br>
/* reset the value of M2 so it does not get too huge */<br>
if (M2 > 2*3.14159)<br>
{<br>
M2 = M2 - 2*3.14159;<br>
}<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>
STEP01 = IN M02 <br>
STEP02 = ADD M01 <br>
STEP03 = STM M02 <br>
STEP04 = IN RI03 <br>
STEP05 = IN RI01 <br>
STEP06 = MUL M02 <br>
STEP07 = SIN <br>
STEP08 = MUL <br>
STEP09 = ADD RI02 <br>
STEP10 = OUT RO01 <br>
STEP11 = IN M02 <br>
STEP12 = LAC 2 <br>
STEP13 = MUL M24 ;3.14159<br>
STEP14 = SUB <br>
STEP15 = BIP 17 <br>
STEP16 = GTO 22 <br>
STEP17 = IN M02 <br>
STEP18 = LAC 2 <br>
STEP19 = MUL M24 ;3.14159<br>
STEP20 = SUB <br>
STEP21 = STM M02 <br>
STEP22 = END <br>
#Info(Compnd:Block): uses 22 calculation steps.<br>
M24 = 3.14159<br>
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. </font><br>
<div>Winston Jenks</div>
Technical Director, Cape Software, Inc.
</html>
</x-html>
