BCB結合 API 涵式庫應用 |
缺席
|
zxcvb8057
一般會員 發表:6 回覆:3 積分:1 註冊:2011-09-12 發送簡訊給我 |
|
HomeSound
中階會員 發表:44 回覆:178 積分:94 註冊:2002-08-31 發送簡訊給我 |
|
zxcvb8057
一般會員 發表:6 回覆:3 積分:1 註冊:2011-09-12 發送簡訊給我 |
不好意思 因為我不是很懂怎使用 謝謝高手幫忙
The next chapters of this manual deliver the detailed description of each function. The following example explains the procedure of a measurement of length values with the output word rate of 1 Hz and with default filter settings. That means, the DLL calculates the settings of the internal signal processing based on the given output word rate so that vibrations of the reference mirror vibrator as well as other possible distortions are suppressed as good as possible. //----------------------------------------------------------------------------------------------------------------- #include #include #include "siosifmdll.h" int main(int argc, char *argv[]) { int error=0; // before IfmInit; make some settings // IFM_OPTION_DEBUGFILES let the DLL create files with information for //debug purposes //IfmSetOption(IFM_OPTION_DEBUGFILES, true); // first initialize the DLL error=IfmInit(); if(error){ printf("Error %d during IfmInit\n",error); return(1); } // Search for connected devices; returns the number of via USB //connected devices int cnt; cnt=IfmSearchUSBDevices(); if(cnt<=0){ printf("A SIOS interferometer could not be found\n"); IfmClose(); return(0); } int devNo; // The first device will be opened; // IfmUSBDeviceSerial and IfmOpenUSB takes a parameter for selecting //the device from 0 to cnt-1 printf("Open device with serial number %s\n",IfmUSBDeviceSerial(0)); devNo=IfmOpenUSB(0); if(devNo>0){ printf("Error during opening the device.\n"); IfmClose(); return(0); } // IfmOpenUSB has returned a number (devNo) which describes the device // in further calls to the DLL. // Now the measurement should be configured. The following //configuration are required: // the length values of the first channel with 1 Hz output // word rate. For the removing of the the vibration of the reference // mirror from the signal, the default filter will be set with the // flag IFM_MEAS_FILTER_DEFAULT // in some applications the flag IFM_MEAS_FILTER_NONE may be required // for unfiltered output error=IfmSetMeasurement(devNo,IFM_MEAS_ONECHANNEL|IFM_MEAS_LENGTH|IFM_MEAS_FILTER_DEFAULT,1); // error numbers are always negative if(error<0){ printf("Error during opening the device.\n"); IfmClose(); return(0); } // Set the length values to zero; assuming the measurement mirror is at the reference/zero position error=IfmSetToZero(devNo,0x0F); printf("Printing length data until a key is pressed\n\n"); // begin with the output of dates error=IfmStart(devNo); if(error<0){ printf("Error during start output.\n"); IfmClose(); return(0); } while(!kbhit()){ // are new values available? if(IfmValueCount(devNo)){ // put the value in an internal buffer for access via //IfmLengthValue IfmGetValues(devNo); // get the value together with environmental values printf("%lf %lf °C %lf Pa\n", IfmLengthValue(devNo,0), IfmTemperature(devNo,0), IfmAirPressure(devNo,0)); } } //deinitialize // stop the output of data IfmStop(devNo); // close the device; devNo will be no longer valid IfmCloseDevice(devNo); // close the DLL IfmClose(); } /---------------------------------------------------------------------------------------------------------------- 這個好像是他初始 設定 之後 功能 都用 IfmClose Syntax void IfmClose() //---------------------------------------- IfmInit Syntax int IfmInit() //---------------------------------------- |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |