Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How to access COMM port

I don't seem to find any information about accessing COMM ports (RS-232) under 7.0 .NET. Anyone knows how to do it? Thanks.
0 Kudos
Message 1 of 6
(4,321 Views)
The .NET framework does not directly support serial communication. You can use the Win32 SDK through platform invoke (P/Invoke) calls, or you can use the VisaNS .NET class library form National Instruments, which supports serial communication. You can install the Visa .NET support from the National Instruments Driver CD
0 Kudos
Message 2 of 6
(4,316 Views)
There is a free component from SAX for RS-232.
http://www.sax.net

Why do the links not work in this forum?
0 Kudos
Message 3 of 6
(4,316 Views)
Hi,

I presume you have not installed the NI-VISA driver. If you download (from NI web) and install it site you will be able to access the COM port.
It must have been supplied as a driver CD with measurement studio.

http://digital.ni.com/softlib.nsf/webcategories/85256410006C055586256BAC002C51FA?opendocument&node=132070_US
0 Kudos
Message 4 of 6
(4,139 Views)
MSDN has an article on how to use the P/Invoke with .NET.
http://msdn.microsoft.com/msdnmag/issues/02/10/netserialcomm/


MSDN also has a great article on using RS-232 with .NET.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncodefun/html/code4fun12102003.asp
They show samples interfacing with an RS-232 LCD controller. The article mentions a component called DBComm that I have been using for over six months with a lot of success.


Finally RS-232 is supposed to be supported in the next release of .NET (Whidbey).

0 Kudos
Message 5 of 6
(4,096 Views)
This is the standard ActiveX control as used my VB programmers.
The SAX control is a free DOTNET control so P/Invoke is not needed.
0 Kudos
Message 6 of 6
(4,082 Views)