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