/liblxi

Open source LXI library

Primary LanguageCOtherNOASSERTION

=== LXI Library (liblxi) ===


1. Introduction

    The LXI library (liblxi) is a library for GNU/Linux systems which offers a
    simple API for communicating with LXI devices. The API allows applications
    to discover devices on your network and send LXI commands and receive
    responses.

    The library is based on the VXI11 RPC protocol implementation which is part
    of the asynDriver EPICS module, which, at time of writing, is available
    from: http://www.aps.anl.gov/epics/modules/soft/asyn/index.html


2. Status

    The code is currently considered experimental. API and internals are
    subject to change. Use on your own risk.


3. Installation

    Install steps:

    $ ./configure
    $ make
    $ make install


4. The liblxi API

    The API is small and simple. It basically includes features required for
    discovering and communicating SCPI messages with LXI devices:

    int lxi_init(void);
    int lxi_discover(struct lxi_info_t *info, int timeout);
    int lxi_connect(char *address);    
    int lxi_send(int device, char *message, int length, int timeout);
    int lxi_receive(int device, char *message, int length, int timeout);
    int lxi_disconnect(int device);


5. API usage

    Here is a simple code example on how to use the liblxi API:

     #include <stdio.h>
     #include <string.h>
     #include <lxi.h>

     int main()
     {
         char response[65536];
         int device, length, timeout = 1000;
         char *command = "*IDN?";

         // Initialize LXI library
         lxi_init();

         // Connect to LXI device
         device = lxi_connect("10.42.0.42");

         // Send SCPI command
         lxi_send(device, command, strlen(command), timeout);

         // Wait for response
         lxi_receive(device, response, sizeof(response), timeout);

         printf("%s\n", response);

         // Disconnect
         lxi_disconnect(device);
     }

    The example above prints the ID string of the LXI instrument. For example,
    a Rigol DS1104Z oscilloscope would respond:
    
    RIGOL TECHNOLOGIES,DS1104Z,DS1ZA1712064242,00.04.03


6. Development

    This is open source. If you want to help out with the project please join
    in. Any contributions (bug reports, code, doc, ideas, etc.) are welcome.

    Please use the github issue tracker and pull request features.


7. Website

    Visit http://lxi.github.io


8. License

    liblxi includes code covered by the following licenses:

     * BSD-3, commonly known as the 3-clause (or "modified") BSD license
     * EPICS Open software license

    For license details please see the COPYING file.