ncapp2moml

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.

Installation instructions

Note: You must follow the instructions here for running the nc2moml tool before you can use models generated with this ncapp2moml tool.
  1. Run the script to generate the .moml files from the .nc files.
    cd $PTII/ptolemy/domains/ptinyos/util/ncapp2moml
    ./ncapp2moml
            
    The 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
            
  2. See if it worked:
    1. You should see some valid MoML code in:
      $PTII/vendors/ptinyos/momlapp

      The directory structure should reflect that of the TinyOS directory structure.
      1. Try running Viptos:
        $PTII/bin/vergil -viptos
      2. Open a demo by going to File -> Open File, and opening file $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).
      3. If you opened CntToLeds.moml, you may wish to run the automatic graph layout by selecting Graph -> Automatic Layout form the menu, or by typing Ctrl-T.

        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.