EasyManua.ls Logo

Rigol DSA832E

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
Loading...
RIGOL Chapter 3 Programming Demos
3-24 DSA800E Programming Guide
Linux Programming Procedures
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 = "";

Table of Contents

Other manuals for Rigol DSA832E

Related product manuals