Instructions

Table Of Contents
RIGOL Chapter 3 Programming Examples
3-22 RSA5000 Programming Guide
Linux Programming Procedures
1. Edit the DemoForRSA.h header file and declare a class to encapsulate the operation and property of
the instrument.
#ifndef DEMO_FOR_RSA_H
#define DEMO_FOR_RSA_H
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <iostream>
//#include <syswait.h>
using namespace std;
#define MAX_SEND_BUF_SIZE 50
#define MAX_REC_SIZE 300
class DemoForRSA
{
// Construction
public:
DemoForRSA();
bool InstrRead(string strAddr, string & pstrResult);
bool InstrWrite(string strAddr, string strContent);
bool ConnectInstr();
string m_strInstrAddr;
string m_strResult;
string m_strCommand;
};
void makeupper(string & instr);
#endif
2. Edit the DemoForRSA.cpp file to realize various operations of the instrument.
#include "visa.h"
#include "DemoForRSA.h"
DemoForRSA::DemoForRSA()
{
m_strInstrAddr = "";
m_strResult = "";
m_strCommand = "";
}
bool DemoForRSA::ConnectInstr()
{
ViUInt32 retCount;
ViStatus status;
ViSession defaultRM;
ViString expr = "?*";
ViPFindList findList = new unsigned long;
ViPUInt32 retcnt = new unsigned long;
string strSrc = "";