好文档 - 专业文书写作范文服务资料分享网站

过程控制系统实验报告汇总

天下 分享 时间: 加入收藏 我要投稿 点赞

DRV_DeviceOpen(0,&DriverHandle); ptAOConfig.chan=0;//AO 通道 0

ptAOConfig.RefSrc=0;//内部参考源

ptAOConfig.MaxValue=10;

ptAOConfig.MinValue=0;

DRV_AOConfig(DriverHandle, (LPT_AOConfig)&ptAOConfig); //电压输出 FILE *fp;

fp=fopen(\

while(!kbhit())

{

ptCounterEventStart.counter=0;

DRV_CounterEventStart(DriverHandle,&ptCounterEventStart);

ptCounterEventRead.counter=0;

ptCounterEventRead.overflow=&over; ptCounterEventRead.count=&num1; DRV_CounterEventRead

(LPT_CounterEventRead)&ptCounterEventRead);

DRV_CounterEventRead (DriverHandle, &ptCounterEventRead); Sleep(500);

ptCounterEventRead.counter=0;

ptCounterEventRead.overflow=&over; ptCounterEventRead.count=&num2; DRV_CounterEventRead

(LPT_CounterEventRead)&ptCounterEventRead);

DRV_CounterEventRead (DriverHandle, &ptCounterEventRead);

count=num2-num1;

Q=0.5+(2*(count-13))*0.0122;

printf(\ \

(DriverHandle,(DriverHandle,20

fprintf(fp,\ \

e1=e2;

e2=e3; e3=Qh-Q;

U+=Kc*(e3-e2)+(Kc*Ts/Ti)*e3; if(U>=10)

U=10; if(U<=0)

U=0; t+=0.5;

ptAOVoltageOut.chan = 0;

ptAOVoltageOut.OutputValue=U;//所要设置的输出电压值,浮点型数据 DRV_AOVoltageOut(DriverHandle,(LPT_AOVoltageOut)&ptAOVoltageOut);

printf(\ fprintf(fp,\ }

fclose(fp);

DRV_CounterReset(DriverHandle,0); DRV_DeviceClose( &DriverHandle ); }

21

22

过程控制系统实验报告汇总

DRV_DeviceOpen(0,&DriverHandle);ptAOConfig.chan=0;//AO通道0ptAOConfig.RefSrc=0;//内部参考源ptAOConfig.MaxValue=10;ptAOConfig.MinValue=0;DRV_AOConfig(DriverHandl
推荐度:
点击下载文档文档为doc格式
4xtc955jqm2p7v43zg0p6rgfk15t3500h6u
领取福利

微信扫码领取福利

微信扫码分享