3302C Series Mainframe Operation Manual B-7
char tmpbuf[20] ={"chan "};
int cnt,result,t,cmp,measerr;
char ch;
char rdtmpbuf[20],chanbuf[20];
char measbuf[6];
for (cnt = 0; cnt < wrtmcnt; cnt++, +)
{
measbuf[cnt] = *wrtmbuf;
}
strupr(measbuf);
cnt = 0;
do
{
measerr = strncmp(measbuf,wrtbuf[cnt],6);
cnt = cnt++;
}while((cnt != 10) && (measerr != 0));
if(measerr == 0)
{
result = SUCCESS;
if (strncmp(measbuf,"CURR", 4) == 0)
{
ch = measbuf[5];
switch(ch)
{
case '1':
pd_wrt("chan 1",6);
pd_wrt("meas:curr?",10);
pd_rd(rdmbuf,rdmcnt);
strncat(tmpbuf,chanbuf,1);
pd_wrt(tmpbuf,6);
break;
case '2':
pd_wrt("chan 2",6);
pd_wrt("meas:curr?",10);
pd_rd(rdmbuf,rdmcnt);
strncat(tmpbuf,chanbuf,1);
pd_wrt(tmpbuf,6);
break;
case '3':
pd_wrt("chan 3",6);
pd_wrt("meas:curr?",10);
pd_rd(rdmbuf,rdmcnt);
strncat(tmpbuf,chanbuf,1);
pd_wrt(tmpbuf,6);