Alarm Management API Sample Program

About this task

  • Overview
  • Build the Demo (sample) program.
  • Run the Demo (sample) program.

Overview

A sample Microsoft Visual C++ project, named amaru_demo_exe.vcxproj, is provided to build the sample program. Use this project as a basis for constructing projects for your own applications.

Note: Depending on how you installed Visual C++, the INCLUDE, LIB, and PATH environment variables may not be automatically set when you install MSDEV. If they are not set, you will have to set them manually or run the following to set them before building any user programs.

..\<Program Files Install Directory>\Microsoft Visual Studio 11.0\Common7\Tools\vsvars32.bat

When you run the demo program, it will generate an alarm, then reset it.

Build the Demo (Sample) Program

Procedure

  1. From the CIMPLICITY Workbench for your project, select Command Prompt from the Tools menu.

    This will ensure that your environment variables (in particular %BSM_ROOT% and %SITE_ROOT% ) are set correctly.

  2. In the Command Prompt window, issue the following commands:

    < drive >:

    cd %BSM_ROOT%\api

    where < drive > is the disk where your CIMPLICITY software is installed.

  3. (If the environment variables are not set automatically) issue the following command to set them:

    ..\<Program Files Install Directory>\Microsoft Visual Studio 11.0\Common7\Tools\vsvars32.bat

  4. Launch Visual Studio:

    devenv CimplicityAPI.sln

  5. Open the Solution Explorer.
  6. Right click amaru_demo_exe.
  7. Select Build on the Popup menu.

    Run the Demo (Sample) Program

    The API process name must be stored in the PRCNAM environment variable for the program to run. The name is an arbitrary character string of up to 10 characters. To create PRCNAM, enter the following command in the Command Prompt window:

    set PRCNAM=<name>

    where < name > is the API process name.

    To run the sample program, enter the following command in the Command Prompt window:

    amaru_demo

    Note: You must have a project running locally or the sample program will fail to run successfully.