I wonder if it is possible now to set up the gateway and device by IP address and device address?
I have looked up on the forum and in the ScriptEngine.chm. The only way I found was to use the device name, shown below.
chenhe hat geschrieben:
I wonder if it is possible now to set up the gateway and device by IP address and device address?
I have looked up on the forum and in the ScriptEngine.chm. The only way I found was to use the device name, shown below.
With CODESYS V3.5 SP9 or newer you can use the method to specify the IP address for the device.
You can find your gateway object by its name with the following code:
gw=online.gateways['Gateway-1']
If you don't have a gateway you can create one with . You need to create a dictionary with the parameters required by the gateway driver. Each parameter must be converted to match the required type in the driver. I can provide an example if you need one.
BR
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'd like to have the example for creating new gateway. Thanks again.
M.Keller hat geschrieben:
If you don't have a gateway you can create one with . You need to create a dictionary with the parameters required by the gateway driver. Each parameter must be converted to match the required type in the driver. I can provide an example if you need one.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi there,
I wonder if it is possible now to set up the gateway and device by IP address and device address?
I have looked up on the forum and in the ScriptEngine.chm. The only way I found was to use the device name, shown below.
Thank you in advance
Hi chenhe.
With CODESYS V3.5 SP9 or newer you can use the method to specify the IP address for the device.
You can find your gateway object by its name with the following code:
If you don't have a gateway you can create one with . You need to create a dictionary with the parameters required by the gateway driver. Each parameter must be converted to match the required type in the driver. I can provide an example if you need one.
BR
Martin
Hello M.Keller,
I'd like to have the example for creating new gateway. Thanks again.
Hi chenhe.
I attached an example for creating a gateway.
BR
Martin
gateway_add_new.py [889 Bytes]
Your code will add only new Gateway. Do you know how to set default device to that gateway using Python script?