5-xPC-Target

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

xPCTarget主讲教师姜洪洲机电学院PCIn-the-LoopRTWWindowsTargetxPCTargetMatlabSimulinkRealTimeWorkshopStateflowWhatisxPCTarget(1)采用Host-Target模式,基于PC的,快速开发实时应用的解决方案。HostPC:DesktopPC、LaptopPCTargetPC:DesktopPC、LaptopPC、IndustrialPC、CompactPCI、PXI、PC-104、SingleBoardPCWhatisxPCTarget(2)在hostPC上开发和建立程序在targetPC上,实时运行程序,进行信号的采集、参数的调整TargetPC为廉价的计算机硬件和接口板TargetPCRS232orTCP/IPHostPCFeaturesofxPCTargetRealTimeKernelRealTimeApplicationSignalAcquisitionParameterTuningReal-timekernelRealTimekernel基于德国On-time公司的RTTarget-32(与win32兼容的、针对x86嵌入式系统、32位保护模式实时操作系统)*.dlm(DynamicLinkableModule)TargetBootDiskTargetPCBIOSTargetPCheap返回Real-timeApplicationMemoryModel(WindowsNTapplicationwiththeflatmemorymodel)TaskExecutionTime返回SignalAcquisitionSignalMonitoringacquiringsignaldatawithouttimeinformationSignalLoggingacquiringsignaldataduringareal-timerunUploaddatafromthetargetPCaftertherunSignalTracingacquiringandvisualizingsignalsduringareal-timerunUploaddatawhilethetargetapplicationisrunning.返回ParameterTuningInteractivexPCTargetsupportsinteractivetuningofparameterswhilethetargetapplicationisrunninginrealtime.ThechangestoparametersareimmediatelyreflectedinthesignaloutputsScriptsandbatchproceduresxPCTargetalsoincludescommandstochangeparametersduringarunorbetweenruns.Bywritingascriptthatincrementallychangesaparameterandmonitorsasignaloutput,youcanoptimizethevalueofthatparameter返回SystemRequirementsandConfigurationofxPC(HOST)1.软件要求2.硬件要求SystemRequirementsandConfigurationofxPC(TARGET)1.软件要求2.硬件要求xPCTargetSetup命令xpcsetup内容:Compiler(WatcomC/C++,VisualC/C++)Host-TargetCommunication(RS232,TCP/IP)BootMode(bootdisk\standalone\DOSloader)xPCTargetEmbeddedOptionsBootdisk(floppydisk)DOSLoader(DOSboot+xpcboot.com)Standalone(DOSboot+xpcboot.com+model.rtb)xpcbootmodel.rtbAtuoexec.batDOSsystembootdiskCommunicationforhost-targetRS232(115200bps)Ethernet(10M/100MEthernetcard)Communicationfortarget-targetRS232(characterandbinarymode)UDPCANSharedmemory(SystranandSBS)xPCblocklibraryI/OdriverRS232CANSharedmemoryUDPScope/dngWatchdog......xPCTargetI/ODriverAdvantech(PCL-818,PCL-726)NationalInstruments.......CreatingI/ODriverusingCMEXSfunctionwillbediscussedinotherlectures.xPCTargetApplicationDevelopmentProcessSimulatingtheapplicationCreatingtheTargetApplication(bootandbuild)ControllingtheTargetApplicationSignalmonitoringSignaltracingSignalloggingParametertuning实时控制开发过程DevelopmentProcessofRealTimeControl1.系统建模(状态方程,传递函数)2.控制系统频域设计(系统线性化)3.建立Simulink模型(信号发生器、控制器、被控对象、示波器)4.控制系统时域响应优化(考虑非线性因素)5.连接并设置硬件(I/O卡、外部信号接线)6.分离控制器,加入A/D,D/A模块7.建立实时应用8.实时运行并测试9.在线调整参数、显示与存储数据10.数据处理与分析UserInteractionSimulinkmodelinexternalmodeMatlabcommandusingtargetobjectsTargetcommandlineWebinterface(xpc)xPCremotecontroltoolSimulinkDialsandGuagesToolboxxPCTargetAPItobediscussedinthenextlecturexPCTargetObject返回TargetCommand键盘快捷键c、F#、v、m应用管理命令start、stop、reboot、getpar、setpar、p#、s#示波器命令addsignalscope_index=signal_indexremsignal,addscope,remscope,scopemode,viewmode,ylimit,gridscope_indexon|off命令setvarvariable=p#=1返回目标机界面xPCTargetRemoteControlToolSignalAcquisition信号的采集xPCScope(target/host)MatlabcommandusingtargetobjectsTargetcommandWebinterface(xpc)xPCTargetAPIWebInterface(1)Inthematlabcommandline,typexpcOpenthedoscommandwindow,typec:\MATLAB6p5\toolbox\rtw\targets\xpc\xpc\bin\xpctcp2ser-v-t22222-c1OpentheInternetExplorer,intheaddressbox,enter(2)返回DialsandGaugesToolbox(1)DialsandGaugesToolbox(2)xpc2dng(signalacquisition)dng2xpc(parametertuning)DialsandGaugesToolbox(3)返回UDP/IP与TCP/IPConnectionVersusConnectionlessStreamVersusPacketTCPisareliableprotocol,whileUDPisunreliableUDPandRealtimeCommunicationLightweightnatureDatatobeprocessedinsamplesDatatype(double,single,int32,int16)Packingandunpacking数据的无损传输双缓存技术100Mbps快速以太网TCP/IP协议t(s)t1t2t3t4t6t5数据采集数据发送数据采集数据采集数据发送Scope1触发信号SingleScopet3-t2时间段内的数据丢失数据采集数据发送数据采集数据发送数据采集数据发送t(s)数据采集数据发送Scope1Scope2触发信号DoubleScope无数据丢失Scope1Scope2[Scope1采集结束?][Scope2采集结束?]对试验进行全过程、全状态记录while(1)%loopuntilthescopehasfinishedwhile~strcmp(sc(scNum).Status,'Finished'),enddata(end+1:end+500,:)=sc(scNum).Data;t(end+1:end+500)=sc(scNum).Time;start(sc(scNum));%RestartthescopescNum=3-scNum;%SwitchtothenextscopeendSomeOpenIssuesDistributedRealTimeSimulation(Modelpartitioning,timingandnetworking)Oneconsistentchainoftoolsforthetool-baseddevelopmentIndependentexecutableGUIforxPCReferences参考资料GettingStartedGuide快速入门I/OReferenceGuide硬件支持User’sGuideManual用户手册APIUser’sandReferenceGuide应用编程接口•matlab\help\pdf\xpc\xpc_target_gs.pdf•matlab\help\pdf\xpc\xpc_target_io_ref.pdf•matlab\help\pdf\xpc\xpc_target_ug.pdfWheretofind:OnTimeRTOS-324.0RTTarget-32RTKernel-32RTFiles-32RTPEG-32RTIP-32PPPdriverFTPClient/Server•WebServer•SMTP/POP3Client•TELNETClient/Server•RTUSB-32OnTimeInformatikGmbH返回

1 / 37
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功