Giter VIP home page Giter VIP logo

node-vxi11's Introduction

node-vxi11

NPM

A nodejs module for VXI-11 communication.

Install

npm install vxi11

Use

Simple call with default parameters

var vxiTransceiver = require('vxi11').vxiTransceiver
...
vxiTransceiver('172.30.56.65', 'gpib0,10', '*IDN?', function(result) {
  console.log('result: »' + result + '«');
});

Call with an options object

var vxiTransceiver = require('vxi11').vxiTransceiver
...
var options = {
  host: '172.30.56.65',
  device: 'gpib0,10',
  command: '*IDN?',
  readTimeout: 3000,     // default:  2000ms
  ioTimeout: 6000,       // default: 10000ms
  lockTimeout: 6000,     // default: 10000ms
  lockDevice: true,      // default: true
  termChar: '\n', // string or number; default: 0 (no termination char)
  logger: { log: console.log, error: console.error }, // default: no logging
  encoding: 'utf8'       // 'binary' (Buffer), 'base64'; default: 'utf8'
}
...
vxiTransceiver(options, function(result) {
  console.log('*** result: »' + result + '«');
},function(error) {
  console.log('*** error: »' + error + '«');
});

Note for the special case 'readTimeout:0':

  • Ignores I/O timeout in DEVICE_READ procedure for buggy devices.
  • Sends null back if missing response from buggy devices.

Possible improvements

  • Split into a real onc rpc module and a vxi-11 module
  • More vxi-11 functionality (e.g. SRQ)

node-vxi11's People

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.