Click here to Skip to main content
15,895,841 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all,

I'm creating an application to read the data from Nonin 3150 bluetooth device in C# VS 2008. However, the output of the data is not in a readable format (Strange format) Please kindly guide me on how do I change the format so that end user able to see the output.



Here's the code to read the comm port.
C#
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 System.IO.Ports;


        private delegate void setTextDeleg(string text);
        public delegate void myDelegate();

       

        SerialPort serialPort = new SerialPort();
        

        private void Form1_Load(object sender, EventArgs e)
        {
            string[] portname = SerialPort.GetPortNames();
            foreach (string name in portname)
                comboBox1.Items.Add(name);

        }

        private void button1_Click(object sender, EventArgs e)
        {

            if (this.comboBox1.SelectedIndex == -1)
            {
                MessageBox.Show("Please select comm port first!");
            }

            else
                if (serialPort.IsOpen)
                    serialPort.Close();

            try
            {

                {
                    serialPort.PortName = comboBox1.Text;
                    serialPort.BaudRate = 9600;
                    serialPort.Parity = Parity.None;
                    serialPort.DataBits = 8;
                    serialPort.StopBits = StopBits.One;
                    serialPort.Encoding = System.Text.Encoding.ASCII  ;
                   
                }

                serialPort.Open();
                label1.Text = comboBox1.Text + " is opened";
               // textBox1.Text = 
                
                serialPort.DataReceived += new SerialDataReceivedEventHandler(datareceived);
               
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }

        void datareceived(object sender, SerialDataReceivedEventArgs e)
        {
            myDelegate d = new myDelegate(update);
            textBox1.Invoke(d, new object[] { });

                    }

        public void update()
        {
            textBox1.AppendText(serialPort.ReadExisting());
            textBox1.ScrollToCaret();
        }
    }
}




Thanks much!

Cheers~
Posted
Updated 7-Dec-11 22:14pm
v2
Comments
Smithers-Jones 8-Dec-11 4:15am    
Added code-block.

1 solution

Contact Nonin direct from their product information hints at a Preparatory file format. They have a tech support email : info@nonin.com
 
Share this answer
 
Comments
Albert Holguin 8-Dec-11 10:20am    
Preparatory file format? You mean proprietary?
Derek Henderson 8-Dec-11 10:27am    
Yes I meant proprietary .... didn't think there would be any "spelling police" on line. The message can still be interpreted.
Albert Holguin 8-Dec-11 10:38am    
That's not just a misspelling, it's a completely different word. I'm just pointing it out so you don't sound like an arse online.
fahfahfah 8-Dec-11 21:14pm    
I'm reading the product documentation online, however i'm still unsure which byte is used to send the pulse data so that I could convert the byte to float i guess?

kindly advised.

http://www.nonin.com/documents/3150-Specifications_7970-000-Rev-A.pdf[^]
Derek Henderson 9-Dec-11 5:27am    
Which data format are you using ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900