
NidaqTools: DAQmx_Scan with Subfolders

LausX
I tried to use the command DAQmx_Scan/DEV="NI9239" WAVES="Wave1,0,-5,5;" with a wave "Wave1" which is created in a subfolder of root.
Everytime I get the error message that there is no wave. If the wave "Wave1" is created in the root folder everything is fine.
Do you know how to tell DAQmx_Scan that the wave is in a different folder?
Small Example:
this works:
Function test() Wave Wave1 DAQmx_Scan/DEV="NI9239" WAVES="Wave1,0,-5,5;" MatrixOP/O avgW1 = mean(Wave1) return avgW1 End
this not:
Function test() DFREF dfr1 = GetDataAcqTRMokeScansDFREF() Wave/SDFR = dfr1 Wave1 DAQmx_Scan/DEV="NI9239" WAVES="Wave1,0,-5,5;" MatrixOP/O avgW1 = mean(Wave1) return avgW1 End
Thanks a lot.
Should
Wave/SDFR = dfr1 Wave1
be
Wave/SDFR Wave1 = dfr1
Andy
April 2, 2017 at 07:21 am - Permalink
Since the documentation for the WAVES keyword says that it takes a "wavename" as a parameter, I suspect that it does not support a path to a wave. Thus, you have to set the current directory before calling DAQmx_Scan. You can restore it after. The help for GetDataFolderDFR shows how to save and restore the current data folder.
April 2, 2017 at 10:39 am - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
April 3, 2017 at 09:18 am - Permalink