10 Replies - 1062 Views - Last Post: 19 May 2009 - 02:22 PM Rate Topic: -----

#1 Dani Boy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 19-May 09

Port Access Class

Posted 19 May 2009 - 08:28 AM

Hi,

Im new to C# and would like to know exactly what port access classes are?

Thanks
Dan
Is This A Good Question/Topic? 0
  • +

Replies To: Port Access Class

#2 bigtonyk  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 61
  • Joined: 17-May 09

Re: Port Access Class

Posted 19 May 2009 - 08:57 AM

View PostDani Boy, on 19 May, 2009 - 07:28 AM, said:

Hi,

Im new to C# and would like to know exactly what port access classes are?

Thanks
Dan



Those would be classes that deal with serial or parallel port access.
Was This Post Helpful? 0
  • +
  • -

#3 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5796
  • View blog
  • Posts: 12,631
  • Joined: 16-October 07

Re: Port Access Class

Posted 19 May 2009 - 09:28 AM

View Postbigtonyk, on 19 May, 2009 - 09:57 AM, said:

Those would be classes that deal with serial or parallel port access.


Interesting. Not the first thing that came to mind. I think ports, I tend think network ports, not com ports.

For the network ports, C# supports the sockets abstraction. More here: http://msdn.microsof...ets(VS.71).aspx
Was This Post Helpful? 0
  • +
  • -

#4 bigtonyk  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 61
  • Joined: 17-May 09

Re: Port Access Class

Posted 19 May 2009 - 09:34 AM

View Postbaavgai, on 19 May, 2009 - 08:28 AM, said:

View Postbigtonyk, on 19 May, 2009 - 09:57 AM, said:

Those would be classes that deal with serial or parallel port access.


Interesting. Not the first thing that came to mind. I think ports, I tend think network ports, not com ports.

For the network ports, C# supports the sockets abstraction. More here: http://msdn.microsof...ets(VS.71).aspx


Just showing my age! :)

Certainly could be network ports. The question wasn't very specific.
Was This Post Helpful? 0
  • +
  • -

#5 Dani Boy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 19-May 09

Re: Port Access Class

Posted 19 May 2009 - 09:58 AM

View Postbigtonyk, on 19 May, 2009 - 08:34 AM, said:

View Postbaavgai, on 19 May, 2009 - 08:28 AM, said:

View Postbigtonyk, on 19 May, 2009 - 09:57 AM, said:

Those would be classes that deal with serial or parallel port access.


Interesting. Not the first thing that came to mind. I think ports, I tend think network ports, not com ports.

For the network ports, C# supports the sockets abstraction. More here: http://msdn.microsof...ets(VS.71).aspx


Just showing my age! :)

Certainly could be network ports. The question wasn't very specific.



Assuming the classes are dealing with parallel port access. How exactly are they dealing with it?

thanks guys
Was This Post Helpful? 0
  • +
  • -

#6 bigtonyk  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 61
  • Joined: 17-May 09

Re: Port Access Class

Posted 19 May 2009 - 10:12 AM

Quote

Assuming the classes are dealing with parallel port access. How exactly are they dealing with it?

thanks guys


There are no parallel port classes built into .NET. There's a free DLL that you can get and you'd have to wrap your own class around it.

http://www.driverlin...ad/DlPortIO.htm

use the following DLL declarations to access the functions.

Public Declare Function DlPortReadPortUchar Lib "dlportio.dll" (ByVal Port As Integer) As Byte
Public Declare Sub DlPortWritePortUchar Lib "dlportio.dll" (ByVal Port As Integer, ByVal Value As Byte)

Just a guess, but the DLL is probably written in C/C++ and uses the hardware abstraction layer to communicate with the port. One could deal with interrupts (which is what the driver does at the lowest level) but that's ugly and not very OS friendly. All you really need to know is how to call the functions to read and write byte data.

Does that help?
Was This Post Helpful? 0
  • +
  • -

#7 Dani Boy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 19-May 09

Re: Port Access Class

Posted 19 May 2009 - 10:43 AM

View Postbigtonyk, on 19 May, 2009 - 09:12 AM, said:

Quote

Assuming the classes are dealing with parallel port access. How exactly are they dealing with it?

thanks guys


There are no parallel port classes built into .NET. There's a free DLL that you can get and you'd have to wrap your own class around it.

http://www.driverlin...ad/DlPortIO.htm

use the following DLL declarations to access the functions.

Public Declare Function DlPortReadPortUchar Lib "dlportio.dll" (ByVal Port As Integer) As Byte
Public Declare Sub DlPortWritePortUchar Lib "dlportio.dll" (ByVal Port As Integer, ByVal Value As Byte)

Just a guess, but the DLL is probably written in C/C++ and uses the hardware abstraction layer to communicate with the port. One could deal with interrupts (which is what the driver does at the lowest level) but that's ugly and not very OS friendly. All you really need to know is how to call the functions to read and write byte data.

Does that help?



yes it does....thanks a lot ;-)
Was This Post Helpful? 0
  • +
  • -

#8 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5796
  • View blog
  • Posts: 12,631
  • Joined: 16-October 07

Re: Port Access Class

Posted 19 May 2009 - 11:12 AM

View Postbigtonyk, on 19 May, 2009 - 11:12 AM, said:

There are no parallel port classes built into .NET.


I'm not sure about this. I'd look here: http://msdn.microsof...m.io.ports.aspx
Was This Post Helpful? 0
  • +
  • -

#9 bigtonyk  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 61
  • Joined: 17-May 09

Re: Port Access Class

Posted 19 May 2009 - 11:20 AM

View Postbaavgai, on 19 May, 2009 - 10:12 AM, said:

View Postbigtonyk, on 19 May, 2009 - 11:12 AM, said:

There are no parallel port classes built into .NET.


I'm not sure about this. I'd look here: http://msdn.microsof...m.io.ports.aspx



only serial ports are in that class. not parallel.
Was This Post Helpful? 0
  • +
  • -

#10 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5796
  • View blog
  • Posts: 12,631
  • Joined: 16-October 07

Re: Port Access Class

Posted 19 May 2009 - 01:17 PM

View Postbigtonyk, on 19 May, 2009 - 12:20 PM, said:

only serial ports are in that class. not parallel.


That was actually the not sure part. :P I honestly can't recall the last time I messed with a parallel port. I dimly remember sending control codes to dot matrix printers to draw pictures.

Do computers still ship with the things? My giant, overpriced, HP workstation here didn't.
Was This Post Helpful? 0
  • +
  • -

#11 bigtonyk  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 61
  • Joined: 17-May 09

Re: Port Access Class

Posted 19 May 2009 - 02:22 PM

View Postbaavgai, on 19 May, 2009 - 12:17 PM, said:

View Postbigtonyk, on 19 May, 2009 - 12:20 PM, said:

only serial ports are in that class. not parallel.


That was actually the not sure part. :P I honestly can't recall the last time I messed with a parallel port. I dimly remember sending control codes to dot matrix printers to draw pictures.

Do computers still ship with the things? My giant, overpriced, HP workstation here didn't.



I don't think so. I haven't seen a parallel port on a PC in ages. Not much point in having them anymore, unless you have some antique hardware. :)

I've done my share of com/lpt programming. Not always a pleasant undertaking. x86 assembler. yee ha.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1