From: W. Trevor King Date: Mon, 8 Dec 2008 20:21:16 +0000 (-0500) Subject: Allow two passes through test_cmd in simult_aio. X-Git-Tag: 0.2~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1b86727e66170b1b2d5123fb7ad2965611685834;p=pycomedi.git Allow two passes through test_cmd in simult_aio. Fixed failing commands when the exact ns sample period was not available. e.g: Testing command: Command on (output): subdevice: 1 flags: 0x40 start: ext| 18 scan_begin: timer| 324675 convert: now| 0 scan_end: count| 1 stop: count| 16010 test pass 0, argument conflict Failing command (4): Command on (output): subdevice: 1 flags: 0x40 start: ext| 18 scan_begin: timer| 324700 convert: now| 0 scan_end: count| 1 stop: count| 16010 --- diff --git a/pycomedi/simult_aio.py b/pycomedi/simult_aio.py index 73099ae..a497e72 100644 --- a/pycomedi/simult_aio.py +++ b/pycomedi/simult_aio.py @@ -112,7 +112,7 @@ class cmd (object) : rc = 0 if very_verbose : print "Testing command:" - _print_command(self.cmd) + print self while i < max_passes : rc = self.IO._comedi.comedi_command_test(self.IO.dev, self.cmd) if (rc == 0) : @@ -297,12 +297,12 @@ values samples output on each channel are the same.""" self._ocmd.cmd.scan_begin_arg = int(1e9/freq) self._ocmd.cmd.stop_arg = onsamps if VERBOSE : - print "Configure the board (%d ns per scan, %d samps)" % (self._icmd.cmd.scan_begin_arg, self._icmd.cmd.stop_arg) + print "Configure the board (%d ns per scan, %d samps, %g Hz)" % (self._icmd.cmd.scan_begin_arg, self._icmd.cmd.stop_arg, 1e9/self._ocmd.cmd.scan_begin_arg) self._obuffer = out_buffer self._onremain = nsamps - self._ocmd.test_cmd() + self._ocmd.test_cmd(max_passes=2) self._ocmd.execute() - self._icmd.cmd.scan_begin_arg = int(1e9/freq) + self._icmd.cmd.scan_begin_arg = self._ocmd.cmd.scan_begin_arg self._icmd.cmd.stop_arg = nsamps self._icmd.test_cmd() self._inremain = nsamps