Issue 41 in pylibnidaqmx: Add AnalogOutput status calls

7 views
Skip to first unread message

pylibn...@googlecode.com

unread,
Apr 29, 2014, 5:52:07 PM4/29/14
to pylibnida...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 41 by mhis...@gmail.com: Add AnalogOutput status calls
http://code.google.com/p/pylibnidaqmx/issues/detail?id=41

I'm attaching a patch that adds the GetWriteCurrWritePos() and
GetWriteTotalSampPerChanGenerated() calls.

These are useful for getting the status of an AnalogOutput task while it's
running.

I put them in the Task base object. Perhaps these should be split into
AnalogOutput and the corresponding GetRead calls should be in AnalogInput.

Thanks,
Mark


diff --git a/nidaqmx/libnidaqmx.py b/nidaqmx/libnidaqmx.py
index a349b72..d7e86d4 100644
--- a/nidaqmx/libnidaqmx.py
+++ b/nidaqmx/libnidaqmx.py
@@ -2556,6 +2556,26 @@ class Task(uInt32):
CALL('GetReadTotalSampPerChanAcquired', self, ctypes.byref(d))
return d.value

+ def get_write_current_position(self):
+ """
+ Indicates the position in the buffer of the next sample to
generate.
+ This value is the same for all channels in the task.
+ """
+ d = uInt64(0)
+ CALL('GetWriteCurrWritePos', self, ctypes.byref(d))
+ return d.value
+
+ def get_write_samples_per_channel_generated(self):
+ """
+ Indicates the total number of samples generated by each
+ channel. NI-DAQmx returns a single value because this value is
+ the same for all channels.
+ """
+ d = uInt64(0)
+ CALL('GetWriteTotalSampPerChanGenerated', self, ctypes.byref(d))
+ return d.value
+
+
def wait_until_done(self, timeout=-1):
"""
Waits for the measurement or generation to complete. Use this



--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

pylibn...@googlecode.com

unread,
May 9, 2014, 10:06:01 AM5/9/14
to pylibnida...@googlegroups.com

Comment #1 on issue 41 by richard.hoechenberger: Add AnalogOutput status
calls
http://code.google.com/p/pylibnidaqmx/issues/detail?id=41

Thanks for the contribution, Mark!

Pearu, what do you think would be the best place to put this? Task or
rather AnalogOutput/Input task classes?

pylibn...@googlecode.com

unread,
May 9, 2014, 11:55:00 AM5/9/14
to pylibnida...@googlegroups.com

Comment #2 on issue 41 by pearu.peterson: Add AnalogOutput status calls
http://code.google.com/p/pylibnidaqmx/issues/detail?id=41

I think under Task, in parallel with get_read_current_position,
get_samples_per_channel_acquired methods.

The patch looks ok, perhaps apply rename:

get_write_samples_per_channel_generated ->
get_samples_per_channel_generated

pylibn...@googlecode.com

unread,
May 10, 2014, 12:32:45 PM5/10/14
to pylibnida...@googlegroups.com

Comment #3 on issue 41 by richard.hoechenberger: Add AnalogOutput status
calls
http://code.google.com/p/pylibnidaqmx/issues/detail?id=41

All right, gonna test and commit these changes within the next days.

pylibn...@googlecode.com

unread,
Jun 16, 2014, 6:49:57 AM6/16/14
to pylibnida...@googlegroups.com

Comment #4 on issue 41 by richard.hoechenberger: Add AnalogOutput status
calls
http://code.google.com/p/pylibnidaqmx/issues/detail?id=41

I've just commited the changes. Thanks for the contribution, mhisted!
Reply all
Reply to author
Forward
0 new messages