程式語言使用C#,sample channel為ai0與ai1,samplerate為4096,sample per channel為2048。
1. 由於4431啟動擷取大約需要3秒鐘,但應用上需要不間斷的擷取即時訊號,所以目前程式一開始即啟動DAQ擷取。
問題在於需要的資料在程式啟動後的某一特定時段,而不是程式一啟動後的所有資料,所以想請問在開始讀取需要的資料前,是否有C# API可以將PC上的Buffer先清空呢?
2. DAQ開始擷取後不久就會出現Attempted to read samples that are no longer available.錯誤,除了增加PC Buffer Size外,是否可設定CallBack的速度呢?
3. C#有API可以設定PC Buffer的Size,但不確定設定的單位為何?是否有文件說明? ex: 100代表100k?
在 04-29-2012 10:59 PM
請提供
OS version
NI-DAQmx version
Visual Studio version
資訊如下。
OS version:XP sp3
NI-DAQmx version:v9.40f1
Visual Studio version:C# 2010 Express
在 04-30-2012 08:22 AM
請問您使用哪個範例改寫?
是否能提供程式碼?
附件是程式碼,但不是從範例改寫。
參考的範例是ContAcqVoltageSamples_IntClk。
在 05-02-2012 03:27 AM
請下載 ni-daqmx 9.5.1 試試
http://joule.ni.com/nidu/cds/view/p/id/2933/lang/zht
說明文件
開始>>程式集>>national instruments>>ni-daq>>ni-daqmx help
搜尋>>buffer
How Is Buffer Size Determined?
Error code: - 200279
Description: Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.
Possible cause: The application did not retrieve the data from the buffer fast enough, so the data was overwritten.
Solutions: Increasing the buffer size or reading the data more frequently may correct the problem.
單位 samples per channel
由於我們使用C# .Net Framework 2.0,請問NationalInstruments.Common.dll使用9.1.20.159,NationalInstruments.Common.Native.dll使用9.1.20.159,NationalInstruments.DAQmx.dll使用9.4.20.50,配合ni-daqmx 9.5.1的driver,這樣ok嗎?
在 05-02-2012 10:18 PM
不OK
請手動移除再加入