Author Topic: Setting IP Address for EthernetIPforCLXCom from .ini file  (Read 2672 times)

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Setting IP Address for EthernetIPforCLXCom from .ini file
« on: February 03, 2015, 03:16:24 PM »
I would like to read a .ini file on startup and set the IP address of the EthernetIPforCLXCom driver.  How would I go about doing this?

Thanks!

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Setting IP Address for EthernetIPforCLXCom from .ini file
« Reply #1 on: February 03, 2015, 03:31:39 PM »
In the AdvancedHMI project there is a directory named SampleIniFiles.

- Drag CLX.ini out of the folder and to the top level of the project
- With CLX.ini file selected, go to the Properties Window and select Copy To Output Directory to Copy If Newer
- In the driver instance, in the IPAddress property put CLX.ini
- Edit the CLX.ini file to set the IPAddress you want

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: Setting IP Address for EthernetIPforCLXCom from .ini file
« Reply #2 on: February 03, 2015, 06:28:47 PM »
Works great, thanks!

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: Setting IP Address for EthernetIPforCLXCom from .ini file
« Reply #3 on: July 13, 2017, 11:08:57 AM »
I have a new project, using version AdvHMI3.99w, and have not been able to get this method to work.

I have the MainForm with driver: EthernetIPforCLXCom1
property IPAddress  is set as "CLX.INI"

CLX.INI file contains:
[EthernetIPforCLXCom1]
IPAddress=192.168.1.100


It works fine with the 192.168.1.100 set directly in the driver, but when using the INI file method, the screen objects do not populate. 

What am I missing?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Setting IP Address for EthernetIPforCLXCom from .ini file
« Reply #4 on: July 13, 2017, 11:23:51 AM »
I have a new project, using version AdvHMI3.99w, and have not been able to get this method to work.

I have the MainForm with driver: EthernetIPforCLXCom1
property IPAddress  is set as "CLX.INI"

CLX.INI file contains:
[EthernetIPforCLXCom1]
IPAddress=192.168.1.100


It works fine with the 192.168.1.100 set directly in the driver, but when using the INI file method, the screen objects do not populate. 

What am I missing?
Check in your bin\Debug directory and make sure the CLX.ini file is getting placed there. Make sure you have INIFileName property set to CLX.ini and INIFileSection set to EthernetIPforCLXCom1

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: Setting IP Address for EthernetIPforCLXCom from .ini file
« Reply #5 on: July 13, 2017, 11:34:27 AM »
Thanks, I had missed the added properties in the driver since I had used it last.

Works, Great