Author Topic: BasicButton Not Working  (Read 540 times)

UnbearableLightness

  • Newbie
  • *
  • Posts: 2
    • View Profile
BasicButton Not Working
« on: November 06, 2020, 12:29:20 PM »
Hi, I'm brand new to AHMI and VB. Just building a little test application with an existing PLC. I've added a BasicButton and I've tied it to a controller scoped tag named 'OTMakeupVlvSoftAuto'. The tag is a BOOL and I want to simply toggle the value, so I set the BasicButton OutputType to 'Toggle'. When I run the application and press the button, nothing happens.

Following the advice from another post, I added the following code to MainForm.vb to generate a tag list, and indeed my tag is spelled correctly:

Code: [Select]
    Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim t() As MfgControl.AdvancedHMI.Drivers.CLXTag
        t = EthernetIPforCLXCom1.GetTagList(60000)
        Using sw As New System.IO.StreamWriter(".\TagList.txt")
            For i = 0 To t.Length - 1
                sw.WriteLine(t(i).TagName)
            Next
        End Using
    End Sub

(As a side question, I added the code to MainForm_Load and it worked as expected. I don't understand why so maybe someone could add some context.)

Thanks in advance for your help.


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5282
    • View Profile
    • AdvancedHMI
Re: BasicButton Not Working
« Reply #1 on: November 06, 2020, 01:42:03 PM »
Add a BasicLabel to the form with the same address in PLCAddressValue and PLCAddressKeypad. Then run the application and see if it gives any errors. If not, Click the label and enter a new value on the keypad

UnbearableLightness

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: BasicButton Not Working
« Reply #2 on: November 06, 2020, 02:54:08 PM »
Hi Archie, thanks for the reply. I added the BasicLabel as you described and it worked fine. I then noticed that I hadn't supplied an address for BasicButton's PLCAddressClick property. I put the tag name in there and it worked fine. I'm just an effin noob I guess. Any recommendations for learning AHMI outside of the wiki pages?