Author Topic: Illuminated Momentary Button  (Read 6763 times)

Morgan

  • Newbie
  • *
  • Posts: 44
    • View Profile
Illuminated Momentary Button
« on: April 28, 2016, 08:03:58 AM »
•  This functionality could be added to the PilotLight3Color control by adding darker colors.
•  It would also be nice to have yellow as a selection for the Momentary Button color.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Illuminated Momentary Button
« Reply #1 on: April 28, 2016, 08:32:23 AM »
The PilotLight does function as a button also through the PLCAddressClick and OutputType properties. You can also select the LightOffColor and LightOnColors independently and one option is Yellow.

rbelknap

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Re: Illuminated Momentary Button
« Reply #2 on: April 28, 2016, 01:22:58 PM »
you could also try the modified Pilot Light control in this thread.

http://advancedhmi.com/forum/index.php?topic=1085.msg5709#msg5709

It has a couple of extra properties to allow for a brighter color when it ON.  BrightOnColor and BrightEnable.
It also allows you to add text to the Lamp.

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Illuminated Momentary Button
« Reply #3 on: April 29, 2016, 09:17:50 AM »
I have modified the file that rbelknap mentioned to allow simulating a shade instead of choosing the color. This new file also has a property that allows show/hide of the text itself.

The effects can be seen in the attached picture.

The attached file should work fine in any version of AHMI since it inherits from the PilotLight control from the Controls folder.
« Last Edit: April 29, 2016, 09:23:12 AM by Godra »

Morgan

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Illuminated Momentary Button
« Reply #4 on: May 19, 2016, 10:53:42 AM »
I tried using the Pilot Light but the color difference between On/Off is too small.  The off color goes from light on the outside to dark on the inside.  It would be better if it were switched like the SimpleLED.

I just wanted to say thanks again for this GREAT software.  Being open source has allowed me to do things I could not do in other commercial HMI software.
« Last Edit: May 25, 2016, 10:24:18 AM by Morgan »

Morgan

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Illuminated Momentary Button
« Reply #5 on: May 25, 2016, 10:22:00 AM »
I created an illuminated pushbutton control and decided to post it here for anyone else to use.
Properties included: images for the 3 states of the button (Normal, Pressed, and Illuminated), button OutputType, ValueToWrite , PLCAddressVisible, PLCAddressClick, PLCAddressValue, and MinimumHoldTime.

I have included the images I use but this control uses images you supply so you can make the button look any way you like.

I did not include a text area on the legend plate for 2 reasons:
   1.  I do not always want a button with a label.
   2.  I wanted to be able to make the text area as large or small as needed.
   
Depending on what version you are running, you may have to change
SubScriptions.ComComponent   To   SubScriptions.CommComponent

steerex

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Illuminated Momentary Button
« Reply #6 on: May 25, 2016, 02:13:00 PM »
Nice Graphics!

steerex

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Illuminated Momentary Button
« Reply #7 on: May 25, 2016, 02:50:42 PM »
Yo,

The images look good but, with a fixed background color they just don't blend into the panel. I hope you don't mind but, I modified them to have a transparent background. When I put them on a panel, they really blended well.

Steve Robertson

rbeavers

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Illuminated Momentary Button
« Reply #8 on: September 11, 2016, 02:00:47 PM »
Hi All.
I am new to AHMI. I like the idea of an illuminated Push Button with all of the newly added features. I have added the modified IllumButton to the PurchasedControls folder, but the control thows the errors (Please see attachment) when I attempt to plcae the control on a form. I am attempting to run on AHMI v.399p

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Illuminated Momentary Button
« Reply #9 on: September 11, 2016, 02:06:08 PM »
Double click the first error to get to the code, then add to make it this:

MfgControl.AdvancedHMI.Drivers.IComComponent

rbeavers

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Illuminated Momentary Button
« Reply #10 on: September 11, 2016, 02:18:53 PM »
Hi Archie,
Thank you for your quick response! That did clear up the error. Now I get an error for Late Binding. I disabled "Option Strict" which removed that error. Back to Toolbox, attempting to add IllumButton to form and receive these errors... (See Attached).

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Illuminated Momentary Button
« Reply #11 on: September 11, 2016, 02:21:53 PM »
I haven't tried to add these controls yet, but just a quick guess that it may be VS, try this:

1) Windows->Close All Documents
2) Close Visual Studio
3) Re-open the solution with VS
4) Build->Rebuild Solution
5) In Solution Explorer, under the AdvancedHMI project double click MainForm
6) Try to add the control again to see if you still get the error

rbeavers

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Illuminated Momentary Button
« Reply #12 on: September 11, 2016, 02:36:32 PM »
OK. Tried it as you instructed. Solution will load but does not load any of the AHMI controls. See attached... It only loads the AHMI Drivers. If I delete the IllumButton.vb controlthen re-build, it will load all of the AHMI controls. Weird!

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Illuminated Momentary Button
« Reply #13 on: September 11, 2016, 03:09:23 PM »
I fixed the 2 errors and tested this with V3.99p. Attached is the file I am using.

rbeavers

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Illuminated Momentary Button
« Reply #14 on: September 12, 2016, 08:50:17 AM »
Thanks Archie. That Worked!!!