Instructions
Chapter 5 Programming Examples  RIGOL 
RSA3000E Programming Guide  5-27 
cout<<"Bad command!"<<endl; 
} 
} 
return 1; 
} 
4.  makefile file 
src = DemoForRSA.cpp mainloop.cpp DemoForRSA.h 
obj = DemoForRSA.o mainloop.o 
INCLUDE= -I/usr/local/vxipnp/linux/include 
LIB= -lvisa -lc -lpthread 
CC= 
demo : $(obj) 
$(CC) $(INCLUDE) $(LIB) -o demo $(obj) 
mainloop.o : mainloop.cpp DemoForRSA.h 
$(CC) -c $< -o $@ 
DemoForRSA.o: DemoForRSA.cpp DemoForRSA.h 
$(CC) -c $< -o $@ 
.PHONY : clean 
clean: 
rm demo $(obj) 
5.  Run the results. 
1)  #make 
2)  ./demo 
3)  When the program runs, the instrument is connected automatically. If no instrument is found, a 
prompt message "No VISA equipment!" is displayed, and the system exits the program. If the 
instrument is found and successfully connected, the following interface is displayed, as shown in 
the figure below. 
4)  Input write<command> (for example, write<*IDN?>) to write the command into the spectrum 
analyzer. 
5)  Input "read" to read the return value, as shown in the figure below. 










