--- title: "system.vision.getConnectionMode" description: "Retrieves this Client session's current connection mode." --- # system.vision.getConnectionMode > Retrieves this Client session's current connection mode. :::info Backwards Compatibility This function replaces [system.util.getConnectionMode](versioned_docs/version-8.1/appendix/scripting-functions/system-util/system-util-getConnectionMode.md). Any scripts containing Vision Client scoped functions that were replaced with system.vision syntax will still work to maintain backwards compatibility. ::: This function is used in **Python Scripting**. ## Description Retrieves this Client session's current connection mode. Possible connection modes are: * 3: Read/Write * 2: Read-only, * 1: Disconnected ## Client Permission Restrictions This scripting function has no [Client Permission](../../../ignition-modules/vision/vision-project-properties/vision-project-properties.md#vision-permissions-properties) restrictions. ## Syntax `system.vision.getConnectionMode()` ### Parameters Nothing ### Returns **Integer** - The current connection mode for the Client. ### Scope Vision Client ## Code Examples ```python title="Example #1" # This code will set a Client to read-only after a timeout of 30 seconds. # Add this code to a Client timer script mode = system.vision.getConnectionMode() if mode == 3 and system.vision.getInactivitySeconds() > 30: system.vision.setConnectionMode(2) ```