[Gambas-user] using events of serial ports for reading how_?

T Lee Davidson t.lee.davidson at gmail.com
Thu Aug 9 16:43:31 CEST 2018


On 08/08/2018 05:57 PM, PICCORO McKAY Lenz wrote:
> hi, me again! i modify a little now the class, with a auto null semaphore
> 
> as everybody said, if there's data in the port a read event will raise, but there's not happened

How do you know the event isn't being triggered? I don't see your code anywhere giving the printer time to respond.


> attached the project and also something when all the main.module lines executed, programs does not end...

Could that be because you never close the port?


And just out of curiosity, why do you use the gb.vb component when creating a purely Gambas application?



> 2018-08-07 12:52 GMT-04:00 PICCORO McKAY Lenz <mckaygerhard at gmail.com <mailto:mckaygerhard at gmail.com>>:
> 
>     El mar., 7 de ago. de 2018 a la(s) 09:42, Tony Morehen
> 
>         ...user space programs no longer need to deal with the low level details of handshaking and flow control..... and just
>         read and write to the serial port as a stream.
> 
>     ok as i write, so gambas handle all the manage of the information
>     to read and write using stream and Eof, (wow so great! right? )
>     in any case was a great information about the data workflow,, thanks anyway tony
> 
>         One issue that may arise, the linux kernel only uses CTS/RTS for flow control; it ignores DSR/DTS.
> 
>     important information many thanks for that, This must be in the gambas wiki page of the seria port too
>     i'll mark this mail and make a tutorial with better information
> 
> 
>     El mar., 7 de ago. de 2018 a la(s) 12:06, T Lee Davidson
>     > Even if any of them signal that data is available, the _Read event already does that for you.
>     yeah i already know, it's hard to explain for me ...
> 
>     > Perhaps your goal could be accomplished by implementing a SerialPort.Read event handler 
>     NO, no more handlers or events, a normal procedimental methond
> 
>     > that adds the incoming data to a global accumulator, 
>     > and then manually reading the accumulator and clearing it once it's read.
>     i want that in any moment can read the acumulator, and pas a command to modifi taht data
>     again hard to explain and there's too much information to hide by the company
> 
>     > However, that may run into collisions and data integrity issues 
>     > if you try to manually read from, or clear, the accumulator
>     > while the event handler is writing to it. 
>     yeah only if the data are not knowed but i really know parto of them
>     of course we need implement a semaphore
> 
>     > Or, maybe using a Queue would meet your need: http://gambaswiki.org/wiki/comp/gb.data/queue <http://gambaswiki.org/wiki/comp/gb.data/queue> .
>     > (It's unfortunate that there's not much documentation on that.)
>     a concurrent problem on the wiki, it's suppost to be first source of information and seems it's maillist
>     i disagree that mailist be a source of information, a documentaiton it's the main tower of any project!
> 
> 
> 
> 
> 
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
> 


More information about the User mailing list