One final note for anyone reading this--in order to pull data off from multiple channels, you need to read each channel sequentially (so call WAVEFORM CHAN1 and read out the data, then WAVEFORMCHAN2, u.s.w.)--there's no routines to pull off multiple channels at the same time.
I\m trying to run this code with a 3014A system, and I'm getting a variety of instrument errors (typicaly 113 undefined header, 222 data out of range, 224 Illegal parameter value, 410 query interrupted, 420 query unterminated). It eventually does output a square-wave to figure 1 (I'm using the Demo 2 system with the oscilloscope) but the output is of the wrong sign (I expect a square between 0 and 2.5 V, it goes from -2.7 to 0).