# system.iec61850.getControlParams doesn't work

**URL:** <https://forum.inductiveautomation.com/t/system-iec61850-getcontrolparams-doesnt-work/101653>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [January 30, 2025, 10:54pm UTC](https://forum.inductiveautomation.com/t/system-iec61850-getcontrolparams-doesnt-work/101653 "2025-01-30T22:54:38Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Diego\_Mejia](https://avatars.discourse-cdn.com/v4/letter/d/e56c9b/32.png) [@Diego\_Mejia](https://forum.inductiveautomation.com/u/Diego_Mejia)\
**Post date:** [January 30, 2025, 10:54pm UTC](https://forum.inductiveautomation.com/t/system-iec61850-getcontrolparams-doesnt-work/101653/1 "2025-01-30T22:54:38Z")

</div>

Hello, I have a IEC61850 device and i try to operate comands.  
First i did a try in script console the fuction `system.iec61850.getControlParams("rele")` and i have this error  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/9/e93ca7433b9517bae092df02fa172fd94d97d1e2.png)  
then i do another try with `system.opc.browse(opcServer=server, device="PPC")` nad have the same problem.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [January 30, 2025, 11:33pm UTC](https://forum.inductiveautomation.com/t/system-iec61850-getcontrolparams-doesnt-work/101653/2 "2025-01-30T23:33:13Z")

</div>

> [@Diego\_Mejia](#):
>
> system.iec61850.getControlParams

Is only available in gateway sessions according to the manual: [system.iec61850.getControlParams | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-iec61850/system-iec61850-getControlParams)

So you will have to do a gateway message to the gateway and execute your code there.

For system.opc.browse, you will need to post all your code and then the error message it generates.

> [@Diego\_Mejia](#):
>
> `system.opc.browse(opcServer=server, device="PPC")`

Doesn't have the server variable defined.

---

<div class="post-metadata">

**Author:** ![Diego\_Mejia](https://avatars.discourse-cdn.com/v4/letter/d/e56c9b/32.png) [@Diego\_Mejia](https://forum.inductiveautomation.com/u/Diego_Mejia)\
**Post date:** [January 31, 2025, 3:05pm UTC](https://forum.inductiveautomation.com/t/system-iec61850-getcontrolparams-doesnt-work/101653/3 "2025-01-31T15:05:41Z")

</div>

i copy the example of documentation

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/1/f197d30ba15fc5c003029d39f7d9069dcc4ec7fb.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 31, 2025, 3:09pm UTC](https://forum.inductiveautomation.com/t/system-iec61850-getcontrolparams-doesnt-work/101653/4 "2025-01-31T15:09:13Z")

</div>

The documentation doesn't show the example running in the designer script console. It is a gateway-scoped function. Run it from gateway scope. (Gateway message handler is an option, or a project library function called from a message handler.)

If you have my Integration Toolkit, you can also annotate a project library function with my `@system.util.runInGateway` decorator, after which you **can** call that from the designer.

---

<div class="post-metadata">

**Author:** ![Diego\_Mejia](https://avatars.discourse-cdn.com/v4/letter/d/e56c9b/32.png) [@Diego\_Mejia](https://forum.inductiveautomation.com/u/Diego_Mejia)\
**Post date:** [February 3, 2025, 9:58pm UTC](https://forum.inductiveautomation.com/t/system-iec61850-getcontrolparams-doesnt-work/101653/5 "2025-02-03T21:58:24Z")

</div>

oh ok, I thought all the scrips ran in gateway, and yes, you are right, thank you very much

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 3, 2025, 10:20pm UTC](https://forum.inductiveautomation.com/t/system-iec61850-getcontrolparams-doesnt-work/101653/6 "2025-02-03T22:20:02Z")

</div>

You might have been mislead by a post somewhere talking about all **Perspective** scripts running on the gateway. Which is still true - if you create a button in a Perspective view and click that button (even in the designer), the actual execution will happen on the gateway.

But the script console is, as Phil mentioned, running entirely locally.

---

<div class="post-metadata">

**Author:** ![dom.dynamic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dom.dynamic/32/78825_2.png) [@dom.dynamic](https://forum.inductiveautomation.com/u/dom.dynamic)\
**Post date:** [August 17, 2025, 9:31pm UTC](https://forum.inductiveautomation.com/t/system-iec61850-getcontrolparams-doesnt-work/101653/7 "2025-08-17T21:31:23Z")

</div>

I’m also still having the same error “..object has no attribute ‘iec61850” even though I added the script in Project Library under gateway scope. I added a button in Vision\>Main Windows to trigger the script, but I get the error as stated in the prompt window and Output Console log. Am I missing something?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 17, 2025, 10:41pm UTC](https://forum.inductiveautomation.com/t/system-iec61850-getcontrolparams-doesnt-work/101653/8 "2025-08-17T22:41:03Z")

</div>

> [@dom.dynamic](#):
>
> added the script in Project Library under gateway scope

This is wrong. The project library has no scope of its own. It operates in the scope of the caller.

To use gateway scope functions from Vision (or the designer script console, which is Vision scope), you must use a gateway message handler and `system.util.sendRequest()`.

(If you install my Integration Toolkit, you may find my [@system.util.runInGateway](https://www.automation-pros.com/toolkit/doc/utility.html#runingateway) decorator more convenient than messaging.)

---

<div class="post-metadata">

**Author:** ![dom.dynamic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dom.dynamic/32/78825_2.png) [@dom.dynamic](https://forum.inductiveautomation.com/u/dom.dynamic)\
**Post date:** [August 18, 2025, 9:28pm UTC](https://forum.inductiveautomation.com/t/system-iec61850-getcontrolparams-doesnt-work/101653/9 "2025-08-18T21:28:17Z")

</div>

Thanks for replying. So I created the script in the gateway message handler and used `system.util.sendRequest()` in the Vision \> Windows \> Main Windows to create a button to call the gateway message handler. See below for my setup.

**Button (Vision \> Windows \> Main Windows):**

_returnValue = system.util.sendRequest(project='IEC61850', messageHandler='IEC', payload={'hoursOn':15})  
print returnValue_

**messageHandler ‘IEC’ (Scripting \> Gateway Events)**

_def handleMessage(payload):  
results = system.iec61850.getControlParams("Controller")  
print(results)_

So, the system function worked since there is no error. It generated a .json with file name starting with “NonResponsiveEdt…”. However, when I open that .json file, i don’t think it is actually showing a list of report control names and their attributes contained in the configured IEC 61850 device. The .json is just showing lots of stacktrace with unknown source….

Anyway, I came across another issue with the select & operate function. When I put the script below in the gateway message handler,

_def handleMessage(payload):_

_mapParams = {'name': u'ControllerLD1/SCGGIO1/SetCB1.Oper.CtlVal', 'T':1, 'orCat': 0, 'orIdent': u'not-supported', 'Check': 0, 'Test': False}  
system.iec61850.select("Controller", mapParams, 1)_

I get this error:

_caused by org.python.core.PyException  
Traceback (most recent call last):  
File "\<MessageHandlerScript:IEC61850/IEC \>", line 3, in handleMessage  
java.lang.Exception: java.lang.Exception: control not found: ControllerLD1/SCGGIO1/SetCB1.Oper.CtlVal  
caused by Exception: control not found: ControllerLD1/SCGGIO1/SetCB1.Oper.CtlVal_

I tried adjusting the data attribute portion but I still get error in which the script is not finding the logical device. Could you point to what I’m doing wrong?

---

<div class="post-metadata">

**Author:** ![dom.dynamic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dom.dynamic/32/78825_2.png) [@dom.dynamic](https://forum.inductiveautomation.com/u/dom.dynamic)\
**Post date:** [August 18, 2025, 9:59pm UTC](https://forum.inductiveautomation.com/t/system-iec61850-getcontrolparams-doesnt-work/101653/10 "2025-08-18T21:59:38Z")

</div>

Please ignore the issue with select/operate. I found out ‘_ControllerLD1/SCGGIO1/SetCB1.Oper.CtlVal' should just be ‘ControllerLD1/SCGGIO1.SetCB1’. The command will know which data attribute to trigger in the IED device without having to specify ‘Oper’ and ‘CtlVal’._

However, I still need help why _getControlParams is not properly generating a list of report in the .json file._

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 18, 2025, 10:05pm UTC](https://forum.inductiveautomation.com/t/system-iec61850-getcontrolparams-doesnt-work/101653/11 "2025-08-18T22:05:23Z")

</div>

> [@dom.dynamic](#):
>
> def handleMessage(payload):  
> results = system.iec61850.getControlParams("Controller")  
> print(results)

You're not **returning** anything. You're just printing the output.

You need to `return results` if you want `system.util.sendRequest` to do anything.

---

<div class="post-metadata">

**Author:** ![dom.dynamic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dom.dynamic/32/78825_2.png) [@dom.dynamic](https://forum.inductiveautomation.com/u/dom.dynamic)\
**Post date:** [August 19, 2025, 3:55am UTC](https://forum.inductiveautomation.com/t/system-iec61850-getcontrolparams-doesnt-work/101653/12 "2025-08-19T03:55:13Z")

</div>

Thank you very much! You and @pturmel have been very helpful and provided very speedy responses to my questions.
