EasyManua.ls Logo

Pendulum CNT-91 - Page 48

Default Icon
264 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Status = viWrite(Instr, “*IDN?\n”, 6, &RetCount);
Status = viRead(Instr, Buffer, MAX_CNT, &RetCount);
Buffer[RetCount]=0;
printf(“%s\n”,Buffer);
Status = viWrite(Instr, “INIT:CONT OFF;:func ‘per’\n”, 25,
&RetCount);
while( i++<10){
Status = viWrite(Instr, “init;fetc?\n”, 11, &RetCount);
if (Status != VI_SUCCESS) {
printf(“Write: status = %x, i = %d\n”, Status, i);
/* Close down the system */
Status = viClose(Instr);
Status = viClose(defaultRM);
return 0;
}
Sleep(200);
Status = viRead(Instr, Buffer, MAX_CNT, &RetCount);
if (Status != VI_SUCCESS) {
printf(“Read: status = %x, i = %d\n”, Status, i);
/* Close down the system */
Status = viClose(Instr);
Status = viClose(defaultRM);
return 0;
}
Buffer[RetCount]=0;
printf(“%s\n”,Buffer);
Sleep(25);
}
Status = viWrite(Instr, “syst:err?\n”, 10, &RetCount);
Sleep(25);
Status = viRead(Instr, Buffer, MAX_CNT, &RetCount);
Buffer[RetCount]=0;
printf(“%s\n”,Buffer);
/* Close down the system */
Status = viClose(Instr);
Status = viClose(defaultRM);
return 0;
}
void Sleep( clock_t Wait )
{ clock_t Goal;
Goal = Wait + clock();
while( Goal > clock() )
;
}
Programming Examples
4-12 USB Communication (Ex. #4)

Table of Contents

Other manuals for Pendulum CNT-91

Related product manuals