Application Programs 105
error = iooutputs(SLOTO, cmd, strlen(cmd));
error_handler(error, cmd);
cmd = "VOLT:MODE LIST”; /* Set to get voltage from List */
error = iooutputs(SLOTO, cmd, strlen(cmd));
error_ handler(error, cmd);
/* Sending voltage data points requires two steps using the Agilent -1B Command Library. The instruction contains both string data and a
real array. First, send the string data command header "LIST:VOLT “ to the module using iooutputs. Then, send the real array using iooutputa.
However, you must inhibit the EOI and End-of-Line terminator after the iooutputs or the module will stop taking data. Then, re-enable them
to terminate the iooutputa. */
error = ioeoi(INTERFACE, 0); /* Turn off EOI */
error_handler(error, "Disabling EOI”);
error = ioeol(INTERFACE, “”, 0); /* Turn off End-of-Line termination */
error-handler(error, "Disabling EOI”);
cmd = "LIST:VOLT “; /* First send the voltage header (string) ... */
error = iooutputs(SLOTO, cmd, strlen(cmd));
error_handler(error, cmd);
error = ioeoi(INTERFACE, 1); /* Turn on EOI */
error_handler(error, "Enabling EOI”);
error = ioeoL(INTERFACE, cr_lf, strlen(cr_lf)); /* Turn on End-of-Line termination */
error_handler(error, "Enabling EOL”);
error = iooutputa(SLOTO, &vstep[1], NUM_PTS); /* Download voltage points (array), starting */
error_handler(error, "Voltage List Array"); /* with the element 1, not 0. */
sprintf(cmd_buff, "LIST:DWELL %f”, dwell); /* Download 1 dwell time. Use number to */
error = iooutputs(SLOTO, cmd_buff, strlen(cmd_buff));/* string conversion to send the real */
error_handler(error, cmd_buff); /* number over the bus as part of the */
/* command string. */
cmd = "LIST:STEP AUTO"; /* Dwell-paced List */
error = iooutputs(SLOTO, cmd, strlen(cmd));
error_handler(error, cmd);
cmd = "INITIATE"; /* Enable trigger to start List
error = iooutputs(SLOTO, cmd, strlen(cmd));
error_handler(error, cmd);
/* Before triggering the module, determine if it is ready by checking for
'Waiting for Trigger' (bit 5 of the Operation Status Register).
You could eliminate this step by simply inserting a pause in the program. However, by checking the instrument status,
you can avoid timing problems. Also, any other operations that take time will give the module a chance to complete processing. */
do {
cmd = "STATUS:OPERATION:CONDITION?”;
error = iooutputs(SLOTO, cmd, strlen(cmd));
error_handler(error, cmd);
error = ioenter(SLOTO, &condition_data); /* You must convert float to integer */
error_handler(error, "Read back of status"); /* to do an integer bit test. */