serial port data read
-
hi' am developing project on hand held system,my view is : select the file(excel)by clicking browse. then click on upload. here it's going to that device but after receiving data that device needs to send "$OK#" back to my program how can i receive that . plz help how to do tha
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Excel=Microsoft.Office.Interop.Excel;
using System.IO;
using System.Threading;
using System.IO.Ports;namespace Hand_Held_Data_Transporter
{
public partial class Form1 : Form
{
int[] stream_buffer;/\*private static Microsoft.Office.Interop.Excel.Workbook mWorkBook; private static Microsoft.Office.Interop.Excel.Sheets mWorkSheets; private static Microsoft.Office.Interop.Excel.Worksheet mWSheet1; private static Microsoft.Office.Interop.Excel.Application oXL;\*/ public Form1() { InitializeComponent(); progressBar1.Enabled = false; progressBar2.Enabled = false; serialPort1.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(serialPort1\_DataReceived); } private void Browse\_Click(object sender, EventArgs e) { OpenFileDialog fdlg = new OpenFileDialog(); fdlg.Filter = "All Files(\*.\*)|\*.\*"; if (fdlg.ShowDialog() == DialogResult.OK) { textBox1.Text = fdlg.FileName; File.ReadAllText(textBox1.Text); } } private void Upload\_Click(object sender, EventArgs e) { // StringBuilder sb = new StringBuilder(); Excel.Application xlApp = new Excel.Application(); Excel.Workbook xlWorkbook = xlApp.Workbooks.Open(textBox1.Text, 0, true, 5, "", "", true, Excel.XlPlatform.xlWindows, "\\t", false, false, 0, true, 1, 0); Excel.\_Worksheet xlWorksheet = (Excel.\_Worksheet)xlWorkbook.Sheets\[1\]; Excel.Range xlRange = xlWorksheet.UsedRange; int rowCount = xlRange.Rows.Count; int colCount = xlRange.Columns.Count; progressBar1.Visible = true; int k = 100 / rowCount; for (int i = 1; i <= rowCount; i++) { String
-
hi' am developing project on hand held system,my view is : select the file(excel)by clicking browse. then click on upload. here it's going to that device but after receiving data that device needs to send "$OK#" back to my program how can i receive that . plz help how to do tha
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Excel=Microsoft.Office.Interop.Excel;
using System.IO;
using System.Threading;
using System.IO.Ports;namespace Hand_Held_Data_Transporter
{
public partial class Form1 : Form
{
int[] stream_buffer;/\*private static Microsoft.Office.Interop.Excel.Workbook mWorkBook; private static Microsoft.Office.Interop.Excel.Sheets mWorkSheets; private static Microsoft.Office.Interop.Excel.Worksheet mWSheet1; private static Microsoft.Office.Interop.Excel.Application oXL;\*/ public Form1() { InitializeComponent(); progressBar1.Enabled = false; progressBar2.Enabled = false; serialPort1.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(serialPort1\_DataReceived); } private void Browse\_Click(object sender, EventArgs e) { OpenFileDialog fdlg = new OpenFileDialog(); fdlg.Filter = "All Files(\*.\*)|\*.\*"; if (fdlg.ShowDialog() == DialogResult.OK) { textBox1.Text = fdlg.FileName; File.ReadAllText(textBox1.Text); } } private void Upload\_Click(object sender, EventArgs e) { // StringBuilder sb = new StringBuilder(); Excel.Application xlApp = new Excel.Application(); Excel.Workbook xlWorkbook = xlApp.Workbooks.Open(textBox1.Text, 0, true, 5, "", "", true, Excel.XlPlatform.xlWindows, "\\t", false, false, 0, true, 1, 0); Excel.\_Worksheet xlWorksheet = (Excel.\_Worksheet)xlWorkbook.Sheets\[1\]; Excel.Range xlRange = xlWorksheet.UsedRange; int rowCount = xlRange.Rows.Count; int colCount = xlRange.Columns.Count; progressBar1.Visible = true; int k = 100 / rowCount; for (int i = 1; i <= rowCount; i++) { String
Arduino, C#, and serial interface[^] Serial Comms in C# for Beginners[^] SO[^] Now you got the knowledge sources, start thinking and being productive!
Veni, vidi, caecus