data acquisition using FIFO
esalomon
I am trying to acquired data of undefined length using FIFO and store it in a text file whenever I stopped the acquisition.
I wrote the routine here after. Acquisition works but I do not manage to save the data in a text file.
Any hint on how doing this?
Thanks
eric
below is the routine I wrote.
macro testFIFO()
NewFIFO MyFIFO
NewFIFOChan/S MyFIFO, chan1, 0,1,0,10,"V"
CtrlFIFO MyFIFO, deltaT=0.1
Variable MyFIFORefnum
Open MyFIFORefnum
CtrlFIFO MyFIFO, file=MyFIFORefnum
NewPanel/N=ReadPressure /W=(1020, 0, 1670, 450)
Chart MyChart, fifo=MyFIFO, disable=0, chans={0}, size={400,400}
Chart MyChart, lineMode(0)=0, gain(0)=1, uMode=3
CtrlFIFO MyFIFO,start
DAQmx_Scan/DEV="dev4" FIFO="MyFIFO; 1;"
end
macro stopFIFO()
fDAQmx_ScanStop("dev4")
CtrlFIFO MyFIFO, stop
//KillFIFO myFIFO
//make/n=132 test
//FIFO2Wave MyFIFO chan1 test
end
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
July 26, 2017 at 12:25 pm - Permalink
The point is that I would like to avoid having to convert FIFO into wave. The lines in comments at the end of my routine were just to test this issue.
I would like to record data of undetermine length and store them in a file simultaneously so that whenever I stop the acquisition or when the computer crashes, the data are saved.
The command SaveData does not work with FIFO, so I am kind of stuck.
I put the following command to connect the FIFO to a disk file
Variable MyFIFORefnum
Open MyFIFORefnum
CtrlFIFO MyFIFO, file=MyFIFORefnum
but nothing is save, or at least nothing readable;
Any idea?
Thanks
eric
July 27, 2017 at 05:39 am - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
July 27, 2017 at 09:48 am - Permalink
Many thanks, eric
July 28, 2017 at 12:35 am - Permalink