Author Topic: Ways of upgrading older solutions to newer versions of Advanced HMI?  (Read 8492 times)

usapatriotforlife

  • Newbie
  • *
  • Posts: 39
    • View Profile
Do any of the AHMI users on here have any suggestions, tips, or tricks for a newbie like me on how to make my projects easier to upgrade when a new AHMI version comes out?  I've got one project still running v3.41 because I just don't have the time or patience to convert it to a newer version. 

I'm trying to make my newer projects as modular as possible. 

I've started doing stuff like this:

Code: [Select]
### The click event for some Advanced HMI Object ###
sub hmiobject_clicked(sender as .....) handles events xxxxxx
  call mycustom_hmiobject_clicked(sender)
end sub

where I only put a single line in the click event code that calls a subroutine that does all the work.  I put that subroutine in a separate file for portability.

The biggest work to be done when upgrading to a newer version is rebuilding the form and adding all of the objects.  How do y'all handle that?  I've tried cutting and pasting the auto generated code with limited good results.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Ways of upgrading older solutions to newer versions of Advanced HMI?
« Reply #1 on: October 06, 2013, 08:37:22 PM »
The easiest way to upgrade to a newer version:

1) Open a blank project in the new version
2) Right click the AdvancedHMI project in the solution Explorer
3) Select Add->Existing Item
4) Browse to the old project and select all of the forms vb files (there will be 3 files for each form, only select the .vb file)
5) Manually go to each error and correct

This works well unless crossing the 3.5 boundary. If upgrading from a pre-3.5 to a post 3.5, you will get a large number of errors because of the property changes.

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
Re: Ways of upgrading older solutions to newer versions of Advanced HMI?
« Reply #2 on: March 16, 2017, 03:26:08 PM »
One thing I found out when adding existing forms, if you select Form1.VB it will import all 3 Form1 files, but it is possible to select more than one *.VB file and import them - but if you do this it only imports the +.VB files selected and doesn't import the other 2 files for each form.

If you need to import multiple forms it will have to be done one at a time (unless there is a bug in my version of VS-Community 2015)

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Ways of upgrading older solutions to newer versions of Advanced HMI?
« Reply #3 on: February 16, 2019, 01:28:19 PM »
An update to the procedure with more details:

1) Open a blank project in the new version
2) Right click the AdvancedHMI project in the solution Explorer
3) Select Add->Existing Item
4) <IMPORTANT STEP> Browse to the old project and select a .vb file with the same name as the form, NOT the one with designer in the name. It is important to only select one form per Add. Repeat this for each form.
5) Manually go to each error and correct

When doing the MainForm, you will be prompted to replace files at least 3 times.

If all else fails, this option is available:

https://www.advancedhmi.com/index.php?main_page=product_info&cPath=2&products_id=11

« Last Edit: February 16, 2019, 01:38:16 PM by Archie »

Phrog30

  • Guest
Re: Ways of upgrading older solutions to newer versions of Advanced HMI?
« Reply #4 on: February 16, 2019, 04:09:06 PM »

There are only two  .VB files per form in the directory.

Are you sure? Click on show all files, sometimes they are hidden, not always though.

Phrog30

  • Guest
Re: Ways of upgrading older solutions to newer versions of Advanced HMI?
« Reply #5 on: February 16, 2019, 04:16:21 PM »
Also, to update the thread, I suggest putting everything in your own folder. That makes updating easy. There is no add one at a time silliness. Simply copy the folder, include in project, done! (Assuming you have references).

Phrog30

  • Guest
Re: Ways of upgrading older solutions to newer versions of Advanced HMI?
« Reply #6 on: February 23, 2019, 08:05:27 PM »
Also, to update the thread, I suggest putting everything in your own folder. That makes updating easy. There is no add one at a time silliness. Simply copy the folder, include in project, done! (Assuming you have references).
Not sure what you mean by that- Are you copying all the forms from the previous version to the new version before you run it?


Yes, using Windows Explorer, copy the folder from the original project, then paste into the one you want to use.  Then open in VS, right click on folder, include in project.  That's it.

Phrog30

  • Guest
Re: Ways of upgrading older solutions to newer versions of Advanced HMI?
« Reply #7 on: March 03, 2019, 06:55:54 PM »
There is no right or wrong way of updating an application.  If it works, then it really doesn't matter, but I think if there is a way to save time I think most users would be interested.  Here's an example, if you have an application with 100 forms and you wanted to update to a new version, adding these forms one at a time is time consuming.  Another option is to create a folder and put these forms in this folder.  Now if you update, all you have to do is copy the entire folder to the new project, right click and add to project and rebuild.  If you only have forms, this should be it.  If you have controls or components you may have to fix things manually.  I think most users will only have forms.  If you only have a form or two, then it probably won't save time.

Edit: this isn't an AdvancedHMI thing, it's a Visual Studio thing, one supporting link I found: https://stackoverflow.com/questions/57776/how-do-i-add-existing-item-an-entire-directory-structure-in-visual-studio
« Last Edit: March 03, 2019, 07:31:09 PM by Phrog30 »

DavidSr

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: Ways of upgrading older solutions to newer versions of Advanced HMI?
« Reply #8 on: March 06, 2019, 10:20:23 AM »
There is no right or wrong way of updating an application.  If it works, then it really doesn't matter, but I think if there is a way to save time I think most users would be interested.  Here's an example, if you have an application with 100 forms and you wanted to update to a new version, adding these forms one at a time is time consuming.  Another option is to create a folder and put these forms in this folder.  Now if you update, all you have to do is copy the entire folder to the new project, right click and add to project and rebuild.  If you only have forms, this should be it.  If you have controls or components you may have to fix things manually.  I think most users will only have forms.  If you only have a form or two, then it probably won't save time.

Edit: this isn't an AdvancedHMI thing, it's a Visual Studio thing, one supporting link I found: https://stackoverflow.com/questions/57776/how-do-i-add-existing-item-an-entire-directory-structure-in-visual-studio
Thank you James, makes sense. The first time I did it that way it worked fine but for some reason when I tried that when upgrading to the next beta version I go so many errors I decided to try Archie's method after I read his "IMPORTANT" notice and it went fine.    Since I am only using one form until I port this over to a smaller device, you are right, your suggested method won't save enough time - I only have to import MainForm.vb and it takes care of the rest pretty quick.
I am trying squeeze in time to test this stuff to help out but I don't know enough about vb and just can't nor do I have the desire to study it at this time.

Thank you!
David

Noe

  • Full Member
  • ***
  • Posts: 205
    • View Profile
Re: Ways of upgrading older solutions to newer versions of Advanced HMI?
« Reply #9 on: November 06, 2020, 05:41:49 PM »
The easiest way to upgrade to a newer version:

1) Open a blank project in the new version
2) Right click the AdvancedHMI project in the solution Explorer
3) Select Add->Existing Item
4) Browse to the old project and select all of the forms vb files (there will be 3 files for each form, only select the .vb file)
5) Manually go to each error and correct

This works well unless crossing the 3.5 boundary. If upgrading from a pre-3.5 to a post 3.5, you will get a large number of errors because of the property changes.

I want to update a project from v3.9.9t to current version 3.9.9yBeta36. Is this still the best way possible? I'm using three drivers of EthernetIPforSLCMicroCom, and want to add a ModbusTCP to connect to a Siemens PLC. Do you foresee any issue with that combination of drivers? I want to update as I've seen that Archie did some fixes and improvements since v3.9.9t to ModbusTCP.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Ways of upgrading older solutions to newer versions of Advanced HMI?
« Reply #10 on: November 06, 2020, 06:16:02 PM »
I want to update a project from v3.9.9t to current version 3.9.9yBeta36. Is this still the best way possible? I'm using three drivers of EthernetIPforSLCMicroCom, and want to add a ModbusTCP to connect to a Siemens PLC. Do you foresee any issue with that combination of drivers? I want to update as I've seen that Archie did some fixes and improvements since v3.9.9t to ModbusTCP.
Yes, this is still the best upgrade path. Going from 3.99t to 3.99x or 3.99y is a fairly big jump in versions, so you will possibly have a lot of errors to correct. Typically the errors are repeated so a Search and Replace can be used to correct them quickly.

Noe

  • Full Member
  • ***
  • Posts: 205
    • View Profile
Re: Ways of upgrading older solutions to newer versions of Advanced HMI?
« Reply #11 on: November 06, 2020, 11:39:42 PM »
Seems to work fine by the exception of datasets, I used the same method but those created a lot of errors and cannot be opened like in the original project. Do you know if there is another method to import them into the new project?