Author Topic: Which Programming Language for Creating PC UIs for Embedded Systems?  (Read 9831 times)

0 Members and 1 Guest are viewing this topic.

Offline Syntax_ErrorTopic starter

  • Regular Contributor
  • *
  • Posts: 204
  • Country: us
So, I'll try and be concise, but I tend toward verbosity, so...

Which programming language would be beneficial to learn to efficiently create host PC-based user interfaces (graphical and nongraphical) that communicate via COM ports to embedded hardware? I'm mostly talking about rather simple, straightforward window-based (not necessarily MS Windows-based) UIs with buttons, sliders, fields, etc. that communicates via PC ports to appliance hardware. Commands sent by UI software, data sent back by embedded system, outputs plotted graphically, etc.

I have zero experience with this, so it is pretty much blank slate. I have some novice experience with Python and C. C proficiency will be increasing over time. I'm looking for something that would be quick to employ once I got my basic proficiency. Bonus would be OS-agnostic during runtime, but not a strict requirement.

I sometimes see other people with amazing hardware projects that involve PC control (and display/user interface) and wonder how they go about making the PC-side of things. I'm sure there's more than one way to go about this, so I'm not really looking for "the one true way" more just some brainstorming on ideas.

For example, I understand how Java uses a runtime environment and compiles to bytecode and how this lends itself toward platform compatibility. This seems interesting to me, but I wouldn't know enough to know how important this even is.
It's perfectly acceptable to not know something in the short term. To continue to not know over the long term is just laziness.
 

Offline Syntax_ErrorTopic starter

  • Regular Contributor
  • *
  • Posts: 204
  • Country: us
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #1 on: October 27, 2016, 03:54:43 am »
Thanks so much for the in-depth response. I actually am completely surprised by your suggestions and am doing much reading about wxWidgets.

So it seems wxWidgets is built on C++. The book I'm reading at

https://ptgmedia.pearsoncmg.com/images/0131473816/downloads/0131473816_book.pdf

says that although wxWidgets is a C++ framework/toolkit, many people learn both simultaneously. I'm sure some C++ is needed as a foundational prerequisite, though.

This seems very much like what I am looking for.
It's perfectly acceptable to not know something in the short term. To continue to not know over the long term is just laziness.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9886
  • Country: us
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #2 on: October 27, 2016, 03:58:43 am »
On the Windows end of things, I would use Visual Basic.  Forms are pretty much drag, drop and code the events.  Adding other platforms is pretty much out of the question for VB.  I would simply constrain my app to Windows and call it good.  It's easy to get an app up and running.

PyQt5 mixes Python coding with Qt5 windowing and should run on Linux and Windows (not sure about OSX).  I played with this a year or so back and it seemed to work pretty well.

Java is certainly a good possibility for cross-platform applications.

 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4067
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #3 on: October 27, 2016, 05:52:03 am »
I would recommend Qt. It's also c++, it has a company backing it so you will be able to buy support if you really need it.
For wxWidgets you need to be at least an experienced programmer because it not-at-all novice friendly.

Qt has the advantage that it can run on Windows and Linux if you intend this from the start.
It seems heavier than VB6 because it uses a bunch of dll files instead of built-in .NET.
With Qt Quick (not gpl) you can make fancy UI's. Such as EA Origin, or Eneco Toon.

It's not the fancy open source project anymore it was years ago.

If you're brave, you could consider Delphi. (yes, that still exists) They promise a lot. But you have to buy it first.
« Last Edit: October 27, 2016, 05:56:30 am by Jeroen3 »
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3452
  • Country: it
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #4 on: October 27, 2016, 06:06:23 am »
On the Windows end of things, I would use Visual Basic.  Forms are pretty much drag, drop and code the events.  Adding other platforms is pretty much out of the question for VB.  I would simply constrain my app to Windows and call it good.  It's easy to get an app up and running.

I've been using VB6 for more than a decade, and be honest, it is the only VB I've ever loved to use. Starting from .NET (VB7), it seems like VB.NET has no purpose compared to C#.
Unfortunately, VB6 IDE cannot run on Windows 7 or later without severe lagging, and VB6 compiled programs start to show issues with Windows 10, so I was forced to move to other platforms.
it may be depend but we code VB6 on seven with ZERO LAG. (compatibilty options -> disable themes)
and all our applications run without issues from XP to 10, though they all are interfaces for our products so they only use the virtual com module. no active x or stuff like that

what i really dig about visual studio: you don't have to have the manual open. every time you write something the the autocomplete shows up with useful informations like the implemented modules and then the possible outcomes. I tried to play around with WxWidgets and Qt but the lack of this function (or me being unable to enable it if present) made me reconsider, because then i would have to learn both C++ and the software lingo at the same time
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4067
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #5 on: October 27, 2016, 07:22:01 am »
WxWidgets and Qt are direct competitors. Both C++, and both are tools that when used right will get you something.
The main difference is Qt is an all-in IDE, and WxWidgets need more toolchain work and knowledge.

Both require C++, which isn't hard. It's the Object Oriented way of software design that is hard.
You don't need much experience, but this depends on the scale of your application.

You risk creating maintenance hell if you start doing this without proper plan or experience.
« Last Edit: October 27, 2016, 07:25:53 am by Jeroen3 »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12807
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #6 on: October 27, 2016, 08:09:29 am »
One of the advantages of C/C++ is that you can share selected project headers with the embedded application. e.g. the definitions for complex data structures.
 

Offline ElektroQuark

  • Supporter
  • ****
  • Posts: 1244
  • Country: es
    • ElektroQuark
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #7 on: October 27, 2016, 09:37:45 am »
Any advice for a starting tutorial for Dummies about both C++ and wxWidgets?

Offline Dielectric

  • Regular Contributor
  • *
  • Posts: 127
  • Country: 00
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #8 on: October 27, 2016, 01:27:53 pm »
I've been developing a small application that talks to two different COM ports to control some embedded hardware, with the requisite sliders, etc.  I'm using QT 5, mainly because their COM port handling is amazing (does a really nice job finding the port name under windows, for one).  But, deployment ends up being huge-ish.  My exe is around 500KB right now, but the support libraries baloon it to many megabytes.  I've done some wxWidgets stuff for giggles in the past, and all I remember is going through some headaches getting the versions matching so it ran correctly.  I think I ended up building from source, which seemed really ridiculous at the time.  wxSmith and CodeBlocks worked together fairly well.

It's all C++ but I'm being gross and writing my algorithm in C, while the GUI stuff is in C++.  I know, I'm a terrible person and fully expect to reside in a special circle in Hell.
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26751
  • Country: nl
    • NCT Developments
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #9 on: October 27, 2016, 01:57:41 pm »
If you're brave, you could consider Delphi. (yes, that still exists) They promise a lot. But you have to buy it first.
Delphi sucks badly especially cross-platform. One of my co-workers got a burn-out trying to port an application and I had to take over. -insert massive barf emoticon-.

I second the suggestion for WxWidgets. I have written several PC and embedded Linux applications for customers using WxWidgets as a cross-platform framework. You have to buy the book though as a reference manual. What is nice about WxWidgets is that it also deals with the idiotics things in the underlying OS and offers a lot of nice features on top of it. For example a filename class which makes it easy to get the path, filename, extension, full path, etc from a filename. Also the API has been pretty stable over the years so existing code can be compiled with newer versions of WxWidgets if you want.
« Last Edit: October 27, 2016, 01:59:28 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: 00
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #10 on: October 27, 2016, 02:17:38 pm »
Definitely Qt.
It's the only one that's really cross-platform.
Apart from the widgets (GUI) library, it's a complete C++ framework including libraries for COM ports and Bluetooth.
Support and documentation is the best.
You can use Qt under the LGPL license, also for commercial closed source programs or you can buy a commercial license if you want payed support.
Downside is that you need to understand at least the basics of C++.

GTK is C based and in theory cross-platform but in practice it's very hard to setup on windows, at least for beginners.

Whichever you choose, if you have never used it before, don't expect to master it quickly.

 

Offline @rt

  • Super Contributor
  • ***
  • Posts: 1051
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #11 on: October 27, 2016, 02:29:30 pm »
You could take a look at some PC control programs for amateur radios. They usually duplicate the controls of a transceiver, and add a bit more functionality, and control the hardware over serial port.
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #12 on: October 27, 2016, 02:41:15 pm »
+1 Qt unless you have any specific reason for not using it.
« Last Edit: October 27, 2016, 02:48:25 pm by Kalvin »
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9886
  • Country: us
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #13 on: October 27, 2016, 02:42:40 pm »
I have Visual Studio Community Edition 2015 (free).  It took less than 5 minutes to create a VB project with a default main window and drop a serial port object on it.
I didn't pursue it beyond that point.

Some years back, I wanted a little app to select files from a list and put them into another list and then send the files in the second list out over the serial port.  I don't recall having any problem doing this with very little effort.  The idea was to emulate a card reader and the files were decks of cards to be read in sequence.  Pretty easy to do.

And totally non-portable to Linux or OSX.

I'm not walking away from Windows 7 or 10 any time soon.  Linux has a place around here but I'm not going to complicate matters by forcing cross-platform compatibility where it isn't necessary.  I'm lazy!  I want the results and I want them right now!
 

Offline elgonzo

  • Supporter
  • ****
  • Posts: 688
  • Country: 00
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #14 on: October 27, 2016, 02:49:28 pm »
+1 Qt unless you have any specific reason for not using it.
Ditto. I second the suggestion of Qt...
« Last Edit: October 27, 2016, 03:04:18 pm by elgonzo »
 

Offline edm68

  • Newbie
  • Posts: 7
  • Country: us
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #15 on: October 29, 2016, 05:51:58 am »
I saw VB6 was mentioned. I don't know if this does what you need but B4J seems very similar to VB6. And it's free.
I use B4A from the same developer and am impressed with it.
You might want to check it out - https://www.b4x.com/b4j.html
 
The following users thanked this post: blueskull

Offline ChunkyPastaSauce

  • Supporter
  • ****
  • Posts: 539
  • Country: 00
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #16 on: October 29, 2016, 06:28:52 am »
LabView will also do it but $$$$

[but ... expensive]
« Last Edit: October 29, 2016, 09:57:04 am by ChunkyPastaSauce »
 

Offline Dago

  • Frequent Contributor
  • **
  • Posts: 659
  • Country: fi
    • Electronics blog about whatever I happen to build!
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #17 on: October 29, 2016, 06:31:38 am »
Definitely Qt, it is very very nice for creating UIs and it includes a LOT of other useful stuff as well (serial port handling, ethernet stuff, database stuff etc etc etc.), easy to use too. It doesn't even force you to use the IDE in any way if you don't want to (I personally don't use IDEs, Qt is simple to integrate to a project with a few lines of cmake). And like others said it really is cross platform and requires pretty much exactly 0 lines of extra code to run on Linux or Windows.
« Last Edit: October 29, 2016, 06:34:28 am by Dago »
Come and check my projects at http://www.dgkelectronics.com ! I also tweet as https://twitter.com/DGKelectronics
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: 00
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #18 on: October 29, 2016, 06:52:48 am »
LabView will also do it but ...

... it's terrible.

And it requires a very heavy run-time environment, worse than dotnet or Java.
 

Offline julianhigginson

  • Frequent Contributor
  • **
  • Posts: 783
  • Country: au
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #19 on: October 29, 2016, 08:45:05 am »
+1 QT.
it's very comprehensive and lots of people know all about it. you'll find lots of example stuff out there.

yes, probably a bit bloated, but an app for setting/modifying options in an embedded device doesn't normally need to be blazing fast.

if you just want windows GUI, c# is a pretty powerful thing.
(someone told me recently that c# is possible to target Linux, but not using visual studio?? some third party thing??but I honestly have no personal experience with this one and haven't taken any time to even check this... just mentioning it as a maybe)
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 26751
  • Country: nl
    • NCT Developments
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #20 on: October 29, 2016, 08:57:28 am »
And totally non-portable to Linux or OSX.
Why? Unless you have used some evil M$ exclusive WPF or DWM technology, WinForms plus basic core features of .NET up to 4.5 should be supported by Mono.
The magic word in the above is 'should be'. Knowing Microsoft you have to be very carefull with the objects you use and if you only have basic features available you might find yourself with a very limited environment. It will be a world of pain based on what I have seen from .NET for Windows CE. The best choice for cross-platform is Qt or WxWidgets and you don't have to use C++ because (AFAIK) both have bindings for other languages.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online kripton2035

  • Super Contributor
  • ***
  • Posts: 2572
  • Country: fr
    • kripton2035 schematics repository
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #21 on: October 29, 2016, 09:39:19 am »
take a look at Xojo. works natively for windows, linux, mac, and even raspberry pi. (and iOS and android sooner or later)
 

Offline ChunkyPastaSauce

  • Supporter
  • ****
  • Posts: 539
  • Country: 00
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #22 on: October 29, 2016, 09:54:29 am »
LabView will also do it but ...

... it's terrible.

And it requires a very heavy run-time environment, worse than dotnet or Java.

Oh, that was supposed to say "LabView will also do it but expensive" (for smaller work anyway).

IMO Labview is pretty good for what it's meant for...... but it is terrible for stuff it's not meant for though. Creating a standardized PC UI interface for an embedded device, is one thing it's meant for.

The default run-time is heavy/large because it contains all libraries and interfaces (a ton)... you can of course setup a build specification to remove what you don't use, bringing it to a typical run-time size (or segment manually if one wants to reduce it further).

« Last Edit: October 29, 2016, 09:58:31 am by ChunkyPastaSauce »
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6459
  • Country: nl
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #23 on: October 29, 2016, 10:04:23 am »
Reading the other suggestions I am probably outdated.
Still I see for win only a lot of C# with .net development, is that going to end soon?
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: nz
Re: Which Programming Language for Creating PC UIs for Embedded Systems?
« Reply #24 on: October 29, 2016, 10:58:46 am »
If you're brave, you could consider Delphi. (yes, that still exists) They promise a lot. But you have to buy it first.

You can get full version Delphi Starter edition totally free at the moment, they have a sale on.
It doesn't have any database components and you don't get the cross platform or mobile ios/android support though. Just get win32 development.
However you do get firemonkey, so can create some pretty fancy 3D UI's if you wish.

For com port stuff the easiest way would be to install one of the 3rd party com port component libraries.
That way its just, drag component onto form, and use one of the events to grab the serial data from the serial buffer. Saves having to deal with the windows API yourself.

I've not tried 3rd party component libraries with delphi Starter Edition though. But afaik you can still do that.
« Last Edit: October 29, 2016, 11:04:53 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf