locked
Connecting to Microchip PIC with windows user inteface RRS feed

  • Question

  • Hello Everyone

    I need a bit of help, I need to try and get a windows form application coded up to import and export HEX data via the serial port to communicate with a PIC.

    My experience with coding in c# is very basic, so I will need some help with coding the Windows form through the serial port and achieve the following instructions:

    • Export single bytes in a HEX format, the input will be from a text box in Decimal. For example "89" inserted into text box, 0x59 sent through the serial port (on button input).
    • Read input buffer from serial port as HEX, then convert to Decimal and display in a text box. (on button input)
    • Read Multiple HEX values from buffer, have the ability to store these values as Decimals in a CSV format (perhaps needing SQL?).
    • Read the data from the CSV and plot into a graph XY

    Can anyone help me with getting started? I am happy to do the graphical layout of the form.

    Thanks

    Friday, June 10, 2016 11:02 AM

Answers

  • Hi Lord Grezington,
    >>I need a bit of help, I need to try and get a windows form application coded up to import and export HEX data via the serial port to communicate with a PIC.

    You could refer to the following links to learn more about serial port send and receive data:

    SerialPort Class
    SerialPort (RS-232 Serial COM Port) in C# .NET

    >>•Read input buffer from serial port as HEX, then convert to Decimal and display in a text box. (on button input)
    About convert the numeric to hex, you could take a look at following article:

    How to: Convert Between Hexadecimal Strings and Numeric Types (C# Programming Guide)

    >>•Read Multiple HEX values from buffer, have the ability to store these values as Decimals in a CSV format (perhaps needing SQL?).

    If you want to use csv format to store the data, you could take a look at the below link(use IO, not need sql):

    Reading and Writing CSV Files in C#

    >>•Read the data from the CSV and plot into a graph XY

    About draw the graphic, you could use chart control or gdi to achieve you requirement:

    Tutorial: Creating a Basic Chart
    GDI+ Graphics

    Reference link:

    System.IO Namespace

    Regards,
    Moonlight

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, June 13, 2016 1:58 AM

All replies

  • Hi Lord Grezington,
    >>I need a bit of help, I need to try and get a windows form application coded up to import and export HEX data via the serial port to communicate with a PIC.

    You could refer to the following links to learn more about serial port send and receive data:

    SerialPort Class
    SerialPort (RS-232 Serial COM Port) in C# .NET

    >>•Read input buffer from serial port as HEX, then convert to Decimal and display in a text box. (on button input)
    About convert the numeric to hex, you could take a look at following article:

    How to: Convert Between Hexadecimal Strings and Numeric Types (C# Programming Guide)

    >>•Read Multiple HEX values from buffer, have the ability to store these values as Decimals in a CSV format (perhaps needing SQL?).

    If you want to use csv format to store the data, you could take a look at the below link(use IO, not need sql):

    Reading and Writing CSV Files in C#

    >>•Read the data from the CSV and plot into a graph XY

    About draw the graphic, you could use chart control or gdi to achieve you requirement:

    Tutorial: Creating a Basic Chart
    GDI+ Graphics

    Reference link:

    System.IO Namespace

    Regards,
    Moonlight

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, June 13, 2016 1:58 AM
  • Thank you Moonlight.

    It will take some time to digest all this information and make a start on the project. If I run into any problems I will be back....

    Regards

    Monday, June 20, 2016 8:22 AM