Giter Site home page Giter Site logo

javatmc-core's Introduction

Java Test & Measurement Control

License Build Status codecov.io

JavaTMC is a Java API for Test & Measurement devices, intended to be used for test automation. It's purpose is to extend continuous integration workflows with hardware tests.


Using JavaTMC

Currently JavaTMC is not published anywhere, in the future it will be available either at JCenter or MavenCentral.

To install the library locally first clone this repository then run ./gradlew publishToMavenLocal

Example

Using sockets to directly communicate with instruments

public void test() {
    try(VXI11Socket socket = new VXI11Socket(InetAddress.getByName("192.168.1.100"))) {
        ISCPISocket scpi = new RawSCPISocket(socket);
        System.out.println(scpi.getDeviceIdentifier());

        scpi.send(SCPICommand.builder().command(":SOUR:FREQ:START").with("100").build());

        System.out.println("Current voltage: " + scpi.query(SCPICommand.builder().query(":MEAS:VOLT:DC") + "V");
    } catch(IOException e) {
        System.err.println("Error connecting to instrument");
    }
}

Using drivers to control instruments

public void test() {
    try(VXI11Socket socket = new VXI11Socket(InetAddress.getByName("192.168.1.100"))) {
        Oscilloscope scope = new SDSLegacyDriver(new RawSCPISocket(socket));
        scope.acquisition().setTimespan(Units.milli(14));
        scope.acquisition().setTimeOffset(0);
        scope.getAnalogInput(2).setEnabled(true);
        scope.getAnalogInput(2).setProbeAttenuation(10);
        scope.getAnalogInput(2).setRange(3.1);
        scope.getAnalogInput(2).setOffset(-1.5);
    } catch(IOException e) {
        System.err.println("Error connecting to instrument");
    }
}

Command line interface

For basic measurements and automations there's a command line interface, see the CLI Documentation for more information.

Architecture

The core consists of abstract interfaces for devices, socket implementations like VXI11, Serial and USB. Interfaces are similiar to those specified in the IVIFoundation's instrument class specifications

Features

Sockets

The following socket types are currently supported

  • Raw TCP, VXI-11, Serial

Planned support for the following

  • USB Raw, USBTMC, HiSLIP, Modbus/TCP, Modbus/Serial

Instruments

The following interfaces are present currently, with more coming in the future

  • Oscillscope, Function Generator, Logic Analyzer, DC Power Supply

Drivers

Currently supported instruments:

  • Siglent SDS oscilloscopes, exluding the 2000X+, 5000X and 6000X series

  • Siglent SDG function generators

Building

Run ./gradlew build

Contributing

Contribution guidelines


License

javatmc-core's People

Contributors

c4deszes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.