zoukankan      html  css  js  c++  java
  • VB6 读写西门子PLC

    1. 先在本地模拟一个PLC

    2. 打开PLC工具,操作值

    vb代码去读取数值,用的是S7协议

    翻一下之前的代码, 还有一个用Siemens OPC DAAutomation来读写的.

     'AddServer
        Set MyOPCServer = New OPCServer           ' Create OPCServer Object
        Call MyOPCServer.Connect("S7200.OPCServer")  ' Disconnect from OPC Server
    
        'AddGroup
        Set MyGroups = MyOPCServer.OPCGroups        ' Get OPCGroups Collection Object from MyOPCServer
        
        MyGroups.DefaultGroupIsActive = 500   ' Set Default Group Update Rate to 500 ms
        MyGroups.DefaultGroupIsActive = False ' Set Default Group Active State to Inactive
        Set MyGroup = MyGroups.add("Group1")   ' Add a new Group to the Group Collection
        ' Set Group Properties
        MyGroup.IsSubscribed = True  
    

      查了一下OPC的资料,原来是一个通用的PLC的驱动, 类似数据库的ODBC,

    从这个意义上来讲,做MIS时,下面的PLC 种类众多时,用OPC是好的选择, 但只有一两个PLC就没必要了.

  • 相关阅读:
    16-1-6 kafka的操作
    16-1-5:MapReduce
    MapReduce概述
    MapReduce的代码实现过程分析
    MapReduce
    HDFS2—SequenceFile(小文件的解决方案)
    HDFS2—federation
    hdfs
    缓解爬虫ip被封的概率
    zookeeper集群搭建
  • 原文地址:https://www.cnblogs.com/zitjubiz/p/12696548.html
Copyright © 2011-2022 走看看