www.panelsoft.com

 

 

 

Home

Training

Reading

PanelSoft

User Interfaces and Usability for Embedded Systems


Feedback to "User Interface Prototypes"- Murphy's Law, October 2002

Read the original artilce at User Interface Prototypes

return to Murphy's Law


From:Jon Buckman
Sent: Tuesday, October 15, 2002 4:57 PM
Subject: serial com
Mr. Murphy,
Enjoyed the article in the latest ESP. I am trying to gather up some info on configuring/using the serial communications port with BCB. Any suggestions of articles/books?
Thanks.
Jon Buckman

Niall's Reply

Jon,
There are two main approaches to serial commms in BCB. One is to use the win32 API, which makes opening the serial port a bit like opening a file. See http://www.traverse.com/people/poinsett/bcbcomm.html for more details. The second approach is to get a BCB object which you can install and then set things like the baud rate as properties on the object. On one project we used ctv50.zip which is available from http://www.developpez.com/c/freewares.htm (which is in french!!). As far as I can make out the original of this is not supported and the authors web site is gone, but the french site is a mirror. There are other components around, some are commercial.

I hope this points you in the right direction.

regards
Niall Murphy

 


I've really enjoyed your articles on prototyping embedded systems with Borland C++. I've done similar things in the last few years using National Instrument's LabWindows/CVI. In case your not familiar with it, CVI is a companion product to LabView, the graphical programming language. The difference is that CVI is a C programming environment, kind of like a Visual Basic for C. I first used CVI about five years ago to develop a test stand for the production floor, but I soon realized that I could use it for simulating embedded systems and, more importantly, for debugging embedded code before my target hardware became available. There are several things that make CVI particularly suited to simulating embedded systems:

First, you can easily incorporate external hardware as part of your simulation. For example, let's say your application monitors an analog signal from another system. Using an analog input card and a simple CVI library call, your simulation can read the actual signal. Another example is an embedded system which talks to some device via CAN bus. You can start your development with a simple user interface that allows you to construct CAN bus messages that can be "sent" to your application. Once you have that working, you can replace your user interface calls with calls to an actual CAN bus card that is attached to the external device.

Second, CVI provides several run-time services (like array boundary checking). When CVI detects one of these errors, it immediately breaks the program on the offending line. This makes it much easier to find application-specific problems before you start integrating hardware and software.

Third, CVI provides a variety of user interface controls that are designed to look like actual hardware including LEDs, thermometers, knobs, gauges, meters, and binary switches in several shapes and sizes. Oftentimes I can take an image of the actual device (either from a picture of a physical prototype or from the mechanical designer's rendering software) and overlay it with LEDs, knobs, switches, and other controls. With careful attention to coloring and placement (and with some touch ups in PaintShop), the user interface often appears to be a photograph of the final product.

Thanks again for the excellent articles!

Tony Gray
Invensys Climate Controls


From: "Riordan.Brian"
Subject: Borland C++ Builder/Embedded Systems article

I just finished reading your article on User Interface Prototypes. I've used Visual Basic to do this in the past, and have just started to experiment with Borland C++ Builder. Can you recommend any good books or websites to learn about the UI/controls part of BCB? I have a fair amount of experience with C and assembly for embedded systems, and some with C++. Displaying a simple interface was > mostly intuitive with BCB. But something that described each control and it's usage/interface would be really helpful.

Thanks,
Brian

Niall's Response

Lots of people use VB - I have never used it myself, but I always felt that it would be harder to integrate the bits of the code that I wanted to write in C (for later porting to the target). In VB I think you can communicate with DLL's written in C, but I do not know how messay that gets.

Getting used to the objects in Borland C++ builder takes some getting used to. When I bought version £ I got a Sams "Teach Yourself C++Builder in 14 Days" with it, but when I later bought version 5 the Sams book was "Teach Yourself C++ in 5 Days" - a lot smaller and less stuff about the VCL compnents, so I somettimes use the book from version 3, even if it is a bit out of date. I find that most of the time when I want to know about a specific object, or a particular property I just select one of the objects on a form in the IDE and press F1 for help - make sure you check the methods as well as the properties, since there are often things that you can change at run time that are not presented on the IDE.

I sometimes check the C++ FAQ from the Borland site, but that is not great - and a lot of the questions and answers relate to very old versions for Windows 3.1 and the like.

For embedded type interfaces I find myself using a small subset of the available objects in any case. I end up using the TImage object for a large variety of things, but then you probably gathered that from the column.

regards,
Niall Murphy


[PanelSoft Home | Training Courses ]