Click here to Skip to main content
15,848,093 members
Home / Discussions / C#
   

C#

 
QuestionSpeech recognition: Unable to LoadGrammar and no installed recognizer Pin
Mc_Topaz13-Jan-18 4:35
Mc_Topaz13-Jan-18 4:35 
QuestionSelect data from MSSQL database and insert into oracle database Pin
Member 1346617612-Jan-18 3:51
Member 1346617612-Jan-18 3:51 
AnswerRe: Select data from MSSQL database and insert into oracle database Pin
Richard MacCutchan12-Jan-18 4:11
mveRichard MacCutchan12-Jan-18 4:11 
AnswerRe: Select data from MSSQL database and insert into oracle database Pin
Richard Deeming12-Jan-18 4:13
mveRichard Deeming12-Jan-18 4:13 
GeneralRe: Select data from MSSQL database and insert into oracle database Pin
Member 1346617612-Jan-18 4:36
Member 1346617612-Jan-18 4:36 
GeneralRe: Select data from MSSQL database and insert into oracle database Pin
Richard Deeming12-Jan-18 4:45
mveRichard Deeming12-Jan-18 4:45 
GeneralRe: Select data from MSSQL database and insert into oracle database Pin
Member 1346617612-Jan-18 5:01
Member 1346617612-Jan-18 5:01 
QuestionSystem.IO.IOException: 'The I/O operation has been aborted because of either a thread exit or an application request Pin
Member 1058555811-Jan-18 12:19
Member 1058555811-Jan-18 12:19 
Hi,

Im trying to send "1C0" thru serial port to a device, and the device is responding and are sending back "52" in TeraTerm.
But with this code, the device is responding to the sent request, but I get this error and the answer of "52" is not shown in the program.
What is wrong?

C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ArduinoSerialTemp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            serialPort1.BaudRate = 9600;
            serialPort1.PortName = "COM44";
            serialPort1.Open();

            serialPort1.Write("*1C0");
            serialPort1.Write("\r");

            serialPort1.DataReceived += serialPort1_DataReceived;
        }

        private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
        {
            string line = serialPort1.ReadLine();
            this.BeginInvoke(new LineReceivedEvent(LineReceived), line);
        }

        private delegate void LineReceivedEvent(string line);
        private void LineReceived(string line)
        {
            textBox1.Text = line;
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (serialPort1.IsOpen) serialPort1.Close();
        }

        private void serialPort1_ErrorReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
        {
            serialPort1.Close();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }
    }

}

AnswerRe: System.IO.IOException: 'The I/O operation has been aborted because of either a thread exit or an application request Pin
OriginalGriff11-Jan-18 12:25
mveOriginalGriff11-Jan-18 12:25 
AnswerRe: System.IO.IOException: 'The I/O operation has been aborted because of either a thread exit or an application request Pin
Bernhard Hiller11-Jan-18 22:35
Bernhard Hiller11-Jan-18 22:35 
GeneralRe: System.IO.IOException: 'The I/O operation has been aborted because of either a thread exit or an application request Pin
Member 1058555812-Jan-18 4:19
Member 1058555812-Jan-18 4:19 
AnswerRe: System.IO.IOException: 'The I/O operation has been aborted because of either a thread exit or an application request Pin
Luc Pattyn12-Jan-18 6:16
sitebuilderLuc Pattyn12-Jan-18 6:16 
GeneralRe: System.IO.IOException: 'The I/O operation has been aborted because of either a thread exit or an application request Pin
Member 1058555812-Jan-18 7:31
Member 1058555812-Jan-18 7:31 
GeneralRe: System.IO.IOException: 'The I/O operation has been aborted because of either a thread exit or an application request Pin
Luc Pattyn12-Jan-18 7:46
sitebuilderLuc Pattyn12-Jan-18 7:46 
QuestionC# How can I center the PictureBox to the Parent from code? ( Windows Forms ) Pin
Karl Henrry11-Jan-18 11:27
Karl Henrry11-Jan-18 11:27 
AnswerRe: C# HOW CAN I CENTER THE PICTUREBOX TO THE PARENT? Pin
Pete O'Hanlon11-Jan-18 11:45
subeditorPete O'Hanlon11-Jan-18 11:45 
GeneralRe: C# HOW CAN I CENTER THE PICTUREBOX TO THE PARENT? Pin
Karl Henrry11-Jan-18 13:26
Karl Henrry11-Jan-18 13:26 
AnswerRe: C# HOW CAN I CENTER THE PICTUREBOX TO THE PARENT? Pin
OriginalGriff11-Jan-18 12:14
mveOriginalGriff11-Jan-18 12:14 
GeneralRe: C# HOW CAN I CENTER THE PICTUREBOX TO THE PARENT? Pin
Karl Henrry11-Jan-18 13:41
Karl Henrry11-Jan-18 13:41 
AnswerRe: C# How can I center the PictureBox to the Parent from code? ( Windows Forms ) Pin
User 740747011-Jan-18 14:52
User 740747011-Jan-18 14:52 
GeneralRe: C# How can I center the PictureBox to the Parent from code? ( Windows Forms ) Pin
Karl Henrry11-Jan-18 15:12
Karl Henrry11-Jan-18 15:12 
QuestionBest Temporary storage for DataGrid in C# Pin
Member 1359640810-Jan-18 14:17
Member 1359640810-Jan-18 14:17 
AnswerRe: Best Temporary storage for DataGrid in C# Pin
OriginalGriff10-Jan-18 20:51
mveOriginalGriff10-Jan-18 20:51 
AnswerRe: Best Temporary storage for DataGrid in C# Pin
Eddy Vluggen11-Jan-18 2:03
professionalEddy Vluggen11-Jan-18 2:03 
Questionc# Introduction Pin
ormonds10-Jan-18 11:39
ormonds10-Jan-18 11:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.