Author Topic: Copying components between projects with v3.80  (Read 1729 times)

pal

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Copying components between projects with v3.80
« on: November 04, 2014, 03:10:40 PM »
What is the best way to copy components between projects ?
I have a couple of MessageDisplayByValue components with up to 85 messages , so there is a lot of work in recreating them .

Paul

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: Copying components between projects with v3.80
« Reply #1 on: November 04, 2014, 04:17:45 PM »
The MessageDisplayByValue has a property named IniFile. You can create a message list in a text file and specify the filename in that property.

1) right click AdvancedHMI project and select Add New Item- > Text File
2) Select the newly added file in Solution Explorer and set the property CopyToOutputDirectory
3) Edit the text file and add these lines

0, No Messages
1, My first message
2, Another message

pal

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: Copying components between projects with v3.80
« Reply #2 on: November 04, 2014, 04:23:41 PM »
Thanks for the quick response Archie . Can you also add the colour name after another
comma seperator ?

Thanks again,

Paul

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: Copying components between projects with v3.80
« Reply #3 on: November 04, 2014, 06:36:09 PM »
Not in version 3.80. The ability to specify a different back color for each message was a fairly recent addition made in order to be able to mimic a PanelView closer, so it never made it to the IniFile parser. The next release will allow a 3rd item to be specified for the back color.

Noe

  • Full Member
  • ***
  • Posts: 205
    • View Profile
Re: Copying components between projects with v3.80
« Reply #4 on: November 05, 2014, 10:18:03 AM »
Archie, I was testing the Ini parser in v3.6.8 without a PLC online right now. I added the file as you mention, changed the CopyToOutputDirectory property, added those exact lines you wrote to the text file, and set the IniFileName property to TextFile1.txt (name of my text file). I still get the "Undefined message for 0" legend. If I change the file name property to something different the legend would change to "Could not find.." (it gets cut by the frame), so it looks like is being found but now shown. What am I missing?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: Copying components between projects with v3.80
« Reply #5 on: November 05, 2014, 07:17:51 PM »
That was a problem that I fixed. If you add a button to your form, then double click and add this code:

MessageDisplayByValue1.Value+=1

You will see it change to the proper message