Model Limitation on OT Protocols

The limitations apply to all the protocols unless specified otherwise.

 

Protocol Support in PT

Support for an OT protocol is divided into two sections: programming using script module and internal PT engine.

The programming provides behavior of a device. This can only be done using JavaScript not Python. Follows the steps listed to create a custom OT device.

  1. Create a device that supports Programming. However, only PC and Thing-based device types can utilize OT protocol due to lack of engine support in other device types.

  2. Delete existing default Blink project and create a new project based on “Empty - JavaScript” template.

  3. Initialize the protocol. Protocols follow the client/server architecture. This means a device has one instance of a server that can handle requests from multiple clients.

    How to initialize a device as a MMS Server:
    MMSServer.setup();

    How to initialize a device as a Profinet Server on GigabitEthernet0 port:
    Profinet.setup("GigabitEthernet0", false);

    How to create a device acting as a MMS client:
    var client = new MMSClient();

    See the JavaScript API documentation in the help for how to initialize the protocol.

  4. Define the behavior of the device. This requires some basic understanding of the protocol and the API supported.

    How to create a CIP temperature sensor:

    1. Create a CIP server
      CIP.setup();

    2. Defines the identity of the device
      var identity='{"vendor":939,"type":1,"code":9046,"revision":"1.1","status":"","serial":12346,"name":"pt cip2"}';
      CIP.setIdentity(identity);


    3. Make this device a temperature sensor and assigns the temperature value to class ID 3000 and instance ID 1.
      var temp = {};
      temp.data = Environment.get("Ambient Temperature");
      CIP.addObject(3000,1,JSON.stringify(temp));


    4. Retrieves the temperature data from the server. The class and instance IDs must match with the server’s.
      var client = new CIPClient();
      client.connect("10.0.0.2");
      client.getAttributeSingle(3000,1,1);