Update to the void: I still don't think this is possible, after looking closer at the CODESYS documentation, it says: property host_parameters Get the host parameter set of this connector. The returned list is read-only which means you can’t add, insert or remove parameters or clear it. The list of available parameters is defined in the device description. which implies to me that channels cannot be added here and must be done in the UI. I'm still confused that you can modify values (as in the IP...
Update to the void: I still don't think this is possible, after looking closer at the CODESYS documentation, it says: property host_parameters Get the host parameter set of this connector. The returned list is read-only which means you can’t add, insert or remove parameters or clear it. The list of available parameters is defined in the device description. which implies to me that channels cannot be added here and must be done in the UI. I'm still confused that you can modify values (as in the IP...
Here's the script I'm using for reference: from scriptengine import * def main(): proj = projects.primary deviceName = "SLAVE_TO_ADD" masterdevice = proj.find('Modbus_TCP_Master', recursive = True)[0] try: #add the slave device if it doesn't already exist slaveDevice = masterdevice.add(name=deviceName, type=89, id='0000 0005' , version='3.5.16.0') slaveDevice = proj.find(deviceName, recursive = True)[0] except: #it already exists; we'll just configure it instead slaveDevice = proj.find(deviceName,...
Here's the script I'm using for reference: code from scriptengine import * def main(): proj = projects.primary deviceName = "SLAVE_TO_ADD" masterdevice = proj.find('Modbus_TCP_Master', recursive = True)[0] try: #add the slave device if it doesn't already exist slaveDevice = masterdevice.add(name=deviceName, type=89, id='0000 0005' , version='3.5.16.0') slaveDevice = proj.find(deviceName, recursive = True)[0] except: #it already exists; we'll just configure it instead slaveDevice = proj.find(deviceName,...
Hello, I'm trying to add and configure a modbus TCP slave device using a python script, but have not been able to figure out how to add the slave channels. I've gotten to the point where I can add a new device and change the existing parameters (IP address and port, for example), but I am not seeing a way to add a channel. Can someone point me in the right direction on how to do this through a python script? Thanks