TinyOS is an event-driven operating system designed for sensor network nodes that have very limited resources (e.g., 8K bytes of program memory, 512 bytes of RAM). TinyOS, is used, for example, on the Berkeley MICA motes, which are small wireless sensor nodes. nesC is an extension to the C programming language designed to embody the structuring concepts and execution model of TinyOS.
ncapp2moml is used to convert nesC application files (.nc configuration files with no interfaces) into MoML (.moml) files. This will create Ptolemy II models that you can run in Viptos. You must setup the necessary MoML library of nesC components with the nc2moml tool before you can successfully open files made with this ncapp2moml tool.
Note: You must follow the instructions here for running the nc2moml tool before you can use models generated with this ncapp2moml tool.
cd $PTII/ptolemy/domains/ptinyos/util/ncapp2moml ./ncapp2momlThe
ncapp2moml
command will take a few minutes to complete.
Note: The ncapp2moml tool requires that you build the tools in $PTII/bin
. Do the following and rerun the script above if they are missing:
cd $PTII/bin make
$PTII/vendors/ptinyos/momlapp
$PTII/bin/vergil -viptos
$PTII/vendors/ptinyos/momlapp/apps/CntToLeds/CntToLeds.moml
or
$PTII/vendors/ptinyos/momlapp/apps/CntToLeds/CntToLeds-InWireless.moml
(only one of these will have been generated, depending
on what options were used in running ncapp2moml).
If you opened CntToLeds-InWireless.moml, you have to first right-click on the MicaBoard and select Look Inside, then right-click on the MicaCompositeActor and select Look Inside. Then, you can run the automatic graph layout by selecting Graph -> Automatic Layout form the menu, or by typing Ctrl-T.