neMESYS SDK  20150729
Overview

Introduction

This documentation provides the instructions for the implemented functions. The library is arranged in groups of functions and helps to simplify the programming of the control software based on Windows. This document describes the interface between a program and the Windows DLL (Dynamic Link Library).

THERE IS NO WARRANTY FOR THIS LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THIS LIBRARY IS WITH YOU. SHOULD THIS LIBRARY PROVE DEFECTIVE OR INSUFFICIENT, YOU ASSUME THE COST OF ALL ECESSARY SERVICING, REPAIR OR CORRECTION.

The latest edition of these documentation, additional documentation and software to the neMESYS dosing system may also be found on the internet under http://www.cetoni.de/en-service/downloads/manuals.html


General Information

The library nemesys_dll.dll is an implementation of the neMESYS command set for the communication between neMESYS and a personal computer. Using this library is a simple way to develop your own application. This library is running on each windows 32-bit operating system. You can include it into different programming environments. All the neMESYS commands are implemented and they can be called directly from your own program. You don't have to care about the protocol details. The only thing you have to ensure is properly connected and configured dosing platform. The library nemesys_dll.dll offers the whole set of neMESYS commands. Executing neMESYS commands, managing configuration parameters, executing dosing tasks and handling low level communication with the neMESYS control units is the business of this library.


Installation Directory Content

The neMESYS SDK setup installs a number of files into the final installation folder. The following overview shows which files are installed into which folders:

  • Root Installation Folder - contains the changelog and all other codumentation files
    • Demo - A simpole demo application that uses the nemesys_dll.dll
    • Matlab Demo - A demo integration into Matlab
    • neMESYS LabVIEW Kit - The neMESYS LabVIEW Kit with all VIs
    • RAD Studio 2007 C++ - RAD studio C++ integration and import library
    • RAD Studio 2007 Delphi - RAD studio Delphi integration
    • RS232 Library - Source code of the neMESYS RS232 library

Including the neMESYS SDK

The way how you include the library, depends on the compiler and on the programming language you use. In order to have a correctly working communication, you have to include the libraries to your programming environment. You have to copy these files to the working directory of your system. To open the library nemesys_dl.dll you have to use the function NCS_OpenDevice(). You have to do this before you can execute any neMESYS command. At the end of your program you have to call NCS_CloseDevice() to properly close the connection and shutdown. Use the calling convention __stdcall for this library. This convention is managing how the parameters are put on the stack and who is responsible to clean the stack after the function execution.


Storage

The neMESYS library needs to store several device parameters of connected neMESYS dosing units persistent. The library will store these parameters into a devices.ini file. The library will create or use the ini file inside the directory C:\Users\Public\Documents\nemesys. The neMESYS DLL shares this configuration file with the neMESYS UserInterface application.


Initialization

To work with the API functions you first need to call the NCS_OpenDevice function to get a valid device handle. A device handle is handle for a complete neMESYS doing system consisting of multiple neMESYS pumps.

As soon as you have a valid device handle, you can call all other neMESYS SDK functions, passing the device handle as a function parameter. To control single neMESYS pumps, many functions have a DosingUnit parameter. The DosingUnit is the index of the pump you would like to control and it starts from 0 to the number of dosing units - 1. Eg if you have a neMESYS system consisting of three pumps and you would like to control the first pump, then the dosing unit index is 0. If you would like to control the third pump, the dosing unit index would be 2. So if you would like to stop the first dosing unit, you would write

Result = NCS_Stop(DeviceHandle, 0);