EasyManuals Logo

Rigol DP800 Series Programming Guide

Rigol DP800 Series
134 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 #120 background imageLoading...
Page #120 background image
RIGOL Chapter 4 Programming Demos
4-16 DP800 Programming Guide
6 Encapsulate the write and read operations of VISA.
1) Encapsulate the write operation of VISA for easier operation.
bool CDP800_DEMO_VCDlg::InstrWrite(CString strAddr, CString strContent) //write function
{
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 the VISA instrument
status = viOpenDefaultRM(&defaultRM);
if (status < VI_SUCCESS)
{
AfxMessageBox("No VISA instrument was opened !");
return false;
}
status = viOpen(defaultRM, SendAddr, VI_NULL, VI_NULL, &instr);
//write command to the instrument

Table of Contents

Other manuals for Rigol DP800 Series

Questions and Answers:

Question and Answer IconNeed help?

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

Rigol DP800 Series Specifications

General IconGeneral
BrandRigol
ModelDP800 Series
CategoryPower Supply
LanguageEnglish

Related product manuals