Changing IP Address of Ethernet Port with Program

Hey guys,
I was wondering if there was a way to change the IP address of my Ethernet port, within the program.
Is there a way for the program to permanently write to these configuration values?

Hi @c589717 ,

yes, there are function blocks for this available:

CfgSetIPAddr()

https://help.br-automation.com/#/en/4/libraries%2Fasarcfg%2Ffbks%2Fcfgsetipaddr.html

CfgSetSubnetMask()

https://help.br-automation.com/#/en/4/libraries%2Fasarcfg%2Ffbks%2Fcfgsetsubnetmask.html

2 Likes

Oh, ok nice. I’m testing it out at the moment, and I don’t really understand the syntax for pDevice: SL.SS.IF.ETH

I think that IF may mean IF3 for my ethernet port on my device, but what is SL and SS?

you first should activate column ‘PLC Address’ in your hardware tree (right click):

after that you will see the ‘PLC Address’ for your ETH

image

which can be very simple like that in the screenshot or be a more complex path consisting of
SL Slots and
SS Subslots and
IF an interface name
ST slot

1 Like

Its working perfectly, thanks.

1 Like