.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
satyapriyanayak
abhays
SP
Ashutosh Jha
Mahesh
Post New Web Links

Serial Port Communication Read and Write using C#.net

Posted By: Syed Shakeer Hussain     Posted Date: August 07, 2010    Points: 2   Category :C#
 
In this simple article you will learn that how you can Open and read COM port data using System.IO.Ports Namespace.
Simply just create New Project of windows application in C#.

Import ServiceProcess APIs
C#:
---
using System.IO.Ports

VB
Imports System.IO.Ports

Write Parsing functions which parse port data according to attached device


View Complete Post


More Related Resource Links

.NET Serial/COM Port Communication over Terminal Services

  

Hi,

I hope I'll be able to clearly formulate my question.

Scenario: we have an application that integrates with several type of scanners (i.e. credit card, barcode, passport) using serial port interface.
It's the desktop application and can be deployed to run either in stand-alone environment or can be published over terminal services layer (citrix, TS, etc).
In the preferences of the application users are able to specify which scanner is assigned to which COM port.
For example: bar code scanner = COM1, credit card scanner = COM5.
To a user, names of the COM ports don't really make much sense and they won't know that the bar code scanner needs to be assigned to COM1 unless they go to Device Manager and look up the device name associated with the COM port under Ports (COM & LPT) section.

SerialPort class in .NET Framework has the function GetPortNames that returns the list of available COM ports: COM1, COM3, COM5, COM6, etc.
After doing a little research I found a way to get the descriptive names of each COM port device using WMI.

Here is the code for this:

  Public Shared Function GetAvailableSerialPorts(

Serial Communication with the .NET Compact Framework

  
Learn how to make your applications communicate over a serial port and how to handle common issues when implementing serial solutions. After a general discussion about serial communication and a common serial communication standard, this article demonstrates a practical use of the technologies through sample source code written in C#.

bluetooth print via serial port PDA

  
Print via BlueTooth using PDA

Crystal Report gives System.AccessViolationException: Attempted to read or write protected memory. T

  

when a crystal report for same id is opened again at same time or refreshed then it gives the

"System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."


Stack Trace is :-


Stack Trace:

[AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.]
CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.SetConnectionInfos(ConnectionInfos ConnectionInfos) +0
CrystalDecisions.CrystalReports.Engine.Table.ApplyLogOnInfo(TableLogOnInfo logonInfo) +362
CrystalDecisions.CrystalReports.Engine.ReportDocument.SetTableLogon(Tables tables, String user, String password, String server, String database, Boolean ignoreCase) +258
CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDatabaseLogon(String user, String password, String server, String database, Boolean ignoreCase) +204
CrystalDecisions.

Robotics: Writing and Testing VPL Services for Serial Communication

  

VPL, part of Robotics Developer Studio is intended for novice programmers, but is also useful for testing and prototyping. We write a simple serial port service that allows you to send and receive data.

Trevor Taylor

MSDN Magazine February 2010


how read write cookies in asp.net

  

hi please give me code for read write cookies in  asp.net



thanks,


kaushik


Creating a SharePoint 2010 Web Part That Can Read and Write Data to an External Data Source

  
Learn to use Visual Studio 2010 to create a Visual Web Part that uses a BCS external content type in SharePoint Server 2010 to read and write data to the AdventureWorks sample database.

Sample: Creating a SharePoint 2010 Web Part That Can Read and Write Data to an External Data Source

  
Explore the code in this visual how-to article as you learn to use Visual Studio 2010 to create a Visual Web Part that uses a BCS external content type in SharePoint Server 2010.

Serial Port with portable data terminal

  
Hi,I am making application with portable data terminal which connected to serial port. User will go with portable data terminal and scan data with it than we will connect it to PC and read all the data from it. Kindly somebody help me how to do that.Thanx

Read data from BLOB field and write to sharepoint list

  
Hi, I want to read the data from BLOB field and write it into sharepoint list item. Please provide some pointer to archive above objective.   Thanks in Advance.

How to wait for a Serial Port to respond

  
Hi Is it to possible to wait for a serialPort component to complete it's response?  I have a device connected to the serial port of my PC. I use the serialPort component in order to communicate with the device. I have to send 2 different strings of data to the serial port but the trick is that after sending the first string of data I have to wait for the serial port to respond. Then I have to check the response and decide whether I must send the second string or not. Also after sending the second string, I have to check also the response of the serial port. I tried to use an arbitrary amount of wait time between the sending of the two strings. Something like SerialPort.Write(...) ; Thread.Sleep(2000); SerialPort.Write(...); But the software failed when I tried it in a slower PC. So is there a way to replace the Thread.Sleep(2000) with a command that will wait until the serial port complete its response? Although, the response of the serial port is different between the two sending strings, I do know that the first response is only one byte and I know the ending byte of the second response. Also, the second response is no more than 30 bytes in length. Regards Dimitris

How to read/write files > 2GB ?

  
I need to read very large NTFS files (> 2GB in length).  But Filestream.Read/Write only supports 32-bit int offset and count values (unless there's an overload I can't find) How can I avoid having to read these files in 2GB "chunks" and then manually re-compose the file from the chunks? Or should I be using an alternative to Filestream that supports reads/writes > 2GB?   What??? Thanks! DT

Getting Error "Attempted to read or write protected memory. This is often an indication that other m

  
Exception Details: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.Gyanendra

Attempted to read or write protected memory. This is often an indication that other memory is corrup

  
Hi people, Suddenly I'm getting this error specifically when I browse to the Calulation tab in an Analysis Services BIDS project. I have 2 cubes withing the project & both error when I try to create a calculation. One gives this message Attempted to read or write protected memory. This is often an indication that other memory is corrupt the other this one Unexpected error occurred. Error in the application. Has anyone else seen this & if so, how did you fix it ? Only one of the cubes in question has any calculations defined, however due to the scenario above I can't see it to edit
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend