Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

TX buffer

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-14-2008, 03:21 PM
Senior Member
 
Join Date: May 2008
Posts: 174
Default TX buffer

Hi,
how can I know when the TX buffer is empty?
It is very important for synchronize serial reading in rs485 mode.

Thanks
Reply With Quote
  #2 (permalink)  
Old 09-15-2008, 04:02 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,726
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Please try the following code:
obj is an Object from the Door library
serial1 is the SerialPort object.
Code:
Sub App_Start
    serial1.New1
    obj.New1(
False)
    ... 
'open port
   obj.FromLibrary("serial1","sp",B4PObject(2))
    
Msgbox(GetTX)
End Sub

Sub GetTX
    
Return obj.GetProperty("BytesToWrite")
End Sub
Reply With Quote
  #3 (permalink)  
Old 09-15-2008, 05:30 AM
Senior Member
 
Join Date: May 2008
Posts: 174
Default

Thanks
Reply With Quote
  #4 (permalink)  
Old 09-15-2008, 11:48 AM
Senior Member
 
Join Date: May 2008
Posts: 174
Default

Are you sure that the code work?
serial is serial2.dll object
objser is door.dll object

Code:
serial.RTSEnable = false
serial.Output(dato)
Do
    nbyte = objser.GetProperty(
"BytesToWrite")
    
DoEvents
Loop While  nbyte > 0
serial.RTSEnable = true
nbyte is always 0

Thanks
Reply With Quote
  #5 (permalink)  
Old 09-15-2008, 04:44 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,726
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

According to Microsoft documentation it should return the number of bytes in the output buffer.
Is it possible that the data was already sent?
Maybe you should try to continuously send large data and see if the size is greater than zero.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Collect pieces of string in a buffer schimanski Questions (Windows Mobile) 1 08-17-2008 01:09 PM
Unbuffered Write / Buffer Flush davidmw Basic4ppc Wishlist 5 07-07-2007 10:26 PM


All times are GMT. The time now is 02:21 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0