EasyManuals Logo

Rigol DSA832E Programming Guide

Rigol DSA832E
243 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #220 background imageLoading...
Page #220 background image
RIGOL Chapter 3 Programming Demos
3-6 DSA800E Programming Guide
5. Add the control variables.
Open the Member Variables tab in View  ClassWizard and add the following three variables:
Instrument Address: CString m_strInstrAddr
Command: CString m_strCommand
Return Value: CString m_strResult
6. Encapsulate the read and write operations of VISA.
1) Encapsulate the write operation of VISA for easier operation.
bool CDemoForDSADlg::InstrWrite(CString strAddr, CString strContent) //Write operation
{
ViSession defaultRM,instr;
ViStatus status;
ViUInt32 retCount;
char * SendBuf = NULL;
char * SendAddr = NULL;
bool bWriteOK = false;
CString str;
// Change the address's data style from CString to char*
SendAddr = strAddr.GetBuffer(strAddr.GetLength());
strcpy(SendAddr,strAddr);
strAddr.ReleaseBuffer();
// Change the command's data style from CString to char*
SendBuf = strContent.GetBuffer(strContent.GetLength());
strcpy(SendBuf,strContent);
strContent.ReleaseBuffer();
//open a VISA resource
status = viOpenDefaultRM(&defaultRM);
if (status < VI_SUCCESS)
{
AfxMessageBox("No VISA resource was opened!");
return false;
}
status = viOpen(defaultRM, SendAddr, VI_NULL, VI_NULL, &instr);
//Write command to the instrument
status = viWrite(instr, (unsigned char *)SendBuf, strlen(SendBuf), &retCount);

Table of Contents

Other manuals for Rigol DSA832E

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Rigol DSA832E and is the answer not in the manual?

Rigol DSA832E Specifications

General IconGeneral
BrandRigol
ModelDSA832E
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals