Short Python code for codesys automation