Hi all,
I got a little problem which I don´t understand. I hope someone here could help me with it.
This my code:
#platform "GOLDELOX-GFX2"
#inherit "4DGL_16bitColours.fnc"
//var buffer[68]; // doesn´t work when declared here !!
func main()
var buffer[68]; // works OK here !!
setbaud(BAUD_9600); // set baud rate
com_Init(buffer, 136, 0); // set buffer size
gfx_MoveTo(0, 40);
print ("rx bytes :");
repeat
com_Init(buffer, 136, 0); // reset buffer
serout(0xff); // request data
pause(1000); // wait
gfx_MoveTo(70, 40);
print (com_Count()); // display rx byte count
forever
endfunc
It send FFhex out the serial port, waits 1 sec. and displays the amount of bytes received.
When the buffer is defined inside the main function it works ok, when outside it doesn´t work
and I can´t figure out why.
Thanks for your help.
Sven
I got a little problem which I don´t understand. I hope someone here could help me with it.
This my code:
#platform "GOLDELOX-GFX2"
#inherit "4DGL_16bitColours.fnc"
//var buffer[68]; // doesn´t work when declared here !!
func main()
var buffer[68]; // works OK here !!
setbaud(BAUD_9600); // set baud rate
com_Init(buffer, 136, 0); // set buffer size
gfx_MoveTo(0, 40);
print ("rx bytes :");
repeat
com_Init(buffer, 136, 0); // reset buffer
serout(0xff); // request data
pause(1000); // wait
gfx_MoveTo(70, 40);
print (com_Count()); // display rx byte count
forever
endfunc
It send FFhex out the serial port, waits 1 sec. and displays the amount of bytes received.
When the buffer is defined inside the main function it works ok, when outside it doesn´t work
and I can´t figure out why.
Thanks for your help.
Sven
Comment