Author Topic: Using INI files for Driver Settings  (Read 5711 times)

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Using INI files for Driver Settings
« on: June 02, 2015, 07:44:48 AM »
The EthernetIPforCLXCom and TwinCATCom drivers allow you to use settings from an INI for some of their properties. This allows you to change things like the IPAddress without recompiling the application. Here are the steps on how to set it up:

- In the AdvancedHMI project is a directory named SampleINIFiles, expand down that directory to see the files
- Right Click CLX.ini and select Copy
- Now Right click the AdvancedHMI project and select Paste
- Click on the newly pasted files so you see the properties in the Properties Window
- In the Properties Window change Copy To Output Directory to Copy if newer
- Double click the newly pasted INI file to view its contents
- Change the IPAddress to that of your PLC
- Open the MainForm
- Add an EthernetIPforCLXCom to the form
- In the Properties Window, set the IPAddress property to CLX.ini

When you run the application, the CLX.ini file will be put in the AdvancedHMI\bin\Debug directory with the compiled application. The driver will read that file and use the IPAddress. You can edit that file with NotePad to change the address. This allows you to change the IP Address without recompiling. If you have multiple driver instances across multiple forms, you can specify CLX.ini in all of them, so changing the one INI file will change to that address for all the driver instances.

Morgan

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Using INI files for Driver Settings
« Reply #1 on: June 09, 2016, 10:58:24 AM »
Is this something you would consider adding to the Serial drivers?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Using INI files for Driver Settings
« Reply #2 on: June 09, 2016, 05:42:04 PM »
This feature is being updated with more flexibility such as having a single file that can be used for multiple drivers and the ability to easily add INI file support to controls. It will also be implemented into all drivers. It will be part of the next release due by the June 13.