That's the right place and 'cid' is the right property. 'sel.attribs' is a dictionary with the attributes of the class, so if you need to change the CID then you can use my_class.attribs['cid']='/x01/x02/x03/x04/' (with my_class being an instance of pycomm)I looked back to find what we changed to make multiple copies of PyComm work with the same PLC and it was in this region of code:
Code:self.attribs = {'context': '_pycomm_', 'protocol version': 1, 'rpi': 5000, 'port': 0xAF12, 'timeout': 10, 'backplane': 1, 'cpu slot': 0, 'option': 0, 'cid': '\x27\x04\x19\x71', 'csn': '\x27\x04', 'vid': '\x09\x10', 'vsn': '\x09\x10\x19\x71', 'name': 'Base', 'ip address': None}
I do not remember exactly, but we changed the value for either cid or csn. As I mentioned, I'm not a Python programmer, so I wasn't sure the best thing to do, so we just changed the value. Just a recommendation, but making it a random generated number would avoid the problem of 2 devices trying to connect to the same PLC.
In this way you can easily map an external configuration file to the dictionary, and that's why I didn't make a random number. Anyway these feedback is very helpful, so I will make a change sooner.
thanks
Ago