Author Topic: Template form for similar screens  (Read 2327 times)

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Template form for similar screens
« on: October 20, 2015, 02:35:59 PM »
VS2013   AdvHMI 3.99a

As I am creating my different form screens, the screens are all very similar.  Is there a way I can make a template form screen that can be duplicated easily?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Template form for similar screens
« Reply #1 on: October 20, 2015, 04:43:39 PM »
- Create your form template
- Go to File->Export Template
- Select Item Template
- Continue with the wizard

To use the template:
- Right click the AdvancedHMI project in Solution Explorer
- Select Add->New Item
- Make sure Common Items is selected
- In the item list, you should see the name your gave your form template

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: Template form for similar screens
« Reply #2 on: October 21, 2015, 10:10:05 PM »
I exported the page2 form that I updated with my controls but when I added the template into my project, it generated all kinds of errors.  I didn't include any resources in the export of the template since I was going to add the pages back into the same project.


So I tried starting with a windows form from scratch, copied the controls from my other two existing forms made the necessary property changes.  It all looked good until I ran it.  None of the controls on the new form get data from the plc.  I placed the comm control on the page like the others and added the vb code from page2 to handle closing comms for the form when hidden.

How can I copy or create a new form that communicates?

Thanks

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Template form for similar screens
« Reply #3 on: October 22, 2015, 04:17:11 AM »
On your new form check the ComComponent property of the controls and make sure it is set to the driver instance. Also make sure the DisableSubscriptions is set to False on the driver.

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: Template form for similar screens
« Reply #4 on: October 22, 2015, 10:55:31 AM »
Looks like it was an issue with the comm control.  It defaulted to a different driver.  I replaced it and it is working.


Also,  I was able to create a template that worked from an existing form.  The original must have been somehow corrupted, so when I follow this sequence, I have not had any more issues.

- Create your form template
- Go to File->Export Template
- Select Item Template - > Next
- Select the Item to export ( check box the form) -> Next
- Select Item References (not necessary to check any)  -> Next
- Name the Template - Finish
- Save project and close Visual Studio ( if I don't close visual studio, the template doesn't show up in the list when I go to Add  --> New Item


To use the template:
- Right click the AdvancedHMI project in Solution Explorer
- Select Add->New Item
- Make sure Common Items is selected
- In the item list, you should see the name your gave your form template