I have a script that opens a project, gets the project's top level device and tries to set its gateway and the soft-PLC's IP address.
To get the gateway and set the address I tried both of the following code snippets:
Both ways produce the expected behavior and allow me to connect to the PLC.
However when I execute the same scripts from CODESYS' CLI with no UI I get:
1. "Index out of range error" for the first snippet because "online.gateways" is empty
2. "ValueError: Gateway f8f15fb8-30c5-4671-9931-5a37ded55386 not found" for the second snippet
Why is that gateway only available when executing the script from the CODESYS UI?
Last edit: jm322 2022-04-07
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a script that opens a project, gets the project's top level device and tries to set its gateway and the soft-PLC's IP address.
To get the gateway and set the address I tried both of the following code snippets:
Both ways produce the expected behavior and allow me to connect to the PLC.
However when I execute the same scripts from CODESYS' CLI with no UI I get:
1. "Index out of range error" for the first snippet because "online.gateways" is empty
2. "ValueError: Gateway f8f15fb8-30c5-4671-9931-5a37ded55386 not found" for the second snippet
Why is that gateway only available when executing the script from the CODESYS UI?
Last edit: jm322 2022-04-07