Chapter 6 Application Programs
Using the APPLy Command
131
6
. . . continued
void out_setting(void)
{
/* Set 5.0 volts/1.0 amp to +6V output, 15 volts/1.0 amp to +25V output
and -10 volts/0.8 amps to -25V output. */
static char *cmd_string[]=
{
"APPL P6V, 5.0, 1.0;" /* Set 5.0 volts / 1.0 amp to +6V output */
"APPL P25V, 15.0, 1.0;" /* Set 15.0 volts / 1.0 amp to +25V output */
"APPL N25V, -10.0, 0.8" /* Set -10.0 volts / 0.8 amp to -25V output */
};
/* Call the function to execute the command strings shown above */
command_exe(cmd_string, sizeof(cmd_string)/sizeof(char*));
/* Call the function to check for errors */
check_error("out_setting");
}
/**************************************************************************/
void output_on(void)
{
IOOUTPUTS(ADDR, "OUTP ON", 7) /*Enable the outputs
}
/**************************************************************************/
void command_exe(char *commands[], int length)
{
/* Execute one command string at a time using a loop */
int loop;
for (loop = 0; loop < length; loop++)
{
IOOUTPUTS(ADDR, commands[loop], strlen(commands[loop]));
}
}
/**************************************************************************/