Appendix B: Programming Examples
char* pdest;
strcpy(commandString,pString);
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());
}
PWS4205, PWS4305, PWS4323, PWS4602, and PWS4721 Power Supply Programmer Manual
B-3
Summary of Contents for PWS4205
Page 2: ......
Page 8: ...Preface iv PWS4205 PWS4305 PWS4323 PWS4602 and PWS4721 Power Supply Programmer Manual...
Page 9: ...Getting Started...
Page 10: ......
Page 61: ...Status and Events...
Page 62: ......
Page 75: ...Appendices...
Page 76: ......