HANDLE GetProcessHandle(void);Visual Sample 1: Read Sample Data from VSI32
Get Process ID of VSI32void PostExit(void);
Inform VSI32 the CGI exit.long ReadLen(HANDLE id);
Read sample data length of VSI32long ReadFS(HANDLE id);
Read sample frequency of VSI32int WriteLen(HANDLE id,long len);
Write sample data length of VSI32int WriteFS(HANDLE id,long FS);
Write sample frequency of VSI32int ReadCH1(HANDLE id,short *wave,int size);
Read CH1 sample data of VSI32int ReadCH2(HANDLE id,short *wave,int size);
Read CH1 sample data of VSI32int writeCH1(HANDLE process,short *wave,int size);
Read CH1 sample data of VSI32int writeCH2(HANDLE process,short *wave,int size);
Read CH1 sample data of VSI32
#include "stdafx.h"Visual Sample21: Write Sample Data to VSI32
#include "ReadData.h"
#include "CGILib.h"CWinApp theApp;
using namespace std;int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{HANDLE id;
long len,Fs;
short wave1[2048],wave2[2048];
id=GetProcessHandle();
if (id==0) {AfxMessageBox("Error !");return 0;}
len=ReadLen(id);
Fs=ReadFS(id);
ReadCH1(id,wave1,2048);
ReadCH2(id,wave2,2048);
return 0;
}
#include "stdafx.h"
#include "writedata.h"
#include "CGILib.h"CWinApp theApp;
using namespace std;int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{HANDLE id;
short wave1[2048],wave2[2048];
id=GetProcessHandle();
if (id==0) {AfxMessageBox("Error !");return 0;}
for (int i=0;i<2048;i++)
{wave1[i]=2*i;
wave2[i]=-2*i;
}
writeCH1(id,wave1,2048);
writeCH2(id,wave2,2048);
WriteLen(id,2048);
WriteFS(id,5120);
PostExit();
return 0;
}
1.Start Visual C++, Use Project
Wizard to build a Win32 Console Application project, as show below.
¡£
2.Input project name and select
MFC support,, as show below.
3. Add CGILib.cpp and CGILib.h
to project, and use APIs to communicate with VSI32, as shown below.
¡£
[Return]
.
2004.1.10