Program Examples
3-21
if ((ds345 = ibfind("DS345")) < 0) /* open National driver */
{
printf ("Cannot find DS345\n");
exit(1);
}
sum = 0;
/* initialize checksum */
number = 250;
/* 250 verteces */
/* each vertex has an x and y value, we will step x in increments of 50
and y in increments of 8 with alternating sign (zig-zag up and down */
for (i = 0 ; i < number ; i++)
{
data[2*i] = 50*i;
/* x */
data[2*i+1] = 8*i*(-1 + 2*(i%2)); /* y */
sum += (data[2*i] + data[2*i+1]); /* add x and y to checksum */
}
data[2*number] = sum; /* checksum */
sprintf (cmd,"LDWF?1,%d\n",number);
/* command to load waveform */
ibwrt (ds345,cmd,strlen(cmd));
ibrd (ds345,cmd,40);
/* read back reply before sending data */
ibwrt (ds345,(char *)data,(long)4*2); /* number of bytes = 4 per data
point(x and y) + 2 for checksum */
sprintf (cmd,"FUNC5\n"); /* arb wf output */
ibwrt (ds345,cmd,strlen(cmd));
}
Summary of Contents for DS345
Page 2: ......
Page 5: ...DS345 Synthesized Function Generator iii...
Page 20: ...Introduction 2 4...
Page 64: ...Programming Commands 3 14...
Page 72: ...Program Examples 3 22...
Page 78: ...Troubleshooting 4 6...
Page 82: ...Performance Tests 5 4...
Page 101: ...Calibration 6 10...
Page 109: ...Arbitrary Waveform Composer 7 8...
Page 117: ...DS345 Circuitry 8 8...