全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1443
推到 Plurk!
推到 Facebook!

BCB結合 API 涵式庫應用

缺席
zxcvb8057
一般會員


發表:6
回覆:3
積分:1
註冊:2011-09-12

發送簡訊給我
#1 引用回覆 回覆 發表時間:2011-12-14 21:57:17 IP:114.42.xxx.xxx 訂閱
各位 先進 高手 好 


最近遇到 BCB 難題 學校要作一個題目
震動分析儀 它是USB的 要寫一個BCB能 SHOW震動數據
問過廠商 他說有支援API涵式庫
請問一下 我該如何下手? 對程式不是很懂



謝謝
編輯記錄
zxcvb8057 重新編輯於 2011-12-14 06:57:36, 註解 無‧
zxcvb8057 重新編輯於 2011-12-19 17:42:18, 註解 無‧
HomeSound
中階會員


發表:44
回覆:178
積分:94
註冊:2002-08-31

發送簡訊給我
#2 引用回覆 回覆 發表時間:2011-12-20 02:00:35 IP:219.80.xxx.xxx 訂閱
能否把廠商給的資料Po上來,如文件的某一小段,或是Dll函數庫
這樣大家才有辦法幫你解答喔!
------
--==多看.多學.多聽==--
zxcvb8057
一般會員


發表:6
回覆:3
積分:1
註冊:2011-09-12

發送簡訊給我
#3 引用回覆 回覆 發表時間:2011-12-20 08:46:06 IP:163.21.xxx.xxx 訂閱
不好意思 因為我不是很懂怎使用        謝謝高手幫忙


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()
//----------------------------------------

系統時間:2024-04-27 2:43:20
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!