npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nscopeapi

v1.1.1

Published

Nodejs link to nScope API library

Downloads

8

Readme

nScope-nodejs-addon

Addon for NodeJS for the nScope API library

For more information about nScope see https://www.nscope.org/

This repository will create a NodeJS addon based on the nScope library (https://github.com/nLabs-nScope/nScopeAPI.git)

Installation

npm install nscopeapi

Requirements

Example

const nScope = require('nscopeapi');
var nScopeDevice = new nScope.device();
try {
    console.log('API version:', nScopeDevice.check_API_version());
    console.log('API build:', nScopeDevice.check_API_build());
    console.log('FW version:', nScopeDevice.check_FW_version());

    nScopeDevice.open(true);
    console.log("get_power_state:",nScopeDevice.get_power_state());
    console.log("get_power_usage:",nScopeDevice.get_power_usage(),"W");

    for(var channel=1; channel<5; channel++) {
        console.log("get_Ch"+channel+"_on",nScope.get_ChX_on(nScopeDevice, channel));
        console.log("get_Ch"+channel+"_gain",nScope.get_ChX_gain(nScopeDevice, channel));
        console.log("get_Ch"+channel+"_level",nScope.get_ChX_level(nScopeDevice, channel));
    }

    nScope.set_trigger_edge(nScopeDevice, 1);
    nScope.set_sample_rate_in_hz(nScopeDevice, 10.0);
    var request = new nScope.requestClass(nScopeDevice, 10, false);
    request.wait_for_request_finish();
    while (request.has_data()) {
        var data = request.read_data(1);
        console.log("Data:",data);
    }
}
catch(err) {
    console.error("An error occured:"+err);
    console.log("\tlastError:",nScopeDevice.lastError());
    console.log("\tlastErrorStr:",nScopeDevice.lastErrorStr());
}

API Documentation

nScope Module Functions

  • < DeviceObject >device() - Should be called to create a device object.

  • < RequestObject >request(< DeviceObject >device, < Number >numSamples, < Boolean >antiAliased) - Should be called to create a request object.

    • < DeviceObject >device - a device object required by calling device()
    • < Number >numSamples - number of data samples (per channel) to request
    • < Boolean >antiAliased - true: turn on anti-aliasing, false: turn it off

< DeviceObject > Functions

  • < Boolean >open(< Boolean >powerOn) - Open a connected nScope device and initialize it.

    • < Boolean >powerOn - true turns nScope on when first opened, false leaves nScope in its current state.
  • < Boolean >close() - Close and clean a connected nScope device.

  • < Number >check_API_version() - check the version of this API.

  • < Number >check_API_build() - check the build number of this API.

  • < Number >check_FW_version() - check the version of the connected firmware. Will only work when nScope is connected to computer.

  • < Number >get_power_state() - Read the PowerState of the nScope.

  • < Number >get_power_usage() - Read how much power is being used by nScope in watts.

  • < Number >find_firmware_loader() - find the firmware loader.

  • < Number >load_firmware() - load the nScope with current firmware.

  • < Number >write_to_loader() - write the firmware to the loader.