Author Topic: Trouble changing IP address of MicroLogix PLC  (Read 1400 times)

joseph_e2

  • Newbie
  • *
  • Posts: 21
    • View Profile
Trouble changing IP address of MicroLogix PLC
« on: September 07, 2023, 04:36:05 PM »
I haven't done a lot with this, but I'm working on a program that will need to connect to multiple PLCs. There will be 4x CompactLogix and 2x MicroLogix 1400. I have the first CompactLogix talking but I'm having trouble getting started with the MicroLogix. I dropped the "EthernetIPforSLCMicroCom" driver on the form but when I change the IP address, I get an error message saying "Property value is not valid." When I hit "Details", I get "Access to the path C:\Documents and Settings' is denied." Sure enough, that directory shows a lock icon in Explorer. I haven't been able to unlock it in Windows. What needs access to that directory?

I'm using visual studio express 2015 (I know, it's old...) and Advanced HMI 399yBeta38 on a 64-bit Windows 7 Pro SP1 virtual machine.

Thanks for the help!

joseph_e2

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Trouble changing IP address of MicroLogix PLC
« Reply #1 on: September 08, 2023, 08:59:04 AM »
Further details. I now get the error when I save the project after adding the driver, without making any changes beyond that.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5323
    • View Profile
    • AdvancedHMI
Re: Trouble changing IP address of MicroLogix PLC
« Reply #2 on: September 08, 2023, 09:40:35 AM »
This may be a dumb question, but did you unzip the project before opening it? I've come across cases of people working directly in the zip file and VS gives all kinds of weird issues.

I would also try a full clean:

https://www.advancedhmi.com/forum/index.php?topic=1062.msg5555#msg5555

joseph_e2

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Trouble changing IP address of MicroLogix PLC
« Reply #3 on: September 08, 2023, 09:45:29 AM »
Ok, I've been working on this more. I decided to create a brand new project using the exact steps in the quick start guide. Copy the files from the zip file into a new directory, double-click the sln file, and open the main form. Now, after I build the project, only a few drivers show up in the toolbox. After multiple attempts, restarts, and a reboot, I'm still missing most of the drivers. I just get Pointer, OpcDaCom, SimulatorCom, and TwinCATviaTCPIPCom under "AdvancedHMIDrivers Components".

So, I went back to my original project that's already talking to a CompactLogix and re-added the EthernetIPforSLCMicroCom driver, renamed it, changed the IP address, saved, and it worked this time. I have no idea what happened to make it start working.

Edit: I just saw the pinned post about missing drivers being a known bug in VS2015. I'll work on getting a newer version downloaded. I'll have to do it from home, though, because our internet connection here is barely functional.
« Last Edit: September 08, 2023, 09:47:15 AM by joseph_e2 »

joseph_e2

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Trouble changing IP address of MicroLogix PLC
« Reply #4 on: September 11, 2023, 01:47:36 PM »
I took my laptop home over the weekend and downloaded/installed VS2022 successfully. It seems to be working as expected now.

I ran into something weird with it not liking some variable declarations. Based on examples here of using ReadUDT, I created a Class to hold the data from the CompactLogix. I then created another class for the data from the MicroLogix, but it would throw null reference exceptions saying that it was referring to an object that wasn't instantiated. The code for the 2 PLCs was almost identical. I created the classes, then used DIM statements:
Code: [Select]
Dim recipes(8, 31) As RecipeLdr
Dim recipesB(3, 31) As  RecipeBatch

Then, I successfully used ReadUDT... to populate the recipes variable and tried to use Read... to populate the recipesB variable. The recipesB would throw that exception until I changed it from a public class to a public structure. The recipes variable works fine as a Class.

I have the basics working, now it's down to error handling and then scaling it. Thanks for the help!