Skip to content

Updating plugins using nidaqmx and not PyDAQmx #6

@jerlfan

Description

@jerlfan

Hi guys,
I am actually working on the update of the plugin to replace PyDAQmx by nidaqmx (from NI).
The current state of the work can be find on my fork : https://github.com/jerlfan/pymodaq_plugins_daqmx
I created daqmx-ni wrapper using nidaqmx (in hardware) to replace daqmx that uses PyDAQmx
If you can have a look on what I have done at this stage, I would be grateful. It is not fuly tested I have to implement the reading methods (see below)

To finish the work I am actually facing one problem:
reading procedure is much simpler with nidaqmx (no needs to use ctype, or byref...): i.e. task.read(Nsamples, Readout time) and it is independant from the channel type. The time is defined elsewhere (task.timing).
I will start by implementing the counter channels and I would your advices.
There is two ways to use it:
1- we feed a clock to the counter. Usually you use another counter channel for that (Aurore's way). It is really good for short time but you loose a counter channel :-( (at least on the NI board we have in the Lab, I have a USB6341).
2- You can simply use a "machine clock". This is where I may need help. I propose the following solution:
init=time.perf_counter()
task.start()
while time.perf_counter()-init <=Acquisition_time:
pass
counts=task.read()
print(counts)
task.stop()

What do you think? I think it is not really elegant. So sugestions are welcomed!

I will then create a daq_viewer_0D counter-fast and counter-slow.

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions