Does anyone want to share some C# code on using Comx

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Freaks

I have seen several of you say you are using C# with serial comms on a PC , and that you were using some Extensions made by a person.

I was wondering if anyone was willing to share some code that is working ??

Or upload it as Project

TIA

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi,

if you use the new beta version 2.0 of microsofts .net framework it supports the serial port. I have attached a file Robot_Teach.cs it probably wont compile because you need a few other files but you can see how to open, write and read from the serial port. Let me know if you have any problems

cheers

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sorry, didnt attach, ill try again....

If you put all these files in the same directory and compile it, the prog should run, you must be running microsoft .net framework version 2 beta or it wont work because all other versions dont support the serial port.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

/Bingo

Take a look at 101 Visual Basic and C# Code Samples. You can download it from this link. After you install it, look in the 101 C# Samples\Framework - Using the COM Port folder.

Don

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've used the C# Express 2005 beta2 and it has the built in functions. BUT IT IS BETA so I don't use it in commercial products. I do use John Hind's code from the MSDN article http://msdn.microsoft.com/msdnma... but I'll advise in advance that this is not for the faint of heart. It uses the original Win32 API via the P/Invoke mechanism in C#. I think it was was written before that final C# package was released and it is not oriented to the drag and drop component metaphor in Visual StudioI had to hack at it for a few days to get it to work for me. Since all my code is intimately integrated into commercial products, I can't easily extract it to share.

I'd recommend using the C# Express beta with it's integrated Comm support and waiting for the release of Visual Studio 2005 to use it in commercial products.

Smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,
I use the ComPort component from http://www.winsoft.sk/ and it's work just fine

Yours truly,
Sylvain Bissonnette
www.microsyl.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanx all

I'll have a look at the code :-)

Smiley do you have any hints about what/why you hacked it ??

I do not have VisualStudio , just the free V1 of C#

If i start with C# V2 , is there any chance that they will release a free version of that one also ??

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bingo600 wrote:
I do not have VisualStudio , just the free V1 of C#

Are you aware of #develop (SharpDevelop)? If not, see this link.

Don

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

donblake wrote:
Bingo600 wrote:
I do not have VisualStudio , just the free V1 of C#

Are you aware of #develop (SharpDevelop)? If not, see this link.

Don

Thank you Don

I did not know that one , i will check that out :-)

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have a look at the following link:
http://www.codeworks.it/net/VBNe...

I've used it several times and works just fine...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you need a free tool and don't need to use C# , you can download a free delphi (I think think ver 6 is free now, for a long time I used a delphi 4 that came on a 'Alt om data' cd). Download APRO, and you have a good dev. tool.