30.01.2015 Views

DS335 Synthesized Function Generator

DS335 Synthesized Function Generator

DS335 Synthesized Function Generator

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Programming Examples 3-13<br />

EXAMPLE 2: RS232 COMMUNICATION. BASIC LANGUAGE<br />

BASIC Program to demonstrate communication with the <strong>DS335</strong> via RS232. Program assumes the RS232<br />

option is enabled (use [SHIFT] [2]) and the BAUD rate is set to 9600.<br />

10 OPEN "com2:9600,n,8,2,cs,ds,cd" FOR RANDOM AS #1 'Set up com2'<br />

20 PRINT #1, " "<br />

30 PRINT #1, "*rst" 'Reset the <strong>DS335</strong>'<br />

40 GOSUB 190 'Query <strong>DS335</strong> and diplay result'<br />

50 PRINT #1, "freq1234567" 'Set new frequency'<br />

60 GOSUB 190 'Query <strong>DS335</strong> and diplay result'<br />

70 PRINT #1, "*rst" 'Reset the <strong>DS335</strong>'<br />

80 FOR I = 0 TO 4 'Step through all functions'<br />

90 PRINT #1, "func", I<br />

100 GOSUB 190 'Query <strong>DS335</strong> and diplay result'<br />

110 NEXT I<br />

120 PRINT #1, "*rst" 'Reset the <strong>DS335</strong>'<br />

130 PRINT #1, "ampl 0vp" 'Set amplitude to 0 volts '<br />

140 FOR I = -5 TO 5 'Set <strong>DS335</strong> offset from -5V to +5V'<br />

150 PRINT #1, "offs", I 'and query each time'<br />

160 GOSUB 190 'Query <strong>DS335</strong> and diplay result'<br />

170 NEXT I<br />

180 END<br />

'Routine to query the <strong>DS335</strong> frequency,'<br />

190 PRINT #1, "freq" 'offset, and amplitude and display them'<br />

200 INPUT #1, F<br />

210 PRINT #1, "ampl"<br />

220 INPUT #1, A<br />

230 PRINT #1, "offs"<br />

240 INPUT #1, O<br />

250 PRINT " Frequ="; F; " Ampl="; A; " Offs="; O<br />

260 RETURN<br />

<strong>DS335</strong> <strong>Synthesized</strong> <strong>Function</strong> <strong>Generator</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!