Author Topic: Glass Buttons  (Read 18094 times)

bachphi

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: Glass Buttons
« Reply #15 on: October 30, 2016, 08:08:07 AM »
In the downloaded demo folder, there are 2 DLL files ( GlassButton.dll, GlassButtonVB.dll). Adding either one of those will work, but not both.  I am curious to know why the author generated 2 dll files?
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: Glass Buttons
« Reply #16 on: October 30, 2016, 11:22:28 AM »
I would suggest that GlassButton.dll file is compiled C# code and GlassButtonVB.dll is compiled VB code.

Both of them represent the same project and that's why only one works at the time.

Take a look at the source zip file.

bachphi

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: Glass Buttons
« Reply #17 on: October 30, 2016, 06:30:09 PM »
..., add this library as reference to both AdvancedHMI and AdvancedHMIControls projects and then download and add the attached GlassButtonHMI.vb file to the PurchasedControls folder as ExistingItem.


* Edit: This should be the simplest way of adding this control to AHMI. Previously, there was another explanation with different steps, which might be reflected in the posts below.

It may be simpler, but I would recommend to follow Archie's method. The reason is if you move this project to another PC and do a build clean, your  DLL will be gone.

First,  Add the DLL file to the AdvancedHMIControls\Support using Add Existing Item.
Then Add Reference to AdvancedHMIControls project , no need to add reference to AdvancedHMI  project
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: Glass Buttons
« Reply #18 on: October 30, 2016, 08:46:02 PM »
Sounds good to me.

I have corrected my post to reflect that.

Rookie 2017

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Glass Buttons
« Reply #19 on: May 11, 2017, 04:42:56 PM »
HEY GUYS,

So im a complete noob to this stuff and and VERY slowly catching on.  But in this instance, I messed something up for sure.

I added the DLL file to the AdvancedHMIControls\Support, then added Reference to AdvancedHMIControls project , the button shows up and looks great! but no plc click......

Please speak slowly and use small words, lol

Thanks in advance

Phrog30

  • Guest
Re: Glass Buttons
« Reply #20 on: May 11, 2017, 06:16:52 PM »
If you download "GlassButtonHMIv399.vb" from post #1 it already has that in there.  It will have one error, I believe you need to change CommComponent, to ComComponent.  I haven't tested this, so it may not work.  But it does have the PLC properties there.

bachphi

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: Glass Buttons
« Reply #21 on: April 19, 2022, 11:34:08 AM »
It's been a while to revisit Godra's gem. Godra, are you still around?
Unless I am missing something, but I wanted to use it as a toggle pushbutton (Maintained PB)  and switching the button's text between Enabled/Disabled. I don't want to use PLCAddressText to select the text.  so I added the TextAlternate.

Attached is the one that included TextAlternate feature.

Also included is the dll file. Credit to Lukasz Swiatkowski.


Code: [Select]
FTV Maintained PB BACKCOLOR CAPTION TEXT PLC TAG CONNECTION
                STATE0 RED DISABLED HMI_ENABLED_I
                STATE1 GREEN ENABLED



GLASSBUTTON      OUTPUT TYPE TOGGLE
               BACK COLOR RED
               HILIGHT COLOR GREEN
               TEXT         DISABLED
               TEXT ALTERNATE ENABLED
               PLCAddressClick HMI_ENABLED_I
               PLCAddressHilight HMI_ENABLED_I
               PLCAddressSelectTextAlternate HMI_ENABLED_I

            
            
            
« Last Edit: April 19, 2022, 11:58:30 AM by bachphi »
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================