Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - joseph_e2

Pages: [1] 2
1
Support Questions / Re: Error handling in form controls
« on: September 19, 2023, 02:15:33 PM »
What version of AdvancedHMI are you using? I tried this with 3.99y Beta and unable to replicate it.

I'm using v399y Beta 38.
The first PLC is a CompactLogix 1769-L33ER, v34
The second is a MicroLogix 1400 1766-L32BWA, Series C
Both are just sitting on my desk (not in production) and connected to my USB NIC via an unmanaged switch along with an HMI, a safety controller, another ML1400, and a SLC 5/05.

I'm testing a comm failure by unplugging the network cable at the PLC.

To prevent the runtime error when I unplug the ML1400, I added a try/catch as shown in the attached screenshot.

2
Support Questions / Re: Error handling in form controls
« on: September 13, 2023, 11:58:05 AM »
I'm still struggling with getting this to work. Until I sort out the runtime error with the MicroLogix, I'm just using the CompactLogix driver. I have a basic indicator tied to a PLC flasher bit and some basic labels tied to different numeric tags (a string, some reals, some dints). When the form first loads, if the PLC is powered up and running, it all works. If I unplug the PLC, they all stop and display the error message (as expected). When the PLC resumes, they seem start working again, but it sometimes takes a bit, especially if the PLC has been off more than a minute or two. That's fine as long as "a bit" isn't too long. So far, it seems ok.

But, if the PLC is off when the program starts, the form controls don't start working when the PLC connects. I have a command button that reads data from the PLC into a local variable. That works fine once the PLC is talking. As a test, I added a timer control that's enabled by the driver's .ComError event. It's tick event has a try/catch that reads a PLC tag. If the read succeeds, it checks a checkbox that's unchecked by the .ComError event and disables the timer. That all works (as long as the timer interval is a lot longer than the driver's timeout), but I can't get the basic indicator or basic labels to start working.

I've tried different things, like <control>.disable when there's a .ComError followed by a <control>.enable when comms are restored, <control>.refresh, <control>.update, <control>.hide/show, nothing gets the form control working. How can I trigger a refresh/restart/whatever of the form controls so they start updating? It's a virtual certainty that at least one of the machines will be powered off any time this program is started. They also tend to spend a long time turned off (during change-overs, when they're not running it that shift, etc.). It's not ideal, but I can add a button to refresh communications for each driver. I'd rather have it automatic, though.

3
Support Questions / Re: Error handling in form controls
« on: September 12, 2023, 10:03:34 AM »
I've attached a screenshot. I commented out the places inside MainForm.vb where I'm referring to the driver to read out of the PLC. Here are the details from "Copy Details", in case that's helpful:
Quote
MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException
  HResult=0x80131500
  Message=No response from Forward Open
  Source=MfgControl.AdvancedHMI.Drivers
  StackTrace:
   at MfgControl.AdvancedHMI.Drivers.CIP.CommonIndustrialProtocol.ForwardOpen(Int32 sendSequence)
   at MfgControl.AdvancedHMI.Drivers.CIP.CommonIndustrialProtocol.ConnectedSend(MessageRouterRequest MRR, Int32 sequenceNumber, Int64 ownerObjectID)
   at MfgControl.AdvancedHMI.Drivers.CIP.CommonIndustrialProtocol.ConnectedSend(Int32 serviceCode, IEPath path, Byte[] data, Int32 sequenceNumber, Int64 ownerObjectID)
   at MfgControl.AdvancedHMI.Drivers.CIP.CIPforPCCC.a(PCCCCommandPacket A_0, Int32 A_1, Int64 A_2)
   at MfgControl.AdvancedHMI.Drivers.AllenBradley.PCCC.EthernetIPforSLCMicroPLC5.SendData(PCCCCommandPacket pccc, Int32 TNS)
   at MfgControl.AdvancedHMI.Drivers.AllenBradley.PCCC.EthernetIPforSLCMicroPLC5.SendPCCCPacket(PCCCCommandPacket packet)
   at MfgControl.AdvancedHMI.Drivers.AllenBradley.PCCC.BasicCommands.ProtectedTypeLogicalRead(Byte byteSize, Byte fileNumber, Byte fileType, Byte elementNumber, Byte subElementNumber, Int32 TNS)
   at MfgControl.AdvancedHMI.Drivers.AllenBradley.PCCC.PCCCResponseHandling.DataFileRead(PCCCAddress PAddress, Int32 TNS)
   at MfgControl.AdvancedHMI.Drivers.AllenBradley.PCCC.PCCCforHMI.BeginRead(String startAddress, Int32 numberOfElements)
   at AdvancedHMIDrivers.EthernetIPforSLCMicroCom.BeginRead(String startAddress, Int32 numberOfElements) in C:\Documents\VisualStudioProjects\Presses-905\AdvancedHMIDrivers\AllenBradley\EthernetIPforSLCMicroCom.vb:line 357
   at MfgControl.AdvancedHMI.Drivers.AllenBradley.PCCC.PCCCforHMI.a()

edit to add:
To double check I hadn't forgotten/missed some code, I moved the basic indicator that refers to this driver to page 2 and the error has stopped with that PLC unplugged. I also put a try/catch block around the code that reads from the CompactLogix and unplugged it. No error from that driver and the BasicLabel controls that also display data from that PLC show the error inside the control without throwing a runtime error.

4
Support Questions / Error handling in form controls
« on: September 11, 2023, 01:51:28 PM »
I found this thread about using try/catch to handle things when a PLC drops offline:
https://www.advancedhmi.com/forum/index.php?topic=440.msg1653#msg1653
How do you handle it when the PLC driver is referenced directly in a form control? I have a BasicIndicator on my main form that is tied to a flasher bit in the PLC, just as a sort of visual handshake. When I unplug the PLC, I get a runtime error. Do I need to add try/catch structures to the driver? The exception is "No response from Forward Open" in the BeginRead Function of EthernetIPforSLCMicroCom.

5
Support Questions / Re: Trouble changing IP address of MicroLogix PLC
« 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!

6
Support Questions / Re: Trouble changing IP address of MicroLogix PLC
« 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.

7
Support Questions / Re: Trouble changing IP address of MicroLogix PLC
« 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.

8
Support Questions / 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!

9
Support Questions / Re: Beckhoff Twincat 2 connection
« on: August 03, 2020, 01:04:11 PM »
I heard back from the machine OEM. They asked... "May I know the communication format from your AdvancedHMI to our beckhoff? OBCUA?"

10
Support Questions / Re: Beckhoff Twincat 2 connection
« on: July 10, 2020, 03:04:51 PM »
As an experiment, I made a copy of an old WinXP virtual machine and installed TwinCat2 on it. It came with a sample PLC program, which I got to run by following a tutorial on Beckhoff's website. I then pointed my VS project at the new XP VM and got it to display a blinking light based on one of the variables inside the Beckhoff software. I also found a static route called AdvancedHMI8BE1 in the system control dialog box and in the system manager under System - configuration -> Route settings.

The only trouble I had was that there was a second host-only network adapter on the virtual machine. While that was there, Wireshark was showing traffic on the second adapter and AHMI wouldn't work. Once I deleted the second host-only adapter, AHMI started working. Is there a trick on the Beckhoff side when there are multiple NICs? The Beckhoff PC I'm trying to connect to has 2 NICs. I'm using one of them for these tests but it'll ultimately have to talk through the other that's connected to our wired LAN.

I also asked the OEM if there is a setting on their end that's blocking it. Hopefully there is and they're willing to tell me how to un-block it without paying them for their (very expensive) software.

It looks like the AHMI side is configured properly and that there's something wonky inside the Beckhoff PC.

11
Support Questions / Re: Beckhoff Twincat 2 connection
« on: July 09, 2020, 03:35:29 PM »
As I've thought about it further, it occurs to me that the OEM who build the machine may have locked something down. When we asked about remote connections for data, they sent us a brochure and a quote for their custom software package. It was NOT cheap. It wouldn't surprise me if something they've done is breaking things

12
Support Questions / Re: Beckhoff Twincat 2 connection
« on: July 09, 2020, 03:33:54 PM »
The list box on the AMS Router tab is always empty, but I don't know if I've ever looked at it while AHMI was running...

I'll try to test that tomorrow.

13
Support Questions / Re: Beckhoff Twincat 2 connection
« on: July 09, 2020, 01:53:19 PM »
Here are some screenshots.

14
Support Questions / Re: Beckhoff Twincat 2 connection
« on: July 09, 2020, 01:50:51 PM »
I added a password ("1") to the Administrator user account in Windows on the TwinCAT PC and tested the autologin to make sure I didn't break it. I also added that password to the "System" tab of the "TwinCAT System Properties" dialog box and to the properties of the COM object in the AHMI project. Here is an updated Wireshark capture.

Thanks!

15
Support Questions / Re: Beckhoff Twincat 2 connection
« on: July 08, 2020, 10:17:17 AM »
You mean the Windows Administrator account? I can check. As long as it will still auto logon with the password, that shouldn't be a problem.

Pages: [1] 2