On 05/08/2017 12:13 PM, alexchernoff wrote: > Dear all, > > I am receiving data over a serial port which is sent by a byte[].write > function (an array of bytes) > > I get the SerialPort1_read() event raised where I try to read data, RxBuffer > is a string var > > *Try Read #SerialPort1, RxBuffer, Lof(SerialPort1)* > > as soon as I do, the whole program stops, some other timers in other modules > also stop to fire. In fact when running the program in Gambas again, it does > not execute even the startup, so have to restart the IDE. > > what am I doing wrong? > > thanks!
If you are attempting to read the data _into_ RxBuffer, it appears your syntax is incorrect. According to http://gambaswiki.org/wiki/lang/read , the syntax for the READ statement is: Variable = READ [ # Stream , ] Length Perhaps try: Try RxBuffer = Read #SerialPort1, Lof(SerialPort1) --- Lee ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user