Global Sources
EE Times-India
Stay in touch with EE Times India
EE Times-India > Embedded

Designing home automation network with DSM (Part 2)

Posted: 13 Feb 2015     Print Version  Bookmark and Share

Keywords:modelling languages  home automation system  Domatic  DSM  microprocessor 

The VoiceOutput language was based on the domain-specific side of the in-house assembly language, which was in turn based on the features offered by Domatic's hardware platform.

This modelling language was designed for use by Domatic's developers, although simpler cases could be handled easily by nontechnical personnel. In the current state of the language, the direct inclusion of assembly language commands would have made using the whole language on more complex cases too complicated for anyone unfamiliar with the assembly language.

Looking at more examples of the usage of that language would probably have allowed the use of higher-level constructs, for example, to replace the three steps in the above model—Load A 00, Add A 01, and A < 05—with a simpler single "For A = 1 TO 5" construct.

As things stood, the modelling languages would allow the creation of the complete range of applications that existed for that framework. Speech elements could be reused across multiple models, keeping memory requirements down in the finished product.

As part of this reuse, it would be useful to know the total set of speech fragments used in a given application. This could be produced by a generator, guaranteeing that the set of samples for a product included all of those that were needed, and only those.

Often with reusable components, it is also useful to create an explicit library of reusable components. This helps prevent developers inadvertently reinventing the wheel because they did not know of the existence of a previously made component.

This could be accomplished with a simple little modelling language that would contain a set of TextFragments. When developers wanted a text fragment, they would pick it up from the library, adding it there if nothing suitable existed. An example of such a library is shown in table 1. Here we have included the start address, to fit with Domatic's practice.

Table 1: Library of Text Fragments.

In actual use, it would probably be better to omit this and instead have the code generator (figure 7) automatically create sequential numbering separately for each product. A useful addition would be a property for each fragment that pointed to the actual sound file, so developers could listen to it directly from the model and even emulate whole sections of speech.

Building the code generator
The generator produced the necessary code for the whole application in the assembly language that Domatic used. As the generator was based on existing best-practice code, the output was virtually indistinguishable from handwritten applications.

One concession was made to the time constraints: it would have been hard to generate the correct absolute memory addresses for jumps, as this would have required calculating the byte length of each assembly instruction. Instead, labels were generated as part of the output, and jumps were directed to the labels. A quick change to the assembler made these jumps function properly.

The generator was divided between the two modelling languages in the obvious way. Figure 7 shows the parts of the generator and the calls between them.

Figure 7: Home automation generator structure.

At the top level, a VoiceMenu generator started off the generation for the top-level VoiceMenu diagram, iterating over each VoiceOutput object and each _DTMF_Input object. The handling of DTMF input, invalid input and timeouts was all generated at this level. For the sample VoiceMenu from figure 5, the code output for the first VoiceOutput and DTMF_Input is shown in listing 2.

Listing 2: Generator output for first VoiceOutput in sample VoiceMenu.

 First Page Previous Page 1 • 2 • 3 • 4 Next Page Last Page

Comment on "Designing home automation network wi..."
*  You can enter [0] more charecters.
*Verify code:


Visit Asia Webinars to learn about the latest in technology and get practical design tips.


Go to top             Connect on Facebook      Follow us on Twitter      Follow us on Orkut

Back to Top