Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

Arpita Patel

@Arpita Patel
About
Posts
4
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • serial port communication between computer and another hardware device via RS232 in C# for windows Application
    A Arpita Patel

    I used this code for sending the data private void SendData() { if (CurrentDataMode == DataMode.Text) { // Send the user's text straight out the port comport.Write(txtSendData.Text); // Show in the terminal window the user's text Log(LogMsgType.Outgoing, txtSendData.Text + "\n"); } else { try { // Convert the user's string of hex digits (ex: B4 CA E2) to a byte array byte[] data = HexStringToByteArray(txtSendData.Text); // Send the binary data out the port comport.Write(data, 0, data.Length); // Show the hex digits on in the terminal window Log(LogMsgType.Outgoing, ByteArrayToHexString(data) + "\n"); } catch (FormatException) { // Inform the user if the hex string was not properly formatted Log(LogMsgType.Error, "Not properly formatted hex string: " + txtSendData.Text + "\n"); } } txtSendData.SelectAll(); } For the Recieving purpose I used private void port_DataReceived(object sender, SerialDataReceivedEventArgs e) { // This method will be called when there is data waiting in the port's buffer // Determain which mode (string or binary) the user is in if (CurrentDataMode == DataMode.Text) { // Read all the data waiting in the buffer string data = comport.ReadExisting(); // Display the text to the user in the terminal Log(LogMsgType.Incoming, data); } else { // Obtain the number of bytes waiting in the port's buffer int bytes = comport.BytesToRead; // Create a byte array buffer to hold the incoming data byte[] buffer = new byte[bytes]; // Read the data from the port and store it in our buffer comport.Read(buffer, 0, bytes); // Show the user the incoming data in hex format Log(LogMsgType.Incoming, ByteArrayToHexString(buffer)); } } now give me appropriate answer for my question. thanks a lot fro replying me.

    Arpita Patel

    C# help csharp hardware tutorial

  • serial port communication between computer and another hardware device via RS232 in C# for windows Application
    A Arpita Patel

    I am developing an application in C#.NET , for transferring data between two PC's using RS232 protocol. For communication, i m using "SerialPort" class of "System.IO.Ports" namespace. but now i have a problems in recieveing the data and sending the data. even one major problem is whenever i'll recieve at that time i have to identify the begining of message and ending of message as well as if two messagees are recieveing at thae same time then how to differentiate that messagees. please help me i nthat. i really stuck in that. thank you in advance

    Arpita Patel

    C# help csharp hardware tutorial

  • two way serial communication
    A Arpita Patel

    i need to make communication between computer to another machine. and this communication like two communication. first i need data from another machine(make sure it is not computer. i have to connect it with usb com port) and then also send acknowledge from computer to another machine. i did with it serial communciation.but it was text. i need to receive float data and also sending same data. also i need to identyfying where the next string started and when it will finished. help reply for this as early as

    Arpita Patel

    C# com help

  • trying to communication between two form in different project under one solution
    A Arpita Patel

    hey, i tried to share data between two form in different project under same solution. i have two project(project A,project B) in one solution and i want to send data from project A to Project B. and also at that time i want to activate form from project B and same time wants to close previous form. please help me in this case. i really stuck with it. i am using windows application in C# and doing serial communication. please reply as soon as

    C# help csharp
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups