Giter Club home page Giter Club logo

daqmx's Introduction

daqmx

A [work-in-progress] wrapper to the National Instruments DAQmx driver. It depends on PyDAQmx for callbacks, and all of the functions may be available through PyDAQmx, but the syntax is slightly different to allow for more "Pythonic" programming.

Motivation

PyDAQmx works well, but its members don't show up in Spyder's autocompletion. Also, PyDAQmx uses a lot of mixed case names (including its package name), which can be cumbersome to program with. The goal of this project is to make syntax as clear as possible for rapid application development.

Status

As of yet, only the functions and constants that I have needed are wrapped, so things are a bit incomplete. Use with the knowledge that things are not complete, and feel free to submit pull requests.

Installation

Inside the cloned directory run

python setup.py install

Usage example

import time
import daqmx
import matplotlib.pyplot as plt

# Create a task object
task = daqmx.tasks.Task()

# Create a channel object
channel = daqmx.channels.AnalogInputVoltageChannel()
channel.physical_channel = "Dev1/ai0"
channel.name = "analog input 0"

# Add the channel to the task and activate option to append data in memory
task.add_channel(channel)
task.setup_append_data()

# Run the task for 2 seconds and stop
task.start()
time.sleep(2)
task.stop()
task.clear()

# Plot the resulting data
plt.plot(task.data["time"], task.data["analog input 0"])
plt.show()

daqmx's People

Contributors

petebachant avatar

Watchers

 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.