data changed events

Help
Ed Elston
2012-07-25
2013-05-30
  • Ed Elston

    Ed Elston - 2012-07-25

    First, I'll say that I really like this approach to HMI development.  Factory Talk View is so cumbersome and .Net is so much more powerful that it makes sense.

    I must be missing something obvious, but I can't find any event to handle for the controls such as DataChanged.  Can you point me in the right direction?  I see the communication control has DataReceived, but I don't think that is the expected approach.

    I just need a way to react when the value changes.  Thanks, Ed

     
  • Archie

    Archie - 2012-07-25

    Each component may have a unique event. For example, a BasicLabel has an event of TextChanged that can be used to detect data change.

     
  • Ed Elston

    Ed Elston - 2012-07-25

    Thanks for your response.  I'm using (in my examples) a BasicIndicator, would the TextChanged event be the right one?  Maybe it is just the wording that is confusing to me, since there is no text.  Also, what about the DigitalPanelMeter - TextChanged also?

     
  • Archie

    Archie - 2012-07-25

    Unfortunately those two controls have not data changed event. One work around is to add a BasicLabel with the same address, use the TextChanged event, and set the visible property to false.

    If you know a little VB.NET, you can modify those controls to add the event you want.

     
  • Ed Elston

    Ed Elston - 2012-07-26

    OK, I'll suggest that as a future improvement.  Since each control has a value property, why not add a ValueChanged event.

    Another question then, I thought maybe I could use the EthernetIPforCLXComm1.DataReceived event something like this:

    Private Sub EthernetIPforCLXComm1_DataReceived(ByVal sender As Object, ByVal e As Drivers.PLCCommEventArgs) Handles EthernetIPforCLXComm1.DataReceived
            Dim str As String = e.Values.Clone()
        End Sub

    and then parse out the values from the string, but this event never seems to fire - is it supposed to fire when data is received from the PLC?  If not, then what is the purpose of this event?

     
  • Archie

    Archie - 2012-07-26

    The DataReceived event does not fire when the components receive data because they use subscriptions for data. It's purpose it to indicate when data comes back from an asynchronous read.

    EthernetIPforCLXComm1.AsyncMode=True
    EthernetIPforCLXComm1.ReadAny("MyTag")

    Private Sub EthernetIPforCLXComm1_DataReceived(ByVal sender As Object, ByVal e As Drivers.PLCCommEventArgs) Handles EthernetIPforCLXComm1.DataReceived
            Label1.Text = e.Values(0)
        End Sub

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks