Subject: Nidaq Scanning into a 2D wave
In-Reply-To: <73D9AF7A-DCF1-48CE-934C-5E3D809F8F6F@wavemetrics.com>
References: <AM4PR0601MB2068C52E80D829AF669059F696BE0@AM4PR0601MB2068.eurprd06.prod.outlook.com>
<73D9AF7A-DCF1-48CE-934C-5E3D809F8F6F@wavemetrics.com>
Message-ID: <CC212B70-6334-48B1-94BE-7C5636BA4791@le.ac.uk>
Thank you for clarifying this "feature" John. I am at least pleased to have found out the cause of the problem.
Your suggestion works as far as enabling scanning but isn't a good solution in my case.
I am scanning and need to see a live image which I did previously in an earlier version of Nidaq tools by scanning into a 2D wave. It was possible to see the results as they were scanned.
Redimensioning the wave either side of the scan does fool the DaqmxScan but when it is redimensioned, the live display no longer works because the wave goes from a 2D wave or image to a 1D wave. The effect is that the image cannot be seen.
A working solution, but one that is not ideal because of the additional overhead, is to scan into a 1D wave and then as soon as possible (after an end of scan hook), duplicate the wave into the displayed 2D wave. Whilst at first this duplication seemed to redimension the wave automatically, I later found that this was not reliable and so a redimension step is required as well.
So whilst it is possible to work around this "feature", it is less than ideal for my purpose. The images only update after a single scan rather than updating during scanning. Whilst I can imagine that scanning multiple channels into a 2D wave might be of use to some, the possibility of a flag to enable scanning a single input into a 2D wave would be very welcome and help to maintain some backwards compatibility and presumably take advantage of the speed benefits of doing the work in an XOP.
B
Nick
?On 05/09/2019, 18:52, "Info-igor on behalf of John Weeks" <info-igor-bounces at lists.info-igor.org on behalf of support at wavemetrics.com> wrote:
Nick has run into a new feature of NIDAQ Tools MX 1.1 (the version where 64-bit support was added). It is now possible to scan into columns of a multi-column wave, with a column for each channel. Seemed like an obvious enhancement...
My suggestion to him was to "fool" DAQmx_Scan by redimensioning the wave to 1D very briefly, just long enough for DAQmx_Scan to be happy with the wave:
Redimension/N=(rows*cols) theWave
DAQmx_Scan ... // doing a background scan
Redimension/N=(rows, cols) theWave
Since it is running in a function, nobody but DAQmx_Scan notices that the wave was 1D for a short period.
Conceivably, I should add some option to make this kludge unnecessary, but this isn't too bad as kludges go :)
Regards,
John Weeks
WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
email support at WaveMetrics.com
> On Sep 2, 2019, at 7:01 AM, Hartell, Nick (Prof.) <nh88 at leicester.ac.uk> wrote:
>
> Hello List,
> I am trying to troubleshoot a problem that has mysteriously appeared in my code. I wonder (perhaps optimistically) if there is a change in behavior in either igor 7 or nidaq tools. I am using the latest version of both as far as I am aware on Windows 7, all 64 bit.
>
> I am scanning using nidaqmx. I have in past been sending the input data into 2D waves (i.e. 100 x 100) that are images. For some reason that I can't get to the bottom of, this no longer seems to work and only the first column of the wave receives information. The other columns are unchanged. If i scan the data into a 1D wave of the correct size (10000) and then redimension it to 100 x 100, then the image is fine.
>
> What I am struggling with is that this code used to work and I can't work out if this is something that I have inadvertently done or if Igor has changed in properties and through some update I have encountered this issue. It is much easier for me to collect data into a 2D wave if possible so would like to continue doing this if I can.
>
> Hope someone can shed light on this.
> Thanks
> B
> Nick
>
>
> Nicholas A. Hartell, Ph.D.
>
> Professor of Neuroscience
>
> Department of Cell Physiology and Pharmacology,
>
> Medical Sciences Building,
>
> University of Leicester.
>
> University Road, Tel: 0116 252 3301 (Office)
>
> PO Box 138, Tel: 0116 252 5675 (Lab)
>
> Leicester, Fax: 0116 252 5045
>
> LE1 9HN. email: nh88 at leicester.ac.uk<https://securewebmail.le.ac.uk/owa/redir.aspx?C=eb40ad2d61b94ab1be675ef17d30698a&URL=mailto%3anh88%40leicester.ac.uk>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.info-igor.org%2Fprivate.cgi%2Finfo-igor-info-igor.org%2Fattachments%2F20190902%2F31f791cd%2Fattachment.html&data=02%7C01%7Cnh88%40leicester.ac.uk%7Ca4329a45be1341218ea008d73229d441%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C0%7C637033027546423775&sdata=JlA0FdkxSMxQvbQUBksXGfd7%2FU2nhbO8UDSWY%2BCvroQ%3D&reserved=0>
> _______________________________________________
> Info-igor mailing list
> Info-igor at lists.info-igor.org
> https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.info-igor.org%2Flistinfo.cgi%2Finfo-igor-info-igor.org&data=02%7C01%7Cnh88%40leicester.ac.uk%7Ca4329a45be1341218ea008d73229d441%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C0%7C637033027546423775&sdata=1o%2BDbIC5gIwCVyiQvIYuhp7xvgPvGPMVMB3Ep3opCq0%3D&reserved=0
_______________________________________________
Info-igor mailing list
Info-igor at lists.info-igor.org
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.info-igor.org%2Flistinfo.cgi%2Finfo-igor-info-igor.org&data=02%7C01%7Cnh88%40leicester.ac.uk%7Ca4329a45be1341218ea008d73229d441%7Caebecd6a31d44b0195ce8274afe853d9%7C0%7C0%7C637033027546423775&sdata=1o%2BDbIC5gIwCVyiQvIYuhp7xvgPvGPMVMB3Ep3opCq0%3D&reserved=0