0
0
Fork 0

fix(device_parameters): walk connector host_parameters so host-side params are reachable

list_device_parameters and set_device_parameter only iterated
device.device_parameters and connector.parameters. Host-side parameter
sets -- e.g. the WAGO 750-series 'K-BUS Parameters' grid (program start
interlock, k-bus cycle time, TCM control) -- are exposed exclusively via
ScriptConnector.host_parameters (SP21 stub ScriptDeviceParameters.pyi;
helpme-codesys ScriptEngine, ScriptConnector.host_parameters), so both
tools reported zero parameters on the Kbus master node.

Verified on the Sea Leopard PFC200 project: id 150 'program start
interlock' now lists and sets offline.
This commit is contained in:
Karstein Phobic Nyvold Kvistad 2026-07-24 08:07:47 +02:00
parent 33363fbfd0
commit 3612a54543
2 changed files with 15 additions and 0 deletions

View file

@ -45,6 +45,14 @@ try:
count += 1
except Exception as e:
print("DEBUG: parameter walk failed for %s: %s" % (scope, e))
# ScriptConnector exposes the host-side parameter set (e.g. the WAGO
# "K-BUS Parameters" grid) only via host_parameters, not parameters.
try:
for param in (getattr(conn, 'host_parameters', None) or []):
print(_param_row(scope + ':host', param))
count += 1
except Exception as e:
print("DEBUG: host_parameter walk failed for %s: %s" % (scope, e))
print("### PARAMS_END ###")
print("Device: %s" % dev_name)

View file

@ -40,6 +40,13 @@ def _iter_params(device):
yield scope, param
except Exception as e:
print("DEBUG: parameter walk failed for %s: %s" % (scope, e))
# ScriptConnector exposes the host-side parameter set (e.g. the WAGO
# "K-BUS Parameters" grid) only via host_parameters, not parameters.
try:
for param in (getattr(conn, 'host_parameters', None) or []):
yield scope + ':host', param
except Exception as e:
print("DEBUG: host_parameter walk failed for %s: %s" % (scope, e))
try:
print("DEBUG: set_device_parameter script: Device='%s', Name='%s', Id='%s', GetOnly=%s, Project='%s'" % (