i have a device object in my python script which has user-defined parameters which are shown in the codesys gui in the "general" tab of said device. how can i access and modify these in my python script? i already found the ```
myDevice.device_parameters
list, but
len(myDevice.device_parameters)
``` equals zero.
what is the right name for the list of user-defined parameters?
Greetings
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
and id can be found with the printtree function (i guess, or it was another tree func, it's been a while. anyway, it's helpful):
defprinttree_rec(treeobj, depth=0):
  name=treeobj.get_name(False) Â
  iftreeobj.is_device:
    deviceid=treeobj.get_device_identification()
    print("{0} - {1} {2}".format("--"*depth, name, deviceid))
  forchildintreeobj.get_children(False):
    printtree_rec(child, depth+1)defprintTree(proj):
  forobjinproj.get_children():
    printtree_rec(obj)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello there,
i have a device object in my python script which has user-defined parameters which are shown in the codesys gui in the "general" tab of said device. how can i access and modify these in my python script? i already found the ```
myDevice.device_parameters
list, but
len(myDevice.device_parameters)
``` equals zero.
what is the right name for the list of user-defined parameters?
Greetings
Hi AndreasDeDeDe.
There are device parameters and there are host parameters. Maybe your device has no device parameters.
previous post.
BR
Martin
I found the correct parameters:
device.connectors[0].host_parameters
and the concrete parameters are accessible over
masterParams = master.connectors[0].host_parameters
masterParams.by_id(id)
and id can be found with the printtree function (i guess, or it was another tree func, it's been a while. anyway, it's helpful):