Skip to content
dskleingeld edited this page Oct 26, 2017 · 18 revisions

Welcome to the PyDAQ wiki! This module provides a high level interface to the myDAQ. It can be used to aquire and/or generate signals on multiple channels or for feedback between channels, for this a custom feedback function needs to be passed. By default the aquired signals will be plotted and saved to file. If desired custom plot function can even be provided.

Example

//This example reads data on input channel 1 and 2 of a mydaq it saves
//the data in a csv file called testData.
import pydaq
import numpy as np

if __name__ == '__main__':
    pd = pydaq.PyDAQ()

    #configure
    pd.onlyAquire(["myDAQ1/ai0", "myDAQ1/ai1"], 
       samplerate=800, maxMeasure=2, minMeasure=-2,
       plot=True, saveData=True)

    pd.begin()
    pd.menu()
    pd.end()

Documentation

For every program you need to create a PyDAQ and use 4 required functions. One to set what operation or combination of operation you would like it to perform (acquire signal, generate a signal, do feedback). The begin function. A function to prevent the program for running the end function directly and the end function that closes down and resets the mydaq. There are also some extra functions available to set more options.

Configuration options that configure what action they DAQ will perform, you can choose only one of these functions/actions.

Optional functions that configure the shown plot and the output file.

User made functions used as input by onlyFeedback and setCustomPlot.

Required functions to start, keep running and stop the program. you must run these functions after the above.