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
- node.js -- Tested with v12.16.3
- nScope library -- Tested with v0.8
- Compile tools like make and gcc.
Example
const nScope = ;var nScopeDevice = ;try console; console; console; nScopeDevice; console; console; forvar channel=1; channel<5; channel++ console; console; console; nScope; nScope; var request = nScopeDevice 10 false; request; while request var data = request; console; catcherr console; console; console;
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.