View previous topic :: View next topic |
Author |
Message |
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
PC programming language |
Posted: Mon Jan 10, 2005 8:18 am |
|
|
Someone asked me in a private message what I use to program GUI interfaces on a PC to communicate with my PICs. I thought my reply might be of general interest:
I do very little PC programming. When I do I use my trusty copy of QuickBASIC 4.0. QuickBASIC is DOS based and doesn't even support a mouse, but it does what I need.
I have been meaning to come foreward into the 1990's but haven't found a language I like yet. I tried Visual BASIC but found it incredibly cumbersome. My first program only needed to get data from one serial port, apply some calibration constants from a file, and send the result out a second serial port. After many frustrating hours I asked a professional programmer for help (I am primarily an analog engineer). He spent an hour or two struggling with VB before he gave up and wrote me some C subroutines to call from VB to get the serial timing right. That convinced me that VB is hopeless.
Since then I have read some about Borland C and Java, but neither get the job done as quickly and easily as QuickBASIC. What do other people on the list use? _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1933 Location: Norman, OK
|
I use Delphi |
Posted: Mon Jan 10, 2005 8:50 am |
|
|
SherpaDoug,
I use Borland Delphi 8 NET Pro.
However, I must agree with you that Quickbasic is cleaner and much simpler for a task like this!
I have both MS Visual Basic and Visual C++ and dont use either one of them... I dont like the interfaces nearly as well as I like Delphi.
In Delphi I can create a complete GUI interface in an hour or less (twenty minutes if I steal code from one of my earlier projects :-).
Dave
Last edited by dyeatman on Mon Jan 10, 2005 8:53 am; edited 1 time in total |
|
|
Darren Rook
Joined: 06 Sep 2003 Posts: 287 Location: Milwaukee, WI
|
|
Posted: Mon Jan 10, 2005 8:52 am |
|
|
I don't like Delphi, but apparently it is very popular in this industry for PC development. The main reason being it's quick and easy - which is fine because I guess we have to spend more time on firmware on hardware to care about the peculariaties of a PC programming language. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Mon Jan 10, 2005 8:56 am |
|
|
Not sure why you had so much trouble with serial comms unless it was before the mscomm control. But I like VB for the task. |
|
|
Hans Wedemeyer
Joined: 15 Sep 2003 Posts: 226
|
For PC and PocketPC |
Posted: Mon Jan 10, 2005 9:07 am |
|
|
For PC…. Windows 98, NT or XP
Microsoft Visual Studio C++ (VC++).
I still use VC++ 6.0 for quick programs, only because the IDE is far more friendly than VS.NET.
I do use Visual Studio.NET C++ but do not like the IDE, it's a result of Microsoft's effort to make thing more productive. In truth it’s a mistake, you know: It’s not broken don’t fix it, so they fixed it anyway.
VC++ is a C++ compiler, but if you prefer simpler C it’s OK, just write normal C code and it compiles OK.
For anyone needing a quick and cheap way into Windows programming there are plenty of legal Visual Studio 6.0 (don’t get less than Ver. 6.0) for sale on eBay.
Microsoft does support the Visual Studio line of development tools fairly well, upgrades i.e. service packs are free. Lots of code and good peer support.
With Visual Studio comes VBasic, VFoxpro, and VJava etc. They need not be installed.
VS.NET also delivers C# it’s OK but like all RAD environments it keeps the user away from the machine.
For handheld running Windows CE of various types:
The Freebee eVC3.0 or 4.0 from Microsoft. The IDE is a version of Visual Studio 6.0.
Updates are free. |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Mon Jan 10, 2005 9:18 am |
|
|
Mark wrote: | Not sure why you had so much trouble with serial comms unless it was before the mscomm control. But I like VB for the task. |
It was a few years ago but as I recall I needed to send ^C periodically to a device to wake it up. Then when it responded I had to send other commands waiting specific amounts of time between commands depending on what the replies were. The VB timers did not work as described in the manual. It was a painful experience. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Mon Jan 10, 2005 9:37 am |
|
|
SherpaDoug, Your right about VB. From my experience, VB timers can't be set to a hard value,... 10mS +or- 2 mS.
It can't be done.
It is just not the way VB works.
That being said, we use vb and c#. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Mon Jan 10, 2005 10:00 am |
|
|
treitmey wrote: | SherpaDoug, Your right about VB. From my experience, VB timers can't be set to a hard value,... 10mS +or- 2 mS.
It can't be done.
It is just not the way VB works.
That being said, we use vb and c#. |
That's because you aren't doing it right
VB can be very powerful with the use of the Windows API. Anyone doing VB programming should get a copy of Dan Appleman's Visual Basic Programmers Guide to the Win32 API.
For your timer example, I would use the following Win API functions
Code: | Public Declare Function SetTimer Lib "user32" _
(ByVal hwnd As Long, ByVal nIDEvent As Long, _
ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" _
(ByVal hwnd As Long, ByVal nIDEvent As Long) As Long |
This will give me a callback to a function when the elaspe time has ended. |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Mon Jan 10, 2005 12:04 pm |
|
|
thanks |
|
|
Guest
|
|
Posted: Mon Jan 10, 2005 12:37 pm |
|
|
SherpaDoug wrote: | Mark wrote: | Not sure why you had so much trouble with serial comms unless it was before the mscomm control. But I like VB for the task. |
It was a few years ago but as I recall I needed to send ^C periodically to a device to wake it up. Then when it responded I had to send other commands waiting specific amounts of time between commands depending on what the replies were. The VB timers did not work as described in the manual. It was a painful experience. |
Use a Multimedia timer, it has a resolution of 1mS on Windows 98 NT Win2K and XP. |
|
|
Kieran
Joined: 28 Nov 2003 Posts: 39 Location: Essex UK
|
|
Posted: Tue Jan 11, 2005 6:02 am |
|
|
I use Borland C++ builder 6 personal edition with Turbopower Async Pro for serial comms which is now open source from Sourceforge. Recently I added TWsocket (freeware) which made some Ethernet testing on a PIC project dead easy!
I have used VB but find it very cumbersome.
Recently tried VC++.net which resembles the Borland product. |
|
|
John P
Joined: 17 Sep 2003 Posts: 331
|
|
Posted: Tue Jan 11, 2005 11:32 am |
|
|
I use Jacob Navia's free (for non-commercial use) C compiler, LCC. You can get it off the Internet at
http://www.cs.virginia.edu/~lcc-win32/
After laboring with other ways to write code for the PC I was happy to find this! Possibly not the most sophisticated environment, but it works fine for me. It has the feature that it'll set up a skeleton program for you based on a series of selection screens, handling most of the Windoze mickey-mouse code so you don't have to understand what the hell it's playing at.
Also I don't know how anyone can write C code for Windows without the book Programming Windows by Charles Petzold. |
|
|
karth
Joined: 10 Sep 2003 Posts: 29
|
Delphi, VB.NET, C#, Borland C++ |
Posted: Tue Jan 11, 2005 2:35 pm |
|
|
All programs are good if you know what you are doing. I prefer C# personally |
|
|
|