473,666 Members | 2,093 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RS23-Port with C#

Is there any Information about reading out a RS23-Port with C#?

Thanks,

Marcelo Muzilli

May 25 '06 #1
3 2043
mm******@gmail. com wrote:
Is there any Information about reading out a RS23-Port with C#?


Yes, checkout the System.IO.Ports .SerialPort class. It was added in
..net 2.0. I just typed it into Google and got plenty of info.
--
David Hogue
May 25 '06 #2
Thank you David for your response.

I would like to know if can I work with DEX (I will transmit
information from my handheld to my PC) using this class? And if it's
possible for you, could you give a sample?

Cheers,

Marcelo Muzilli

May 25 '06 #3
mu*****@sercomt el.com.br wrote:
I would like to know if can I work with DEX (I will transmit
information from my handheld to my PC) using this class? And if it's
possible for you, could you give a sample?


I'm not sure what DEX is. I have successfully used this class to
control ptz cameras and wireless bar code scanners. So, I don't see any
reason why it shouldn't work with your hardware.

Below is some sample code to open a the port and listen for data. It
assumes that the device sends ascii characters and that it terminates
the lines with a carriage return.

If your device has a binary protocol, you will probably want to use
SerialPort.Read () which can fill in an array of bytes.

There's also Write() and WriteLine() is you need to send data/commands
to the device.

using System;
using System.IO.Ports ;

public class Example
{
private static SerialPort port;

public static void Main()
{
// setup the port
port = new SerialPort("com 1",
9600, Parity.None, 8, StopBits.One);
port.NewLine = "\r";

// setup event handler
port.ErrorRecei ved += port_ErrorRecei ved;

// open port
port.Open();

Console.WriteLi ne("Port opened, waiting for data, " +
"press enter to quit");
Console.ReadLin e();

port.Close();
}

private static void port_DataReceiv ed(object sender,
SerialDataRecei vedEventArgs e)
{
string line = port.ReadLine() ;
Console.WriteLi ne("Received: " + line);
}
}
--
David Hogue
May 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3865
by: R | last post by:
Hi, I'm really stuck here. I have a data combo called cmbHvem which I link to a recordset RS23 like this If RS23.State = adStateOpen Then cmbHvem.RowSource = Nothing RS23.Close() End If
0
8444
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8551
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8639
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4368
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1775
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.