Model Limitation on OT Protocols
Model Limitation on OT Protocols
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.
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.
How to create a CIP temperature sensor:
- Create a CIP server
CIP.setup();
- 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);
- 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));
- 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);