DSA800 series programming guide - Page 246

For DSA815.

Loading ...
Loading ...
Loading ...
RIGOL Chapter 3 Programming Demos
3-24 DSA800 Programming Guide
1. Edit the DemoForDSA.h header file and declare a class to encapsulate the operation and property of
the instrument.
#ifndef DEMO_FOR_DSA_H
#define DEMO_FOR_DSA_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 DemoForDSA
{
// Construction
public:
DemoForDSA();
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 DemoForDSA.cpp file to realize various operations of the instrument.
#include "visa.h"
#include "DemoForDSA.h"
DemoForDSA::DemoForDSA()
{
m_strInstrAddr = "";
m_strResult = "";
m_strCommand = "";
}
bool DemoForDSA::ConnectInstr()
{
ViUInt32 retCount;
ViStatus status;
ViSession defaultRM;
ViString expr = "?*";
ViPFindList findList = new unsigned long;
ViPUInt32 retcnt = new unsigned long;
string strSrc = "";
string strInstr = "";
ViChar instrDesc[1000];
Loading ...
Loading ...
Loading ...