beautypg.com

KEPCO BIT 232F User Manual

Page 63

background image

BIT 232 022800

E-3

{

if (string[j] == ‘\r’)

string[j] = ‘\0’;

}

/* get maximum voltage */

strcpy(string, “volt?max”);

SendCmmdWready(string);

/* change the first \r in end of string */

for (j = 0; j < strlen(string); j++)

{

if (string[j] == ‘\r’)

string[j] = ‘\0’;

}

max = atof(string);

if (max <= 10.0)

vl=1;

else

{

if (max <= 100.0)

vl=2;

else

vl=3;

}

j=0;

volt[0]=string[j];

volt[1]=’\0’;

j ++;

if (vl > 1)

if( string[j] == ‘.’)

{

j ++;

volt[1]=string[j];

volt[2]=’\0’;

}

else

{

volt[1]=string[j];

volt[2]=’\0’;

}

if (vl > 2)

if( string[j] == ‘.’)

{

j ++;

volt[2]=string[j];

volt[3]=’\0’;

}

else

{

volt[2]=string[j];

volt[3]=’\0’;

}

strcpy(string, “volt “);

strcat(string, volt);

strcat(string, curr);

strcpy(stringm, “volt -”);

strcat(stringm, volt);

strcat(stringm, curr);

/* main program loop */

while (TRUE) {

/* process keyboard presses */

if (kbhit()) {

This manual is related to the following products: