system.device.setDeviceEnabled
This function is used in Python Scripting.
Descriptionβ
Enables/disables a device in Ignition.
Client Permission Restrictionsβ
Permission Type: Device Management
Client access to this scripting function is blocked to users that do not meet the role/zone requirements for the above permission type. This function is unaffected when run in the Gateway scope.
Syntaxβ
system.device.setDeviceEnabled(deviceName, enabled)
Parametersβ
| Type | Parameter | Description |
|---|---|---|
| String | deviceName | The name of the device in Ignition. |
| Boolean | enabled | Specifies whether the device connection will be set to enabled or disabled state. |
Returnsβ
Nothing
Scopeβ
Gateway, Vision Client, Perspective Session
Code Examplesβ
Code Snippet
# Example 1: Enable a device
system.device.setDeviceEnabled("CLX", 1)
Code Snippet
# Example 2: Disable a device
system.device.setDeviceEnabled("CLX", 0)