EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Scripting tools under Windows

Started by Alf February 7, 2008


Alf wrote:
> >Like a lot of you I develop devices that need to be programmed, >configured and tested in a production environment, often in conjunction >with firmware test functions on the embedded device. Much of this is >accomplished from Windows PCs using serial and parallel ports and >usually involves running small utility programs. Naturally I want to >script these procedures to require the minimum amount of human >intervention, both for efficiencey and repeatability. > >Years ago, I used QuickBasic to quickly knock up this sort of script, >usually 1/2 an hour at most, a nice set of serial and parallel port >manipulation tools and easy to run little external apps (e.g. a bin2hex >utility). Of course QuickBasic is not compatible with modern Microsoft >OS's. > >My preference is for a simple language that does not have to produce >robust shrink-wrap code, isn't bloated with GUI stuff, has serial comms >with control over handshake lines, can control parallel port lines, can >send data to other apps and receive data from them, read and write files >and interact with the user via a console, and can be batched. It should >be capable of being modified by Windows programmers, embedded >programmers, hardware engineers and production techs without too much of >a learning curve - kind of leaves out huge APIs and frameworks.
PowerBASIC Command Console matches your description. (Make sure that PowerBASIC Command Console is the one you look at; there is another flavor of PowerBASIC that is more suited for GUI work -- you want PC/CC.) Please keep in mind that only Windows 3.x, 95, 98, and Me can read and write directly to the parallel port. For 2000, 2003, and XP, unless your chosen language contains a driver (not likely) you will need a driver such as: ParaPort: http://www.paraport.net/documentation/index.html PortTalk: http://www.beyondlogic.org/porttalk/porttalk.htm ParPort 2004: http://www.zeecube.com/ParPort2004.htm TVicPort: http://www.entechtaiwan.com/dev/port/index.shtm WinIO: http://www.internals.com/ ParIO: http://www.pcjunkie.cwc.net/ Also see: http://www.lvr.com/parport.htm#Programming I don't know if any of the above work on Vista. If you are using Vista to interface with embedded systems in a production environment, you need a brain transplant, not a programming langueage or device driver. :) -- Guy Macon <http://www.guymacon.com/> Guy Macon <http://www.guymacon.com/> Guy Macon <http://www.guymacon.com/> Guy Macon <http://www.guymacon.com/> Guy Macon <http://www.guymacon.com/> Guy Macon <http://www.guymacon.com/> Guy Macon <http://www.guymacon.com/> Guy Macon <http://www.guymacon.com/>
Alf wrote:
> So what scripting tools are you guys using out there?
Unix tools, like the gods intended... ;-> Cygwin works quite well once you've wrapped your head around its quirks. I usually escalate from bash to sed, to awk to perl, as needed.
> Years ago, I used QuickBasic to quickly knock up this sort of > script, usually 1/2 an hour at most, a nice set of serial and parallel > port manipulation tools and easy to run little external apps (e.g. a > bin2hex utility). Of course QuickBasic is not compatible with modern > Microsoft OS's.
There's VisualBasic and, more importantly, the Windows Scripting Host, which runs scripts written in either Basis or JScript. That's pretty much the official solution if you're on MS Windows.
Alf wrote:
> So what scripting tools are you guys using out there?
Ruby, see www.ruby-lang.org
David Brown wrote:
> I've read a fair number of different descriptions of different languages > over the years, but I've never seen anything as totally inaccurate as that! > > Python adds language features over *years*, not weeks - and it does so > with a very structured and safe system of deprecating old features (when > absolutely necessary) and gradually introducing new ones. >
Whoops, I really wasn't trying to troll for Serpentophiles, sorry.
> tcl/tk would be another alternative to consider if you have some sort of > snake allergy. >
There's one I'd completely forgotten about, must look it up again, been many years since I dallied with it. Thanks, Alf
David Brown wrote:
> Stephen Pelc wrote: > >> Sounds like Forth to me. Apart from being a Forth vendor, we eat our >> own dog food and do all this stuff easily. The commercial Forth > > > Forth is actually a lot like dog food - when you first try it, it's > horrible and repulsive.
LOL, that's GOLD! Being one of the fortunate few who was brought up on HP calculators, I quite enjoyed a dalliance with Forth in the embedded sphere some 20 years ago. Others though to seems a little backward it. Cheers, Alf
larwe wrote:
> On Feb 7, 5:47 am, Alf <alfk...@ieee.removetheobvious.org> wrote: > > >> Years ago, I used QuickBasic to quickly knock up this sort of script, >>usually 1/2 an hour at most, a nice set of serial and parallel port > > > When you are writing non-shippable lab code, your principal constraint > is ease of use. Therefore your #1 selection criteria should be > "similarity to stuff you've done before". > > If BASIC is your cup of tea, then perhaps you're best served by using > VB, though it's not really BASIC of the kind we used to know and love. > Microsoft makes a free version (Visual Studio Express) available. > > I tend to write this kind of code in C and use either Linux or Cygwin > depending on what the code actually needs to do. Really, the Windows > API for serial ports is not unreasonably complicated. >
Thanks, Lewin, Not much difference as far as I'm concerned, between VB and VC# (Express or otherwise). Still got to cope with that .NET framework and find your way through the gazillion functions that it offers. And its horrible serial port handling. I, too, have much of this stuff in C (my fave is still BC++ V4.51). Cheers, Alf
John Speth wrote:

> I would think the answer would be found not primarily on based on technical > merit but rather based on your personal preferences, strengths, and what > tools you have within easy reach. There are so many arguably good ways to > go. >
You're right, John, and it's not technicl merit I was considering. Certainly Quickbasic had very little of that. It's convenience and accessiblity. My "tools" these days are quite varied from techs through embedded assember and C programmers to Windows C++ and C# software developers. I'm looking for one ring to rule them all and in the scripting darkness bind them. If it was just for me, I'd stick with the familiar, gcc, C# or even Python. Cheers, Alf
In article <fofsbg$i63$00$1@news.t-online.com>,
=?ISO-8859-1?Q?Hans-Bernhard_Br=F6ker?=  <HBBroeker@t-online.de> wrote:
>Alf wrote: >> So what scripting tools are you guys using out there? > >Unix tools, like the gods intended... ;-> Cygwin works quite well once >you've wrapped your head around its quirks. > >I usually escalate from bash to sed, to awk to perl, as needed. > >> Years ago, I used QuickBasic to quickly knock up this sort of >> script, usually 1/2 an hour at most, a nice set of serial and parallel >> port manipulation tools and easy to run little external apps (e.g. a >> bin2hex utility). Of course QuickBasic is not compatible with modern >> Microsoft OS's. > >There's VisualBasic and, more importantly, the Windows Scripting Host, >which runs scripts written in either Basis or JScript. That's pretty >much the official solution if you're on MS Windows.
I wonder whether nobody mentions PowerShell, the new Microsoft tool. The price is right, free as in "free beer" (not freedom.). It took some inspiration from Python, I guess. The base idea is to work with typed objects, not strings like traditional shells. This is nice in itself. I dumped it after it turned out that ls > myfiles.txt didn't work. ("we do not do file redirection yet"). Also there seems to be no notion of current directory. I love to hear stories about how it is unusable, but then it may not.
>
-- -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- like all pyramid schemes -- ultimately falters. albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
Alf wrote:
>> > You're right, John, and it's not technicl merit I was considering. > Certainly Quickbasic had very little of that. It's convenience and > accessiblity. My "tools" these days are quite varied from techs through > embedded assember and C programmers to Windows C++ and C# software > developers. I'm looking for one ring to rule them all and in the > scripting darkness bind them. If it was just for me, I'd stick with the > familiar, gcc, C# or even Python.
Have you ever considered C/C++ interpreter Ch for scripting? It is free and runs across platform. You can find the shell scripting and C/C++ features in the following link: http://www.softintegration.com/docs/ch/shell/ http://www.softintegration.com/products/chstandard/ The windows serial port I/O is well supported in the Ch. http://www.softintegration.com/support/faq/windows.html#serial http://www.softintegration.com/products/thirdparty/#robot of course, Ch is best suitable for embedded scripting: http://www.softintegration.com/products/sdk/embedch/ http://www.softintegration.com/solution/embedded/ Hope it helps.
Alf wrote:
>> > You're right, John, and it's not technicl merit I was considering. > Certainly Quickbasic had very little of that. It's convenience and > accessiblity. My "tools" these days are quite varied from techs through > embedded assember and C programmers to Windows C++ and C# software > developers. I'm looking for one ring to rule them all and in the > scripting darkness bind them. If it was just for me, I'd stick with the > familiar, gcc, C# or even Python.
Have you ever considered C/C++ interpreter Ch for scripting? It is free and runs across platform. You can find the shell scripting and C/C++ features in the following link: http://www.softintegration.com/docs/ch/shell/ http://www.softintegration.com/products/chstandard/ The windows serial port I/O is well supported in the Ch. http://www.softintegration.com/support/faq/windows.html#serial http://www.softintegration.com/products/thirdparty/#robot of course, Ch is best suitable for embedded scripting: http://www.softintegration.com/products/sdk/embedch/ http://www.softintegration.com/solution/embedded/ Hope it helps.

The 2024 Embedded Online Conference