General Category > Tips & Tricks

Glass Buttons

<< < (2/5) > >>

Archie:
It looks like everything is right in your code. You can put a breakpoint in the SubscibeAutoProperties subroutine in SubscriptionHandler.vb then step through to see if it finds the matching Enabled property.

Godra:
Since I am not familiar with using breakpoint and stepping through the code, which I tried for a little while, here is what I tried:

- Use a copy of SquareIlluminatedButton.vb to convert GlassButton to AHMI control
-- Add OutputType property to it since it was missing and error was showing (which I then copied from BasicButton)
-- Add PLCAddressEnabled property to it as well

I will have a guess and say that SquareIlluminatedButton control was inheriting OutputType property from MfgControl.AdvancedHMI.Controls.SquareIlluminatedButton and that's why I was getting error.

And now it works and responds to a PLC address and changes Enabled property.
I am still not sure why BasicButton wouldn't do the same.

>>>  For those who decide to try to create this control, just follow the steps from the 1st post. <<<

This will give you an option to Enable/Disable button with a PLC address bit.

pal:
Hi Godra ,
 I've tried importing the glass button to advanced HMI following the steps in your 1st post . I opened the button in vb 2010 and converted the code with no errors . I added a new class to the Purchased Controls folder and changed the name to GlassButton.vb . I replaced the code with the code from GlassButton.vb .
on building Advanced HMI , I am getting 7 errors and 1 warning.
The 1st error comes from the initializeComponent() command on rung 25    (just before the timer )
The rest of the errors come from rugers which reference the timer.
The warning comes from the reference just above the timer with 3 ''' in front.
I am a complete novice when it comes to VB 2010  , so what have I done wrong ?
Any help you can give would be much appreciated .
Paul

Godra:
I am not sure about this, since I am not a professional programmer, but here is what you can try:

1) Remove the GlassButton.vb class from the "Purchased Controls" folder
2) Right click the folder and click "Add" --> "Existing Item" and then browse to GlassButton folder, wherever you extracted it from downloaded zip file, go to GlassButtonVB folder and select GlassButton.designer.vb
3) Ignore all the errors and just the do same steps and add GlassButton.vb (I answered "No" to a prompt about overwriting the existing designer vb file)
4) The only warning that I got was referencing the XML comment for a tag with 'cref' attribute, which it would ignore anyway (it will go away if you remove "<" and "/>" from that line)
5) Close all open forms and rebuild the project

If you still have errors then you might need to add or check references, right click the project and go to Properties window, select References and in the Imported Namespaces try to check all those that appear on top of the GlassButton.vb as "Imports".

I just tried these 5 steps listed above in version 3.8.4 and it worked.

Depending on the AHMI version that you are using, you might get some other errors once you try to create AHMI GlassButton control (this since every new version might implement code changes in certain classes). Try to use common sense and just copy and paste, or remove, one property at the time to see how it reflects on the control. In the file that was posted previously you might notice that there is no PLCAddressValue property, this since there is no "Value" property either so I didn't think that it would do anything useful and removed it (which I might be wrong about).

From what I've seen so far, some output types might not work correctly (Momentary Set, Momentary Reset, Set True, Set False appear to work fine but I couldn't get Toggle and Write Value to work with OPC Simulator). <-- Tried this with MicroLogix PLC and Toggle works fine, only WriteValue I am still not sure how to use properly (if Archie could provide a hint that would help)

pal:
Thanks for your reply Godra , I will try over the weekend . I'm using 397e though that might change when "f" is released . Will let you know how i get on .
Paul

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version