OpenNetCF Serial Control

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

I'm still learning .NETCF so sorry if this seems
simple....

I am trying to utilize the OpenNetCF serial control in a
PPC app to communicate with a peripheral device. I am
using VB.NET in my app and am using the C# sample project
from the OpenNetCF.org website as my reference.

For starters, all I am trying to do is open the port and
recieve some basic input from the peripheral device. I
have a button and a text box on my form and the basic
code is as follows.

'create port settings
Dim portsettings = New HandshakeNone

'create a default port
Dim port As New Port(1)

'Open port
port.open()

'Show the input
txtInput.text = port.Input

I get an error when I get to the port.open()command.
Err.Number = 5
Err.Description = "CreateFile Failed:2"

Anybody have any suggestions? Code is always helpful!!

THX
 
Did you tell it *which* port to open? I don't think that you did. Seems
like you should be using an instruction like:

Dim port as New Port( "COM1:" )

or something along those lines...

Paul T.
 
Back
Top