NSbasic Franson CUWIN3500

I wonder if anyone has had this problem before:

I have tried to use the example below to use the serial port on my CUWIN3500 windows CE device. I have looked through all the help files from the various parties involved- nothing. Particulary annoying since i cut and pasted the code from the NSbasic help file and it doesn't work. It makes me think maybe there is some set-up detail with the Franson serial code that is not obvious to newbies (like me).

I get this error:

NSBasic line 9 char 0 Unable to reolve Class ID for 'serialce.port.1' when instantiating 'serialce.port.1' object.

I would really appreciate some help to get the serial port working.

Thanks in advance.

Bill Chernoff in Canada

code from NSbasic help file :

'Contributed by Michael Newett

'This example works for Pocket PC or Desktop devices, with any length 'of file, any baudrate, serial or bluetooth.

'Note** The devices (PDA or desktop) Bluetooth must be turned ON 'before running the code.

'For CE Device use the following AddObject "serialce.port.1","objPort" 'For CE Device AddObject "serialce.license","objlicense" 'For CE Device

'For WindowsXP Device use the following 'AddObject "serialxp.port.1","objPort" 'AddObject "serialxp.license","objlicense"

'For all devices objLicense.LicenseKey = "eNZd1eYLfPjTJ6P2aaeU1aZeu1iupvAPeRbd"

Form1_Load

Sub StartCommandButton_Click objPort.BaudRate = 9600 objPort.ComPort = 8 'enter bluetooth outbound COM port number here objPort.ByteSize = 8 objPort.Parity = 0 objPort.StopBits = 0 '0 means 1 stop bit objPort.Enabled = True 'enable comm. port objPort.NoEvents = True objPort.DTR = True objPort.RTS = True 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 "Enter String to Write here"+vbCR 'Send command to device. Add vbCr or vbLf as applicable Finished=False Str="" Do Until Finished=True Size=objPort.Buffersize 'get number of bytes received from device 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

Sub Form1_load AddObject "CommandButton", "StartCommandButton", 75, 125, 100, 25 bStart.Caption = "Start Comms" bStart.FontSize = 8.25

AddObject "CommandButton", "StopCommandButton", 75, 225, 100, 25 bStop.Caption = "Stop Comms" bStop.FontSize = 8.25

AddObject "CommandButton", "WriteCommandButton", 75, 175, 100, 25 Write.Caption = "Write" Write.FontSize = 8.25 End Sub

Reply to
Bill Chernoff
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.