Re: Waveform Mini-Language



Richard Pennington wrote:
Guy Macon wrote:

I am doing some preliminary design work on a AC waveform generator.
The primary use will be generating signals that, when amplified,
will generate three-phase AC power with various line disturbances
(dropouts, spikes, etc.). This will all be dome with DACs.

I am pondering making a mini-language to make it easier for the
users (who range from EEs to electricians) to program waveforms.
something along the lines of this (pseudocode, not the actual
syntax):

Output A Waveform = Sine

Output A Voltage = 10 VAC

Output A Frequency = 400 Hz.

Output A Phase = 120 degrees

Output A Duration = 1 Second


You could use an off the shelf command language, but you may find that it's a lot more capable than you need to do the job and has a large memory footprint

If you have the time, it's more fun and you learn more by writing your own. You can design and build a simple table driven parser and command dispatch unit to fit in a few K of memory. Typical data flow would be:

Get and tokenise input line

Syntax check against defined command set.

Lexical analysis

Command dispatch,

A typical command language structure that i've used in the past is of the form <command> <variable> <value> or <command> <variable> <value> <qualifier>, which results in commands like set frequency 1000, set volts 250 etc. If you keep the command set structure consistent throughout, writing the parser becomes a fairly trivial exercise. What you get at the output is a collection of function stubs, which you write to do the actual work.

A book on compiler design would be usefull - you don't need all the hairy stuff for simple command line parser, but it would provide a good background to the various techniques used.

IMO, one of the more interesting areas of software design...

Chris






Electronic and Embedded System Design
Oxford, England
(44) 1865 750 681
.



Relevant Pages

  • Re: Waveform Mini-Language
    ... You can design and build a simple table driven parser and command dispatch unit to fit in a few K of memory. ... If you keep the command set structure consistent throughout, writing the parser becomes a fairly trivial exercise. ... A book on compiler design would be usefull - you don't need all the hairy stuff for simple command line parser, but it would provide a good background to the various techniques used. ...
    (comp.arch.embedded)
  • Re: POTS line quality help
    ... to switched services. ... If i ATDTetc in, that works and see the prompt for username but +++ does not escape to modem; if i am online like now, TerraTerm barfs. ... "at command set" Which finds many things with these being on the ... I have the USR CD and it gives the AT command set for their modem. ...
    (sci.electronics.design)
  • Re: POTS line quality help
    ... to switched services. ... does not escape to modem; if i am online like now, ... "at command set" Which finds many things with these being on the ... I have the USR CD and it gives the AT command set for their modem. ...
    (sci.electronics.design)
  • Re: AT command set for integrated #2793 modem
    ... > AT command set. ... > Create the async line against the resource, ... So I fired up the STRITF command and manually fed AT codes to the ...
    (comp.sys.ibm.as400.misc)
  • Re: Blocking read call never returns to bison parser.
    ...  I wrote the parser as a standalone program ... The only way to send EOF over a pipe is to close all the write ends. ... EOF is indeed sent, and the output of that first command ... need to fflushafter every write or that shell prompt detection ...
    (comp.unix.programmer)