roland.mendoza
Posts: 1
Joined: Tue Aug 11, 2009 7:56 pm
Location: Philippines

Cannot Output to Printer

Tue Aug 11, 2009 8:02 pm

Hi,

I am using a Win CE Palm Treo 750 attached to a Datecs PP-55 portable printer. Using the following code, I decided to test Franson serial tools under NSBasic 7.0:

AddObject "serialce.port.1","objPort"
AddObject "serialce.license","objlicense"

objLicense.LicenseKey = "license key"

Sub StartCommandButton_Click
objPort.ComPort = 7
objPort.BaudRate = 9600
objPort.Parity = 2
objPort.ByteSize = 7
objPort.StopBits = 2
objPort.NoEvents = True

objPort.DTR = True
objPort.RTS = True

objPort.Handshake = 0
objPort.BufferSize = 128

objPort.Enabled = True 'enable comm. port
Sleep 100 'delay to enable comm port to initialise

End Sub

Sub StopCommandButton_Click
objPort.Enabled = False 'disable comm port
End Sub

Sub WriteCommandButton_Click
objPort.Write "Hello World" + vbCR
Finished=False
Str=""

Do Until Finished=True
Size=objPort.Buffersize
Newstr=objPort.Read(Size,1000) 'read response from device. Timeout
'if nothing received after 1000ms
If IsNull(Newstr) Then
Finished=True
Else
Str=Str&Newstr
End If
Loop

If IsNull(Str) Then Str="Device Timed out"
MsgBox Str
End Sub

I already tested the program using different combination of ports, Stopbits, and objPort.Handshake values, but I still can output any data to the printer.

Please help. Any assistance to point me in the right direction will be greatly appreciated.

Warmest Regards,

Roland

Return to “SerialTools”