Author Topic: Setting up alarms  (Read 944 times)

drippygenius

  • Newbie
  • *
  • Posts: 2
    • View Profile
Setting up alarms
« on: June 06, 2016, 03:41:32 PM »
Hello,

First I just want to say I apologise if the answer to this question is incredibly obvious, I'm very new to VBA and to Visual Studio (although very familiar with software development and coding).

I would like to set up an alarm in AdvancedHMI, which will trigger an action - say an SMS or e-mail. For example, I have a Basic Indicator - how do I call a piece of code when this indicator turns to TRUE?

Secondary question, less important - my PLC holds alarms flags as an integer - is there a simple way to split this integer into the individal bits to display as Basic Indicators?

With many thanks in advance!


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: Setting up alarms
« Reply #1 on: June 06, 2016, 05:46:25 PM »
- Click on your BasicIndicator to select it
- At the top of the Properties Window is a small toolbar with a lightening bolt, click on that to see all of the events
- Go down to the SelectColorxChanged and double click
- This will take you back to the event handler in the code window to then do what you want

What PLC communcation driver are you using?

drippygenius

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Setting up alarms
« Reply #2 on: June 06, 2016, 06:16:56 PM »
Ah great, thank you!

So is it ValueSelectColorxChanged under the Misc section?

How would this work for a numeric value, would I go to Misc > ValueChanged, and then add some code to evaluate the current figure? What would that look like?

I'm using the Modbus TCP driver.


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: Setting up alarms
« Reply #3 on: June 06, 2016, 06:50:34 PM »
The BasicIndicator does not have a ValueChanged event because there is no Value property. It only accepts boolean values for PLCAddressSelectColor2

In Modbus, you can address bits within words like this:  40001.0