Recommend a language

Discussion in 'General Electronics Chat' started by bug13, Jul 3, 2013.

  1. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    Hi guys

    What is the easier language to learn to interface to rs232 and USB port on a PC(windows environment), I don't need fancy stuff, all I need is read and send datas, and to some calculation.

    GUI app is prefer.

    I only know C, and touch on some other languages a bit.

    Thanks
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    I'd vote for Visual Basic, either version 6 if you can still get it, or the latest dot-net version which is freely downloadable from Microsoft.
     
    bug13 likes this.
  3. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    I'd probably say C#. Coupled with the .Net framework, C# can do a lot! I actually started in C# to do what you are describing. I wrote a simple program to transmit certain commands over to a PIC to control some LEDs. I suggest C# since you already know C, and the syntax, minus the object-oriented part, is largely the same.

    Python has some plugins, the PySerial package comes to mind, that can access a serial port, and I'm sure there are libraries to support USB.
     
    bug13 likes this.
  4. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    What IDE are you using with C#? Any good free one?
     
  5. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    I'm using Visual Studio 2010, there its a free C# express(or similar) available from Microsoft.

    I've also heard of an open-source IDE and compiler for C#...
     
    bug13 likes this.
  6. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    I can properly stat at VB within 30mins (done it before), but what do I need to learn before I can write some simple GUI app with C#? not talking to RS232 or USB at this stage, just simple Hello World!

    I teach myself a bit C++ on windows before, the windows handling thing seem to give me a headache the last time I tried to learn it.
     
  7. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    To "read and send datas" you don't really need any language.

    You can get little freeware PC programs that will send a text file (or binary file) out the serial/USB port, and will record any incoming text or binary data from the serial/USB port to another file.

    That's all you need to do datalogging or data transmission (from the PC end).

    Then from a received data file you can chart it in Excel or another spreadsheet, complete with indicators or text markings etc.
     
    bug13 likes this.
  8. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    I am thinking more of off load the heavy duty job to the PC and control the stuff with a MCU in real time (or at least as fast as possible).

    But thanks for your tips :)
     
  9. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Well, using the .NET framework, 45 seconds!:)

    No, Seriously, there is a designer tool built in that allows you to drag and drop components(called controls) onto the window. WindowsForms(WinForms) is probably easiest, and WPF(Windows Presentation Foundation) is a bit more of a learning curve, but is extremely powerful. I'd recommend you start with WinForms....

    One of the controls in the WinForms toolbox(the place you drag controls from) is the SerialPort, allowing you to control the serial port, be it virtual or real. This, a RS232 to UART adapter and you can talk to a PIC in minutes(ideally;)).

    Tutorial:
    http://www.homeandlearn.co.uk/csharp/csharp_s1p5.html
     
    bug13 likes this.
  10. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    No, seriously, that's what I've been doing in Visual Basic for the last 20 years
     
  11. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    I never said it wasn't possible without it...
     
Loading...