How to pass value in array[] to cog2 once cog1 stop?
zpua
Posts: 33
Can anyone let me know anything wrong with this source code?
Array2[J]:=A
t:=t+1
waitcnt(clkfreq+cnt)
'ReceiveArray (@Array1,@Array2)
cogstop(0)
PUB Start2(I,J):Success
Stop
success:=( cog :=cognew(ReceiveArray(@long[Array1][5],@long[Array2][20]), @Stack1)+1)
PUB Stop
If cog
cogstop(cog~-1)
PUB ReceiveArray(temp1, temp2)
debug.start(31, 30, 0, 38400)
debug.tx(13)
waitcnt(clkfreq+cnt)
temp2:=Array2[5]
debug.str(string(13,"x="))
'debug.dec(temp2)
debug.str(fString.FloatToString(temp2))
Array2[J]:=A
t:=t+1
waitcnt(clkfreq+cnt)
'ReceiveArray (@Array1,@Array2)
cogstop(0)
PUB Start2(I,J):Success
Stop
success:=( cog :=cognew(ReceiveArray(@long[Array1][5],@long[Array2][20]), @Stack1)+1)
PUB Stop
If cog
cogstop(cog~-1)
PUB ReceiveArray(temp1, temp2)
debug.start(31, 30, 0, 38400)
debug.tx(13)
waitcnt(clkfreq+cnt)
temp2:=Array2[5]
debug.str(string(13,"x="))
'debug.dec(temp2)
debug.str(fString.FloatToString(temp2))