📄 sampling.c
字号:
/**************************************************************//* *//* Program Name : sampling *//* *//* Version: 0.00 2001-08-17 *//* 1.00 2002-05-26 *//* *//* Copyright (c) 2002 T.Kondo/CRL All Right Reserved *//* *//**************************************************************//* 俬俹亅倁俴俛俬 僆僼儔僀儞僒儞僾儕儞僌僾儘僌儔儉 乮帪崗僙僢僩偼暿偺僜僼僩偱峴偆) by T.Kondo 2001.8.17 1.0 2002.5.26 憱傜偣曽 sampling_n span sfreq adbit numch [filename] 偙偙偱 span 廂廤帪娫乮昩乯 sfreq 僒儞僾儕儞僌廃攇悢 40,100,200,500 (kHz) 1,2,4,8,16 (MHz) adbit 俙俢暘夝擻乮價僢僩) 1,2,4,8 numch 僠儍僱儖悢 1 傑偨偼 4 filename -- 僨乕僞僼傽僀儖柤 僨僼僅儖僩偼tds.data*/#include <stdio.h>#include <errno.h>#include <fcntl.h>#include <unistd.h>#include <math.h>#include <sys/stat.h>#ifdef linux#include <sys/time.h>#else#include <time.h>#endif#include <sys/tdsio.h>#include "libipvlbi.h" // IP-VLBI梡娭悢孮(by T.Kondo)#include "libipvlbi_board.h" // IP-VLBI僒儞僾儔乕儃乕僪梡娭悢孮(by T.Kondo)int main(int argc, char **argv){ char outfile[60]; char* dflt_fname="tds.data"; int rv; int span, sfreq, adbit, numch; if(argc != 5 & argc !=6){ printf("Usage: sampling span sfreq adbit numch [filename]\n"); printf("\n"); printf(" where span ---- duration (sec)\n"); printf(" sfreq ---- sampling frequency\n"); printf(" 40,100,200,500 (for kHz)\n"); printf(" 1,2,4,8,16 (for MHz)\n"); printf(" adbit ---- A/D bit\n"); printf(" 1,2,4,8\n"); printf(" default is 1\n"); printf(" numch ---- number of channel\n"); printf(" 1,4\n"); printf(" default is 1\n"); printf(" filename ---- out file name\n"); printf(" default is tds.data\n"); exit(0); } span = atoi(*(argv + 1 )); sfreq= atoi(*(argv + 2 )); if (argc>=4) { adbit = atoi(*(argv + 3 )); } else { adbit=1; } if (argc>=5) { numch = atoi(*(argv + 4 )); } else { numch=1; } if (argc>=6) { strcpy(outfile,*(argv+5)); } else { strcpy(outfile,dflt_fname); } printf(" span = %d\n",span); // debug printf(" sfreq = %d\n",sfreq); // debug printf(" adbit = %d\n",adbit); // debug printf(" numch = %d\n",numch); // debug printf(" outfile = %s\n",outfile); // debug rv=sampleget(outfile, span, sfreq, adbit, numch); printf("Data File is %s\n",outfile); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -