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 - Automatikai

Pages: [1]
1
Support Questions / Re: Dynamic Changing of Driver Properties
« on: June 05, 2024, 09:00:09 AM »
It stops at OpcDaCom.vb   
ItemResult = SubscriptionOPC.AddItems(OPCSubscriptionItem)

The code in my screen is

    Private Sub ScrOPCMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        OPC_Display.Text = Variables.clxOPCTopic
        OpcDaCom1.OPCTopic = OPC_Display.Text
    End Sub

The OPC_Display.Text is a textbox on the screen to check whether the Topic made it to the screen from the setup screen.

2
Support Questions / Dynamic Changing of Driver Properties
« on: June 04, 2024, 03:40:05 PM »
I have read several of the Support questions about changing IP Addresses at runtime and am somewhat confused. Most of the discussions were from about 2015 and things may have changed since then.

In the topic Changing IP Address at Runtime it appeared someone was able to use a button to set Driver.IPAddress = Textbox.Text. This seems pretty simple and is what I would prefer to do. Instead of using a button I would place the event in Private Sub Form_Load. When I do this the program hangs up and I have to terminate it.

In other topics Using .ini Files for Driver Settings it implies there is much more than simply changing the driver properties, and that it needs to initialize values on startup.

There are three properties I am trying to make dynamic on a Comms Setup screen; OpcDaCom.OPCTopic, EthernetIPforCLXCom.IPAddress, and EthernetIPforCLXCom.ProcessorSlot. I am using the MainMenuDriven controls with a variety of GoTo buttons that open different screens. Two screens have controls that connect to the 5000 Logix Emulate (OPC), these work fine if the driver topic is entered on the properties screen but not when setting OPCTopic to a string variable. There is also not an example ini file, so I assume there may be another way to set it.

For the EthernetIPforCLXCom.IPAddress and EthernetIPforCLXCom.ProcessorSlot variables, I would like to be able to set them on the Comms Setup screen and then have them saved for use on the rest of the screens that connect to real hardware. The hardware may be a ControlLogix processor in slot 0-4 or a CompactLogix (slot 0). IP addresses can vary from Class C 192.168.0.xx to Class A 10.2.4.xx.

Since the Menu closes the other screens when on the Setup Screen, the drivers can be reinitialized every time a new operation screen is opened, either OPC or hardware. If the button works in the Changing IP at Runtime example listed before, it seems like using a TextChanged or FormLoad event would also work. In this case why would the CLX.ini method be necessary?


3
Support Questions / Making form size independent using MainMenu
« on: May 22, 2024, 10:41:51 AM »
I have finally figured out how to do my screen navigation using the MainMenu, but can't seem to find where the size is overridden on the sub screens. I want the MainMenu to stay docked as it does, but I'd like the screens to appear at the size they are defined as in the properties of the screen and still remain movable. Somewhere the Main Menu overrides the size and makes the sub screen all the same height as the Main Menu, and full width.

4
Support Questions / Re: Exit Button on MainMenu
« on: April 30, 2024, 12:06:28 PM »
OK, I think I got it. Use MainMenu buttons for all navigation from the menu rather than formchange. I think I was assuming they all went to mainform.

Still struggling with screen positions and sizes.

5
Support Questions / Re: Exit Button on MainMenu
« on: April 30, 2024, 11:50:59 AM »
Additional problem: I migrated my menu controls to my main project. If you put a formchangebutton on the mainmenu to the page2 screen, it closes the mainmenu, leaving the mainform and the page2 open with no way to exit. This implies that the formchange buttons would need to be on each screen to navigate rather than on the MainMenu, which should always stay open. I must be missing something.

6
Support Questions / Exit Button on MainMenu
« on: April 30, 2024, 11:11:11 AM »
I realize this may be a VS question rather than Advanced HMI, but I am a rookie so bear with me.

I developed an application first using the MainForm, OPC driver, it worked well with an AB emulator. I added a FormChangeButton to Page2, put an OPC driver there and page2 controls also worked fine. I put a FormChangeButton on Page2 back to the MainForm and it didn't close Page2. I also went to the FormChangeControls folder and spent some time  looking at the code trying to figure out how to implement it. For instance, the exit button seems to have a ExitButton_Click Sub but no code inside. It tried using it in that application and it didn't close the forms or application. If I close the MainForm with the "X" I get a StackOverflow.

Next I created a new test application using MainMenu as my startup, MainForm as my startup form, a FormChangeButton to page2, a FormChangeButton back to MainForm. Navigation seemed to work ok, but the forms don't start in the same place. I saw some commented code with MenuPos and assume that helps put forms in the same spot, I will experiment with that later.

But the exit button doesn't close the application or forms. I have seen some help files referencing Me.Close() but when I put that in the ExitButton_Click sub I still get a stackoverflow.

To use Advanced HMI it seems that a deeper knowledge of VB.net and Visual Studio is needed, but short of an intensive bootcamp or school I don't know where to start. The Microsoft and YouTube videos and files I have found all seem to skip the fundamentals also. I have done some work using OOP in Beckhoff so I somewhat understand properties, methods, inheritance etc. but this gets over my head fast. Any suggestions?

7
Open Discussion / Re: Documentation, Visual Studio, GitHub and more...
« on: April 17, 2024, 02:28:12 PM »
Thanks Archie! I didn't know about the AdvancedHMI Files folder, I'll have to see if what I am wanting to do is built into any of the Sample Projects.

I am happy to share the document I am creating that encapsulates many of your program comments, just let me know where to put it. It will be a living document, I learn best by documenting what I do.

As far as training, I would imagine that most of the industrial automation focused users of the software have the same problem I do, a lack of experience in Visual Studio. A good VS class would be useful, but probably would take years to become adept in. I teach PLC classes for AB, Siemens, Omron and Beckhoff, and students only pick up the very basics in a week. I always tell them it takes years of practice on real-world applications to become adept at it, and they rarely have the opportunity to write their own code and build equipment like I did coming up. I teach TwinCAT only to people with a firm foundation in ladder from some other platform, and it is MUCH harder to teach things like OOP and ST structures to people with no practical coding background in a non-graphical language. Also for most of them their company pays for the training, companies have much deeper pockets than individuals.

I tried to attach a pdf of the document here, but the max file size is 512k and the pdf is 1.6MB. I am also happy to share the Word format with you or anyone who wants to collaborate on it. Let me know how I might share it.

8
Open Discussion / Documentation, Visual Studio, GitHub and more...
« on: April 17, 2024, 11:20:20 AM »
Hi Archie!

I don't know if you remember me, but I visited you several years ago asking about animating objects in Advanced HMI for a ControlLogix HMI. At that time I had not done much with Advanced HMI, or for that matter Visual Studio.

After doing some research on VS I found many suggestions for code development, including that of committing code to Git so that things can be tracked and reversed. I have also looked through this forum as part of my learning experience.

As many have mentioned here, most questions are solved by looking for help on VS and Visual Basic/.NET, but it opens a huge can of worms for those of us who are very experienced in PLC topics but not app coding and all the associated languages.

As part of my learning journey I have taken many of the help files and comments in your software and put it in a Word document with chapters, headings etc., which I would be happy to share with anyone who wants it. Unfortunately I don't see an easy way to collaborate on such a document, so right now as I find different questions that need to be answered I just write them up and add them to my document.

I am still struggling a lot with some basic things that would be simple if using FactoryTalk View, WinCC or even VISUs in CodeSYS or TwinCAT. Things like screen switching, creating an interface for setting up communications (IP address, slot number, subroutine concatenation with tag addresses, etc.) I am sure this has been done by many people, but despite this being an open platform I have found very few code examples that help answer my questions. Without my work in TwinCAT and CodeSYS I would be completely lost in Visual Studio.

Several regulars on this site have rightly chastised new members for not researching Visual Studio coding more before asking questions, but I fear it is a multi-year exercise to learn the ins and outs of this type of coding, even with my extensive experience in programming PLCs, including ST.

Any pointers you might have in finding more examples of deployed HMI code or better VS training?

9
I'm using full 2017, shell is also available. I managed to get it to run without adding the console, but still having some problems with communications. I am using OpcDaCom1 driver to talk to the AB Emulator, messages appear when monitoring in RSLinx, but it says item doesn't exist in processor. I don't think the problem is with AHMI or VS, probably something with the tag address format. It worked on my other computer without Beckhoff integration, but doesn't work on this (IT managed) computer.

10
Hi All,

I originally installed my Visual Studio to run TwinCAT 3 from Beckhoff. As such, there are a lot of TwinCAT specific tabs on my toolbar. I didn't think this would interfere with developing with Advanced HMI, but it seems to. The software installed, I can create screens, but when pressing Start to test the application it says you can't start it directly as it is a Class library. I have attempted to create a separate console application and reference the Advanced HMI project as advised, but it creates hundreds of errors. Many of the errors point to the Root namespace of MfgControl.AdvancedHMI, which is apparently the default. Are there any simple fixes for this, or can it be run on my Beckhoff-ized Visual Studio at all?

Pages: [1]