Code Monkey home page Code Monkey logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Darn, I forgot to attach the script. Sorry. Here it is.

Original comment by [email protected] on 20 Apr 2012 at 9:24

Attachments:

from pylibnidaqmx.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
I wonder if you get all data with your patch?
Namely, nidaqmx docs says
"""
Each line in a channel gets one byte per sample.
"""
In your example, you specify 32 lines, meaning,
to read data with grouping for all lines, one
sample needs 32 bytes == 256 bits.
So, can you check that with 32-bit integer
you actually get all the data. Also, what is the
value of returned bytes_per_sample in your case?

Perhaps the data array needs to be expanded?
For instance, using

  data = np.zeros((number_of_channels, samples_per_channel, number_of_lines),dtype=uint8)

as a fix of the issue?

Original comment by pearu.peterson on 20 Apr 2012 at 10:27

from pylibnidaqmx.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Mea culpa. You are right. I made that mistake because I did not look at your 
code closely enough. I'm so used to using ReadDigitalU32 that I did not even 
know that ReadDigitalLines exists. Yes, it gives you one byte per line, 
therefore may patch is grossly wrong!

Expansion does not work either. The format that ReadDigitalLines returns is
data = np.zeros((samples_per_channel, sum_of_lines),dtype=np.uint8)

if 'group_by_scan_number' is used. Transposed for 'group_by_channel'. If 
ReadDigitalLines is used, the argument 'per_line' or 'for_all_lines' is 
irrelevant: The format is the same. I think these are only relevant for 
ReadDigitalU(8,16,32)

I did some quick testing by reading 32 lines (as in the script) and applying 
+5V to 1 line at a time which worked as expected.

Original comment by [email protected] on 20 Apr 2012 at 12:28

Attachments:

from pylibnidaqmx.

Related Issues (20)

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.