Specifications

Remote Programming 4-23
DS360 Ultra Low Distortion Function Generator
Example 2: RS232 communication in BASIC language
BASIC program to demonstrate communication with the DS360 via RS232.
Program assumes the DS360 BAUD rate is set to 9600.
10 OPEN “com2:9600,n,8,2,cs,ds,cd” FOR RANDOM AS #1 ‘ Setup com2’
20 PRINT #1, “ ”
30 PRINT #1, “*RST” ‘ Reset the DS360’
40 GOSUB 190 ‘ Query DS360 and display result’
50 PRINT #1, “FREQ123456” ‘ Set new frequency to 123.456kHz’
60 GOSUB 190 ‘ Query DS360 and display result’
70 PRINT #1, “*RST” ‘ Reset the DS360’
80 FOR I=0 TO 4 ‘ Step through all functions ‘
90 PRINT #1, “FUNC”,I
100 GOSUB 190 ‘ Query DS360 and display result’
110 NEXT I
120 PRINT #1, “*RST” ‘ Reset the DS360’
130 PRINT #1, “AMPL0VP” ‘ Set amplitude to 0 volts’
140 FOR I=-5 TO 5 ‘ Set offset from -5V to 5v’
150 PRINT #1, “OFFS”,I ‘ and query each time’
160 GOSUB 190 ‘ Query DS360 and display result’
170 NEXT I
180 END
‘ Routine to query the DS360 frequency,’
190 PRINT #1, “FREQ?” ‘ amplitude and offset and display them’
200 INPUT #1, F
210 PRINT #1, “AMPL?VP”
220 INPUT #1, A
230 PRINT #1, “OFFS?”
240 INPUT #1, O
250 PRINT “Freq=“ ;F; “ Ampl=“; A; “ Offs=“; O
260 RETURN