GithubHelp home page GithubHelp logo

liquidinstruments / moku-matlab Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 179.99 MB

MATLAB driver for the Liquid Instruments Moku:Lab

License: MIT License

Python 3.32% MATLAB 96.68%
matlab moku moku-matlab liquid-instruments-moku oscilloscope spectrumanalyzer bodeanalyzer phasemeter datalogger pidcontroller

moku-matlab's Introduction

moku-MATLAB

MATLAB library for the command, control and monitoring of the Liquid Instruments Moku:Lab device.

For moku-MATLAB documentation please run help moku from your MATLAB console.

For information on how to discover your Moku:Lab's IP address see the Connecting to your Moku:Lab guide.

Installation

MATLAB 2015 or later

  1. Download the moku-MATLAB Toolbox
  2. In MATLAB, open the downloaded Toolbox file using the file explorer.
  3. Press "Install".
  4. Run help moku in the MATLAB console to confirm installation.

MATLAB 2013-14

  1. Download the moku-MATLAB zip file
  2. Extract the zip file to a convenient location (we recommend Documents/MATLAB/Add-Ons/Toolboxes).
  3. Open MATLAB.
  4. In the Home tool pane, click "Set Path".
  5. Click "Add with Subfolders..." and select the extracted moku-MATLAB folder.
  6. Press "Save" to permanently add the folder to the MATLAB path.
  7. Run help moku in the MATLAB console to confirm installation.

Supported Versions

  • Windows - MATLAB 2013a+
  • Linux - MATLAB R2013a+
  • Mac - MATLAB 2014a+

Examples

You can find example scripts for instruments in the examples/ folder.

Here is a basic example of how to connect to a Moku:Lab, deploy the Oscilloscope and fetch a single data trace.

% Connect to your Moku:Lab's Oscilloscope instrument
m = MokuOscilloscope('192.168.69.100'); % Your Moku:Lab IP here

% Set the Oscilloscope timebase to be +-1msec
m.set_timebase(-0.001,0.001);

% Get a single frame of data with a 10-sec timeout period
data = m.get_realtime_data('timeout',10);

% Print the time-voltage data for both channels
data.time
data.ch1
data.ch2

Troubleshooting

Licensing

moku-MATLAB is covered under the MIT License (refer to the LICENSE file for details).

Refer to library source files for individual licensing details.

Issue Tracking

Please log issues here on Github.

moku-matlab's People

Contributors

liquidtim avatar shanaek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

am2964

moku-matlab's Issues

MokuOscilloscope error using get_realtime_data on every second run

I'm trying to grab a sample of data from the oscilloscope instrument using the Matlab API.

Here I'm using the get_realtime_data to get a decimated block of points. I run the example script below, it works on the first time on fresh boot of Matlab but produces an error on every second run of the script.

% Tester delete me later

%{
Test script that produces an error "Error using moku/mokuctl (line 118)"
on every second run of the script. 
Author: Andrew Wade
Date: 13 Nov 2020
%}

% Configure moku IPs
ip_WFG = '192.168.30.241';

% Connect to wavefunction generating Moku
wfg = MokuOscilloscope(ip_WFG);  % a different option that allows readback
wfg.set_frontend(1, 'fiftyr', false, 'atten', false, 'ac', false);
wfg.set_precision_mode(true); % Set to decimate rather than downsample
wfg.set_xmode('sweep');
wfg.set_timebase(-0.01,0); % Grab 0.01 seconds of data

for ii = 1:5
out = wfg.get_realtime_data('timeout', 10.0)
median(out.ch1)
end

The error returned is

Error using moku/mokuctl (line 118)


Error in MokuOscilloscope/get_realtime_data (line 252)
            mokuctl(obj, 'get_realtime_data', params);

Error in test (line 21)
out = wfg.get_realtime_data('timeout', 10.0)

Are we supposed to be closing a connection between runs of the above script? Documentation says no, but clearly there is something that needs reseting to get the same result every time.

I also tried restarting matlab between runs of the above script. On first run it works fine, then every second run I get the above error. So seems like an issue with the state on the Moku side (not matlab).

Are you able to reproduce this?

Support for Moku:Pro Multi-instrument mode

Looking at the examples and the commits in last few years it doesn't seem that anything has been added for addressing individual instruments in Moku:Pro's multi-instrument mode. We might like to implement this for automated loop measurments in our lab.

Are there any prospects of this making into either the Matlab or Python API any time soon?

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.