I did this on a test server and i only really have one opcServer connected. (the standaard “Ignition OPC UA Server”) It dissabled the connection like expected but then an error pops up that it didnt find it. Entho it clearly worked, im guessing there is a bug somewhere. So if i’d have more connections the script wouldnt completly run(i guess)
version 8.1.3 (b2021030309)
opcs = system.opc.getServers(True)
for row in range(len(opcs)):
name = opcs[row]
system.opc.setServerEnabled(name, False)
at com.inductiveautomation.ignition.gateway.opc.OpcConnectionManagerImpl.setServerEnabled(OpcConnectionManagerImpl.java:485) at com.inductiveautomation.ignition.gateway.script.GatewayOpcUtilities.setServerEnabledImpl(GatewayOpcUtilities.java:107) at com.inductiveautomation.ignition.common.script.builtin.AbstractOPCUtilities.setServerEnabled(AbstractOPCUtilities.java:135) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) java.lang.Exception: java.lang.Exception: unknown server: Ignition OPC UA Server