Author Topic: MessageListByBit - Remove inactive messages  (Read 2468 times)

cm6760

  • Newbie
  • *
  • Posts: 2
    • View Profile
MessageListByBit - Remove inactive messages
« on: July 22, 2015, 02:23:39 PM »
Is there a way on the MessageListByBit to only display the messages associated to the active bits on each refresh? Right now it seems that once the bit goes high, the message displays forever, even though the bit went low again. It like it work the same as the MessageDisplayByBit, but in a vertical list.

Thanks for any suggestions.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5320
    • View Profile
    • AdvancedHMI
Re: MessageListByBit - Remove inactive messages
« Reply #1 on: July 22, 2015, 03:53:28 PM »
The closest you can get it to set RemoveDuplicateMessages to True.

cm6760

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: MessageListByBit - Remove inactive messages
« Reply #2 on: July 22, 2015, 05:10:51 PM »
Ok, thanks for the info.. Is there an event or method that I could call to clear the messagelist prior to the control updating? This way the list would start blank at every update and only show the bits that are active?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5320
    • View Profile
    • AdvancedHMI
Re: MessageListByBit - Remove inactive messages
« Reply #3 on: July 22, 2015, 05:30:51 PM »
You could add a DataSubscriber, set the PCLAddressValue to what you are using with the MessageList, then double click the DataSubscriber to get to the DataChanged event handler. Then add this code:

MessageListByBit1.Items.Clear
MessageListByBit1.Value=e.values(0)

Be sure not to be anything in the PLCAddressValue property of the message list.

Programmer72

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: MessageListByBit - Remove inactive messages
« Reply #4 on: November 27, 2017, 02:03:30 PM »
MessageListByBit1.Items.Clear()
Place inside of another function. I have it inside a button that resets a fault on my PLC. You could run it through a timer or a plc value change, whatever you like. As long as the input value no longer remains and there is not an active message, it clears it. The whole section is as follows:

Private Sub BasicButton5_Click(sender As Object, e As EventArgs) Handles BasicButton5.Click
        MessageListByBit2.Items.Clear()

    End Sub