User Manual

Section 4: Command reference Series 2200 Programmable DC Power Supplies Reference Manual
4-48 2200S-901-01 Rev. A/November 2011
strcat(commandString, "\n");
ErrorStatus = viPrintf(PWS4000, commandString);
CheckError("Can't Write to Power Supply");
pdest = strchr(commandString, '?'); //Search for query
command
if (pdest != NULL)
{
ErrorStatus = viBufRead(PWS4000, (ViBuf)ReadBuffer,
sizeof(ReadBuffer), VI_NULL);
CheckError("Can't read from driver");
strcpy(pString, ReadBuffer);
}
}
void ClosePort()
{
viClose(PWS4000);
viClose(defaultRM);
}
void CheckError(char* pMessage)
{
if(ErrorStatus != VI_SUCCESS)
{
printf("\n %s",pMessage);
ClosePort();
exit(0);
}
}
void delay(clock_t wait)
{
clock_t goal;
goal = wait + clock();
while(goal > clock());
}