138607-01*3500/22M
BENTLYNEVADA138607-01*3500/22MBENTLYNEVADA138607-01*3500/22MBENTLYNEVADA138607-01*3500/22MPC机的控制程序如下:PrivateSubForm_Load()'窗体加载过程mPort=1'通信控件选用PC机的串口1ttings="9600,o,8,1"'设定串口1的波特率为9600bps,奇校验,8位数据位,1位停止位MSComm1.PortOpen=True'打开串口1terval=1000'定时器1的定时值为1sTimer1.Enabled=True'启动定时器1EndSubFunctioncom(aAsString,bAsInteger)'向PLC读写寄存器内容函数BufferCount=0'清空串口的接收缓冲区MSComm1.Output=a'将要发送的字符串从串口发送出去DoDoEventsLoopUntilBufferCount>=b'等待PLC的响应字符至一定位数com=put'读入串口接收到的字符串EndFunctionPrivateSubTimer1_Timer()'定时读取Y0、Y1的值以判断电机当前状态a="%01#RCP2Y0000Y0001**"+Chr(13)'定义读Y0、Y1值的通信字符串s=com((a),9)'读Y0、Y1的当前值IfMid(s,7,1)="1"Then'返回字符串中第7位为1表示Y0接通,电机正转cmdzz.Enabled=False'电机已正转,禁止操作正转按钮但可操作反转按钮cmdfz.Enabled=Trueption="电机当前状态:正转"ElseIfMid(s,8,1)="1"Then'反转cmdfz.Enabled=False'电机反转,禁止操作反转按钮但可操作正转按钮cmdzz.Enabled=Trueption="电机当前状态:反转"ElseIfMid(s,7,1)="0"AndMid(s,8,1)="0"Then'停机cmdfz.Enabled=True'电机已停止,可操作正转或反转按钮cmdzz.Enabled=Trueption="电机当前状态:停止"EndIfEndSubPrivateSubcmdzz_Click()'正转指令a="%01#WCSR01001**"+Chr(13)'定义将R100置1,启动正转的通信字符串s=com((a),7)EndSubPrivateSubcmdfz_Click()'反转指令a="%01#WCSR01011**"+Chr(13)'定义将R101置1,启动反转的通信字符串s=com((a),7)EndSubPrivateSubcmdtj_Click()'停机指令a="%01#WCSR01021**"+Chr(13)'定义将R102置1使电机停转的通信字符串s=com((a),7)EndSub运行上述程序,既可在PC机上实现对电机正反转以及停止的控制,也可在现地通过SB0、SB1和SB2按钮实现对电机的控制;既可在现地启动或停止电机转动,也可在PC机上实现停机或电机转动控制。由于PC机定时读取PLC内部Y0、Y1的值,所以在现地操作改变电机的工作状态时,在PC机程序中可显示出当前电机的工作状态并禁止相应的操作,真正实现了PC与PLC的联机控制。6.结束语上述设计已在实践中应用。经验证,可在此基础上,增加联机通信故障自动检测报警功能,利用数据读写命令实现联机大批量数据传送,根据现地来的状态信息增加PC机动画演示功能,从而使PC与PLC的联机控制程序更加完善,控制界面更加形象。根据上述原理,结合PC与PLC控制的特点,可在其它控制场合使用上述方法实现双机甚至多机联机控制。J0175BQAutomationEquipManagerDisplaySWPkgJ0175BRAutomationEquipmentManagerDisplaySWLicJ0175DBAutoEquipmentManagerPW-NBJ0175DDAutoEquipmentManagerDisplayPW-NBJ0175DFAutoEquipmentManagerPW-FBJ0175DHAutoEquipmentManagerDisplayPW-FBJ0175DKAutoEquipmentManagerPW-CJ0175DMAutoEquipmentManagerDisplayPW-CJ0175GRAP50OperatingSystemSWLicJ0175GSAP50ApplicationSWLicKitJ0175GTAP50HistorianSWLicKitJ0175GUDiskMirroringSWLicJ0175GWSMDHAP50SWLicJ0175GXSystemMonitor50SWLicJ0175GYIntegControlConfigurator50SWLicJ0175GZHistorian2000SWLicJ0175HAHistorian1500SWLicJ0175HBCompoundSummaryAccess50SWLicJ0175HCOperatorMessageInterface50SWLicJ0175HDPhysicalPropertiesLibrary50SWLicJ0175HEDeviceMonitor50SWLicJ0175HGFORTRANCompilerSWLicJ0175HHINFORMIXOn-LineDevelopmentEnvSWLicJ0175HJSpreadsheet50SWLicJ0175HKCMathLibrary50SWLicJ0175HNDECnetConnectivitySWLicJ0175HRWP50OperatingSystemSWLicJ0175HSSMDHWP50SWLicJ0175HYReportWriter50SWLicJ0175HZAP50GeneralSWLicKitJ0175JB50SeriesOperatingSystem4UserLicJ0175JC50SeriesOperatingSystem20UserLicJ0175JESpreadsheetUserLicJ0177AAAdditionalDM/FoxView(51Series)SWLic(5User)J0177ABAdditionalDM/FoxView(51Series)SWLic(10User)J0177ACAdditionalDM/FoxView(51Series)SWLic(20User)J0177ADAdditionalDM/FoxView(51Series)SWLic(50User)J0177AEAdditionalDM/FoxView(51Series)SWLic(100User)J0177AFGEFanucPLCI/ODriverSWLic-WindowsWSJ0177AG760/762ControllerI/ODriverSWLic-AW70J0177AHAdditionalFoxViewDMForThe70SeriesJ0177AJBCIIMaco4000I/ODriverSWLic-AW70J0177AK760/762ControllerI/ODriverSWLic-AW51J0177ALGEFanucI/ODriverSWLic-AW51J0177ANAP51DStationLic(Nodebus)J0177APAW51DStationLicense(Ethernet)J0177AQAW51DStationLic(Nodebus)J0177ARWP51DStationLicense(Ethernet)J0177ASWP51DStationLic(Nodebus)J0177AUMICROPackControlStationSWPkgJ0177AWINFORMIXForXP/NTSWLicJ0177AXINFORMIXV10forWindowsSWLicenseJ0180SUV4.2FoxDOC,DOSPC,w/Windows3.1OrNTJ0180SVV4.2FoxDOCForSunOS4.1,Solaris2.xJ0180SXV4.1.1FoxDOCForSunOS4.1J0180SYV4.1.1FoxDOCForSunSolaris2.xJ0180SZV4.1.1FoxDOCForDOSPCWithWindows3.1J0200AUPW-NB761SeriesConfiguratorSWPkgJ0200AVPW-NB761SeriesConfiguratorSWLicJ0200AWPW-SSI761SeriesConfiguratorSWPkgJ0200AXPW-SSI761SeriesConfiguratorSWLicJ0200AYAP20761SeriesConfiguratorSWPkgJ0200AZAP20761SeriesConfiguratorSWLicJ0200BARedundantAllen-BradleyGatewaySWPkgJ0200BBRedundantAllen-BradleyGatewaySWLicJ0200CLSunSPARCAISSWLicJ0200CMRemoteAlarmMessageDispatcherPkgJ0200CNRemoteAlarmMessageSerVPkgJ0200CPRemoteAlarmMessageDispatcherLicJ0200CQRemoteAlarmMessageServerLicJ0200CUDisplayUtilitiesSWLicJ0200CVDisplayUtilitiesSWPkgJ0200CXRemoteEquipmentMtgControlLicenseJ0200CYRemoteEquipmentMtgRemoteLicenseJ0200DAPW-NBSIPOPSYSSWLicJ0200DBPW-NBSIPOPSYSSWPkgJ0200DCPW-NBSIPOPSYSSWLic,RedundantSIPJ0200DDPW-NBSIPOPSYSSWPkg,RedundantSIPJ0200DEPW-NBINI15SWLicJ0200DFPW-NBINI15SWPkgJ0200DGPW-NBCP30SWLicJ0200DHPW-NBCP30SWPkgJ0200DKControlProcessorSizingWorksheet(V3.x)J0200DLReportWriter20SWLicJ0200DMReportWriter20SWPkgVersion2.2.1aJ0200DVPWBackupUtilitiesDisketteSWPkgJ0200EEAP20HostingV3.xToV4.xLicJ0200EFAW50HostingV3.xToV4.xLicJ0200EGAW50HostingV3.xToV4.xLicJ0200EHAP51HostingV3.xToV4.xLicJ0200EJAW51HostingV3.xToV4.xLicJ0200EKPWHostingV3.xToV4.xLicJ0200ELAP20HostingV2.xToV4.xLicJ0200EMAP20HostingV3.xToV4.XLic(Adv)J0200ENAP50HostingV3.xToV4.XLic(Adv)J0200EPAW50HostingV3.xToV4.XLic(Adv)J0200EQAP51HostingV3.xToV4.XLic(Adv)J0200ERAW51HostingV3.xToV4.XLic(Adv)J0200ESPWHostingV3.xToV4.XLic(Adv)J0200ETAP20HostingV2.xToV4.XLic(Adv)J0200EUPWHostingV2.xToV4.xLicJ0200EVPWHostingV2.xToV4.XLic(Adv)J0200FAFoxCAE-SingleUserLicJ0200FBDOSI/AConfigurationTool-5-UserLicJ0200FCDOSI/AConfigurationTool-10-UserLicJ0200FDDOSI/AConfigurationTool-40-UserLicJ0200FEA/BConfigurationToolsForPLC-2/xxLicJ0200FFA/BConfigurationToolsForPLC-3/xxLicJ0200FGA/BConfigurationToolsForPLC-5/xxLicJ0200FHA/BManufacturingAutomation10-DeviceSupportJ0200FIA/BManufacturingAutomation20-DeviceSupportJ0200FJA/BManufacturingAutomation35-DeviceSupportJ0200FKA/BManufacturingAutomation50-DeviceSupportJ0200FLA/BManufacturingAutomation100-DeviceSupportJ0200FMA/BManufacturingAutomation150-DeviceSupportJ0200FNA/BManufacturingAutomation200-DeviceSupportJ0200FOA/BManufacturingAutomation250-DeviceSupportJ0200FPA/BManufacturingAutomation350-DeviceSupportJ0200FQA/BManufacturingAutomation500-DeviceSupportJ0200FRA/BManufacturingAutomation750-DeviceSupportJ0200FSA/BManufacturingAutomation1000-DeviceSupportJ0200FTA/BManufacturingAutomation1500-DeviceSupportJ0200FUA/BManufacturingAutomation2000-DeviceSupportJ0200FVA/BManufacturingAutomation2500-DeviceSupportJ0200FWA/BManufacturingAutomation3000-DeviceSupportJ0200FXA/BManufacturingAutomation+3000-DeviceSupportJ0200GAFoxBatchOperatorClientSWLic(PerDisplayMgr)J0200GBFoxBatchConfigurationClientSWLicJ0200GCFoxBatchDevelopersToolKitSWLicJ0200GDFoxBatchServer(Large)SWLic(V4.2orV5.0min)J0200GEFoxBatchServer(Med)SWLic(V4.2orV5.0min)J0200GFFoxBatchServer(Small)SWLic(V4.2orV5.0min)J0200GJFoxBatchClientSecuritySWLic(PerDisplMgr)J0200GKFoxBatchServerSecuritySWLicJ0200HYModbus+Integrator(Redundant)SWLicJ0200JAI/ABatchOperatorClientLicV5.3(50Series)J0200JBI/ABatchServerLargeSWLicV5.3(50Series)J0200JCI/ABatchServerMediumSWLicV5.3(50Series)J0200JDI/ABatchServerSmallSWLicV5.3(50Series)J0200JEI/ABatchConfigClientSWLicV5.3(50Series)J0200JFI/ABatchDeveloper'sToolkitLicV5.3(50Series)J0200JGI/ABatchOperatorClientLicV7.1.1(70Series)J0200JHI/ABatchServerLargeSWLicV7.1.1(70Series)J0200JJI/ABatchServerMediumSWLicV7.1.1(70Series)J0200JKI/ABatchServerSmallSWLicV7.1.1(70Series)J0200JLI/ABatchConfigClientSWLicV7.1.1(70Series)J0200JMFoxBatch2DevKitLic(70Series)J0200JNFoxDrawStandaloneLicJ0200JPAW70SWLic(Ethernet)J0200JQAW70ConnectivityLic-5StationsJ0200JRAW70ConnectivityLic-10StationsJ0200JSAW70ConnectivityLic-15StationsJ0200JTAW70ConnectivityLic-20StationsJ0200JUAW70ConnectivityLic-25StationsJ0200JVWP70SWLic(Ethernet)J0200JWWP70ConnectivityLic-5StationsJ0200JXWP70ConnectivityLic-10StationsJ0200JYWP70ConnectivityLic-15StationsJ0200JZWP70ConnectivityLic-20StationsJ0200KAWP70ConnectivityLic-25StationsJ0200KBAW51DSWLic(Ethernet)J0200KCAW51ConnectivityLic-5StationsJ0200KDAW51ConnectivityLic-10StationsJ0200KEAW51ConnectivityLic-15StationsJ0200KFAW51ConnectivityLic-20StationsJ0200KGAW51ConnectivityLic-25StationsJ0200KHWP51DSWLic(Ethernet)J0200KJWP51ConnectivityLic-5StationsJ0200KKWP51ConnectivityLic-10StationsJ0200KLWP51ConnectivityLic-15StationsJ0200KMWP51ConnectivityLic-20StationsJ0200KNWP51ConnectivityLic-25StationsJ0200KPAW70100ValuePointNonFTSWLicJ0200KQAW70500ValuePointNonFTSWLicJ0200KRAW70SWLic-UnrestrictedFoxBlockEquivalentJ0200KSAW51100ValuePointNonFTSWLicJ0200KTAW51500ValuePointNonFTSWLicJ0200KUAW51SWLic-UnrestrictedFoxBlockEquivalentJ0200KVAW70SWLic(Nodebus)J0200KWWP70SWLic(Nodebus)J0200KXAW513000ValuePointNonFTSWLicJ0200KYAW519000ValuePointNonFTSWLicJ0200KZAW51StyleCSWLic-UnrestrictedFoxBlockEquivalentJ0200LAI/ASeriesSFCSWLic(70Series)J0200LBI/ASeriesSFCSWLic(50Series)J0200LCAW70ConnectivityLic-30StationsJ0200LDAW70ConnectivityLic-35StationsJ0200LEAW70ConnectivityLic-40StationsJ0200LFAW70ConnectivityLic-45StationsJ0200LGAW70ConnectivityLic-50StationsJ0200LHAW70ConnectivityLic-55StationsJ0200LJAW70ConnectivityLic-60StationsJ0200LKAW70ConnectivityLic-64StationsJ0200LLWP70ConnectivityLic-30StationsJ0200LMWP70ConnectivityLic-35StationsJ0200LNWP70ConnectivityLic-40StationsJ0200LPWP70ConnectivityLic-45StationsJ0200LQWP70ConnectivityLic-50StationsJ0200LRWP70ConnectivityLic-55StationsJ0200LSWP70ConnectivityLic-60StationsJ0200LTWP70ConnectivityLic-64StationsJ0200LUAW51ConnectivityLic-30StationsJ0200LVAW51ConnectivityLic-35StationsJ0200LWAW51ConnectivityLic-40StationsJ0200LXAW51ConnectivityLic-45StationsJ0200LYAW51ConnectivityLic-50StationsJ0200LZAW51ConnectivityLic-55StationsJ0200MAAW51ConnectivityLic-60StationsJ0200MBAW51ConnectivityLic-64StationsJ0200MCWP51ConnectivityLic-30StationsJ0200MDWP51ConnectivityLic-35StationsJ0200MEWP51ConnectivityLic-40StationsJ0200MFWP51ConnectivityLic-45StationsJ0200MGWP51ConnectivityLic-50StationsJ0200MHWP51ConnectivityLic-55StationsJ0200MJWP51ConnectivityLic-60StationsJ0200MKWP51ConnectivityLic-64StationsJ0200MMAP51EStationLic(Nodebus)J0200MNAW51EStationLicense(Ethernet)J0200MPAW51EStationLic(Nodebus)J0200MQWP51EStationLicense(Ethernet)J0200MRWP51EStationLic(Nodebus)J0200MSSoftPackI/ASeriesDevelopmentSystemJ0200MTSoftPackI/ASeriesRuntimeSystemJ0200MUSoftPackI/ASeriesRemoteMMISystemJ0200MYI/ASeriesFoxSCADA(Non-Redundant)SWLicJ0200MZI/ASeriesFoxSCADA(Redundant)SWLicJ0200NAAllen-BradleyDH+PLCSWDriverJ0200NBAllen-BradleyEthernetPLCSWDriverJ0200NCGEFanucSRTPEthernetPLCSWDriverJ0200NDModiconModbus(MB)PLCSWDriverJ0200NEI/ASeriesFieldbusI/OSWDriverJ0200NFBristolBabcockSCADASWDriverJ0200NGFoxPanelsSWLicForWindowsJ0200NJControlProcessor50(CP50)SWLicJ0200NKControlProcessor40StyleBSWLicJ0200NLControlProcessor30StyleBSWLicJ0200NMIntegrator30BForAllen-BradleySWLicJ0200NNIntegrator30BForModbusSWLicJ0200NPINTERSPECIntegrator30BSWLicJ0200NQI/ASeriesFoxSCADA(NonRed)Lic4000PointsJ0200NRI/ASeriesFoxSCADA(NonRed)Lic8000PointsJ0200NTCP601000ValuePointFTSWLicJ0200NUCP602500ValuePointFTSWLicJ0200NVCP605000ValuePointFTSWLicJ0200NWCP601000ValuePointNonFTSWLicJ0200NXCP602500ValuePointNonFTSWLicJ0200NYCP605000ValuePointNonFTSWLicJ0200NZMICRO-I/AProfiBUSDPSWLicJ0200PAMICRO-I/AModbusSWLicJ0200PBMICRO-I/AABPLCEthernetSWLicJ0200PCMICROPack100ValuePointNonFTSWLicJ0200PDMICROPack500ValuePointNonFTSWLicJ0200PEMICROPack1000ValuePointNonFTSWLicJ0200PFMICRO-I/A2000ValuePointNonFTSWLicJ0200PGMICROPack100ValuePointFTSWLicJ0200PHMICROPack500ValuePointFTSWLicJ0200PJMICROPack1000ValuePointFTSWLicJ0200PKAW701000ValuePointNonFTSWLicJ0200PLAW703000ValuePointNonFTSWLicJ0200PMAW511000ValuePointNonFTSWLicJ0200PNAW5115000ValuePointNonFTSWLicJ0200PQCP60LicUpgrade1000To2500FTJ0200PRCP60LicUpgrade1000To5000FTJ0200PSCP60LicUpgrade2500To5000FTJ0200PTCP60LicUpgrade1000To2500NonFTJ0200PUCP60LicUpgrade1000To5000NonFTJ0200PVCP60LicUpgrade2500To5000NonFTJ0200QAMicro-I/A5000ValuePointNonFTSWLicJ0200QBAW7015000ValuePointNonFTSWLicJ0200QCSoftPackDevLicUpgradeToAW70NodebusJ0200QDSoftPackRuntimeLicUpgradeToAW70NodebusJ0200QESoftPackDevLicUpgradeToWP70NodebusJ0200QFSoftPackRuntimeLicUpgradeToWP70NodebusJ0200QGSoftPackRMMILicUpgradeToWP70NodebusJ0200QHI/ABatchBackupServerLargeLicV5.3(50Ser)J0200QJI/ABatchBackupServerMediumLicV5.3(50Ser)J0200QKI/ABatchBackupServerSmallLicV5.3(50Ser)J0200QLI/ABatchBackupServerLargeLicV7.1.1(70Ser)J0200QMI/ABatchBackupServerMediumLicV7.1.1(70Ser)J0200QNI/ABatchBackupServerSmallLicV7.1.1(70Ser)J0200QPSoftPackDevLicUpgradeToAW70(Ethernet)J0200QQSoftPackDevLicUpgradeToAW70(Nodebus)J0200QRSoftPackRuntimeLicUpgradeToAW70(Ethernet)J0200QSSoftPackRuntimeLicUpgradeToAW70(Nodebus)J0200QTSoftPackRemoteMMIUpgradeToWP70(Ethernet)J0200QUSoftPackRemoteMMIUpgradeToWP70(Nodebus)J0200QVMicroPackToCP30BUpgradeLicenseJ0200QWMicro-I/ALicUpgrade100To500NonFTJ0200QXMicro-I/ALicUpgrade100To1000NonFTJ0200QYMicro-I/ALicUpgrade100To2000NonFTJ0200QZMicro-I/ALicUpgrade100To5000NonFTJ0200RAMicro-I/ALicUpgrade500To1000NonFTJ0200RBMicro-I/ALicUpgrade500To2000NonFTJ0200RCMicro-I/ALicUpgrade500To5000NonFTJ0200RDMicro-I/ALicUpgrade1000To2000NonFTJ0200REMicro-I/ALicUpgrade1000To5000NonFTJ0200RFMicro-I/ALicUpgrade2000To5000NonFTJ0200RGServer70AWSWLicOption(Ethernet)J0200RHServer70AWSWLicOption(Nodebus)J0200RJServer70WPSWLicOption(Ethernet)J0200RKServer70WPSWLicOption(Nodebus)J0200RLAddlFoxViewClient(70Series)SWLic(5User)J0200RMAddlFoxViewClient(70Series)SWLic(10User)J0200RNAddlFoxViewClient(70Series)SWLic(20User)J0200RPAddlFoxViewClient(70Series)SWLic(50User)J0200RQAddlFoxViewClient(70Series)SWLic(100User)J0200RSHostStationV6*SWForWindowsNodebusLicenseJ0200RTHostStationV6*SWForWindowsEthernetLicenseJ0200RUAppStationV6*SWForWindowsNodebusLicenseJ0200RVAppStationV6*SWForWindowsEthernetLicenseJ0200SWI/ABatchOperatorClientLicV8.0(50Series)J0200SXI/ABatchServerLargeLicV8.0(50Series)J0200TAI/ABatchConfigClientLicV8.0(50Series)J0200TBI/ABatchDeveloper'sToolkitLicV8.0(50Series)J0200TCI/ABatchOperatorClientLicV8.0(70Series)J0200TDI/ABatchServerLargeLicV8.0(70Series)J0200TEI/ABatchServerMedLicV8.0(70Series)J0200TFI/ABatchServerSmallLicV8.0(70Series)J0200TGI/ABatchConfigClientLicV8.0(70Series)J0200THI/ABatchBackupServerLargeLicV8.0(50Series)J0200TLI/ABatchBackupServerLargeLicV8.0(70Series)J0200TMI/ABatchBackupServerMedLicV8.0(70Series)J0200TNI/ABatchBackupServerSmallLicV8.0(70Series)J0200TQI/ABatchReportingClientLicV8.0(50&70Series)J0200TVI/ABatchServerUpgradeSmallToMed(70Series)J0200TWI/ABatchServerUpgradeMedToLarge(70Series)J0200TXI/ABatchBackupServerUpgradeSmallToMed(70)J0200TYI/ABatchBackupServerUpgradeMedToLarge(70)J0200UAUpgradeSWLicToFoxView/FoxDrawV8.x)