Author Topic: Sample App - Alarming with Status & History  (Read 1274 times)

Phrog30

  • Sr. Member
  • ****
  • Posts: 273
    • View Profile
Sample App - Alarming with Status & History
« on: June 26, 2017, 03:57:16 PM »
Here is a sample app that offers alarm status and alarm history, which is something lacking in the native app.  It uses SQLite and be deployed with XCopy.  Part of the sample is a ML1100 program.  This is only a shell, it's to show how the HMI works, it's up to you to write the PLC portion to your needs.  I do all alarming in the PLC, meaning I set triggers, alarm descriptions, zones, reset functionality, etc.  The HMI can handle this, but I'm not demonstrating with the ML1100 program.  To test alarms just toggle the test trigger bits in the PLC.  This app is setup to use internal descriptions or external (PLC) descriptions.  You can select this in the setup area.  Internal uses INI, PLC uses strings.  The PLC (strings) will change even after the trigger, which is very handy.  The internal will not change.  You will need to reload the app.  This app also has security (login/logout).  It's not completely refined, but seems functional enough to run.  To first use security you will need to create a user with admin rights, you should be prompted.  I demonstrate how you can use security with the components.  The native app uses passcode, which is very tedious.  I also show a few options on keyboards and the keypad.  I tried to strip all non essential parts of this app to make it less confusing.  Any questions or issues please let me know.  My goal is to make something like this a Panelview Plus replacement.  I have some trends built, but they aren't the best right now so I left them out of this app.  Other than trends, I don't see anything that we can't do better in AHMI!!

James


https://drive.google.com/open?id=0B-5kPtgWJjV9ek42cnR4RjZtZzQ

abdala

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Sample App - Alarming with Status & History
« Reply #1 on: June 28, 2017, 08:11:38 AM »
good projact

Phrog30

  • Sr. Member
  • ****
  • Posts: 273
    • View Profile
Re: Sample App - Alarming with Status & History
« Reply #2 on: June 29, 2017, 08:21:20 PM »
I missed something on the keypad, I added an option to show current value in textbox or leave blank.  Well, if I leave blank then open and hit backspace it will throw an exception.  This code on the backspace button should do the trick:

Code: [Select]
Private Sub buBksp_MouseUp(sender As Object, e As MouseEventArgs) Handles buBksp.MouseUp
        If Value <> "Enter Passcode" AndAlso Value <> "Incorrect Passcode" And Value IsNot Nothing Then
            Value = If(Value.Length <> 0, Value.Substring(0, Value.Length - 1), "")
            Check_Limits()
        End If
        buBksp.ForeColor = Color.Black
        buBksp.BackColor = Color.FromArgb(229, 229, 229)
    End Sub

jysm1226

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: Sample App - Alarming with Status & History
« Reply #3 on: July 02, 2017, 04:52:37 AM »
I am not familiar with vb.
Are there any projects in c #?

Phrog30

  • Sr. Member
  • ****
  • Posts: 273
    • View Profile
Re: Sample App - Alarming with Status & History
« Reply #4 on: July 02, 2017, 09:00:03 AM »
I'm the other way around, I'm not familiar with c#. You could try and use a code translator, vb to c# and convert what I have. Not sure if you realize, but archie includes the means to do both VB or c# in advancedhmi. If you look in this app you will see a c# solution. There isn't anything in there, but you could definitely use it.

Phrog30

  • Sr. Member
  • ****
  • Posts: 273
    • View Profile
Re: Sample App - Alarming with Status & History
« Reply #5 on: August 21, 2017, 10:29:31 AM »
I was asked recently about a sample app for Modbus.  I was able to get this app to work with Modbus, minus alarm description strings from the PLC.  I'm sure it's possible, but I didn't want to spend time on it as I didn't see the need.  Here's the link: https://drive.google.com/file/d/0B-5kPtgWJjV9Ry0zc1QyWDJxNTA/view?usp=sharing.  Alarm descriptions are setup in an INI file.  They are only loaded on boot, so if you change while running they won't update until you restart the app.  Also, be aware that the ini file is set to copy on newer, so if you make changes they should stay, but I always recommend changing in designer.

The PLC example is Productivity 2000 v2.4.1.2. This was my first time using this platform, so don't be surprised if you see mistakes.  Everything I tested worked, so that's all I was going for.

This version, even though modbus, does have options not available in the previous version I posted.  I added a new alarm popup, similar to the alarm banner in ME.  I added shelving, which is really nothing more than ignoring and not displaying the alarm you shelve.  I added two views for active alarms, one just shows the current active alarms, the other shows all alarms in "memory" and the current status.  This kind of mimics ME as well.  I didn't touch alarm history.  I moved security from XML to DB.  I added auditing.  The 4 objects on the main screen have auditing enabled.  You can see the audit history in app settings.  The components that currently support auditing will have an audit property.  I'm sure there is more, but that's all I remember at this point.

If anyone is serious about using this and has questions, please don't hesitate to ask in this forum or PM me directly.  In my opinion, the more people that use it, the better chance of finding bugs and other pesky issues, which ultimately helps me as I really plan on using the heck of out to on projects that would normally be ME or C-More.

Edit: for the .NET gurus, please let me know if there is a better/correct way of doing things.  I'm in no way a .NET programmer.  My goal is for functionality and easy to follow, but I would like to know the correct way of doing things.

James
« Last Edit: August 22, 2017, 08:41:04 AM by Phrog30 »

Phrog30

  • Sr. Member
  • ****
  • Posts: 273
    • View Profile
Re: Sample App - Alarming with Status & History
« Reply #6 on: August 22, 2017, 08:39:46 AM »
Some users had problems getting the last file I linked to build, so here is one that is already built, plus I removed items that weren't necessary and causing problems (power pack and reporting).
https://drive.google.com/file/d/0B-5kPtgWJjV9Ry0zc1QyWDJxNTA/view?usp=sharing

Godra

  • Hero Member
  • *****
  • Posts: 661
    • View Profile
Re: Sample App - Alarming with Status & History
« Reply #7 on: December 12, 2017, 01:54:40 AM »
For those who would like to try this application, just use ModRSSim2 simulator and make sure to set the IP address to 127.0.0.1 inside the MyHMI\Data\App_Config.ini file and for drivers named Main_PLC that appear in the top 5 listed forms inside MyHMI\Displays\Replace folder.

Then run the app, go to the "Active Alarms" screen, by clicking the alarm clock button, set the view to "All Alarms" and then you can do some testing by changing the values of the following addresses:

      - 410020 for the number of alarms to show in the view
      - 410000 to activate alarms (pretty much what you see in the attached picture, where number 15, represented in binary as 1111, will trigger alarms #0, #1, #2 and #3, while if you change that number to 64, represented in binary as 1000000, it will trigger alarm #6 only). By the way, the Alarm #0 is not supposed to ever show.

You can also try other features, like creating a user or on the Home screen setting Numeric Entry (Unsecured) which will write to F400001 address.
 
« Last Edit: December 22, 2017, 05:30:27 PM by Godra »

Phrog30

  • Sr. Member
  • ****
  • Posts: 273
    • View Profile
Re: Sample App - Alarming with Status & History
« Reply #8 on: December 12, 2017, 02:30:10 PM »
Thanks Godra.  You can also leave the combobox set to active alarms and it will only show the alarms that are active.  The CLX version is much fancier which allows for zoning, I didn't do that in the Modbus example.  I also didn't do dynamic strings.  By the way, if you don't want the alarm popup you can either set directly in the INI or during runtime in the options dialog.


James

Phrog30

  • Sr. Member
  • ****
  • Posts: 273
    • View Profile
Re: Sample App - Alarming with Status & History
« Reply #9 on: December 12, 2017, 07:12:05 PM »
I just realized a problem, the alarms start at bit 1, you see only 3 active alarms but the new alarm pop-up shows 4. I guess I need to fix that.

Godra

  • Hero Member
  • *****
  • Posts: 661
    • View Profile
Re: Sample App - Alarming with Status & History
« Reply #10 on: December 17, 2017, 01:30:29 AM »
Here is the link to C# version of this project, as converted and modified by me:

https://www.dropbox.com/s/foh7d7wi8q2wv39/AdvancedHMICSharp%20%28v3.99x%29%20-%20Modbus%20Example%20-%20Alarm%20Logging.7z?dl=0

Rebuild the project once you open it in Visual Studio.

It does have a few small features added/enabled:

      ** splash screen shows animated progress bar

      ** the app allows a change of the Modbus 4xxxxx alarm address by the admin on the Alarm tab inside the App Settings screen.
          This is currently valid for the 400001 - 465535 addresses. Do observe the addresses that might already be used for something
          else, like the address 400020 which defines the Alarm_Quantity, which is also the number of alarms that show in All Alarms view.

          The Alarm_Quantity defines how many consecutive Modbus addresses will be used. So, for the quantity of 45 alarms there should
          be 4 consecutive Modbus addresses to trigger them (14 bits of each of the first 3 addresses and 3 bits of the last address, which
          will equal (14 x 3) + (3) = 45. The mentioned 14 bits of each address actually indicate that each address can activate 14 alarms.
          Even though the registers are 16 bit, this app doesn't observe bits 0 and 15). Make sure to select the address that has sufficient number of
          consecutive addresses available to trigger all your alarms.

          Because the bit 0 is not observed, multiple integer values could trigger the same alarm. The example would be integer values 8 and 9 will both
          trigger Alarm #3 only. This alarm will also be triggered by any other value whose bit 4 is set to "1" but will have other alarms triggered along.

          If using the ModRSSim2 simulator to perform test, use 0 to 32767 values in 4xxxxx register.

      ** there is also a Refresh button added to the Alarm History screen.


The problem with the Alarm #0 pop-up appears to be resolved.

« Last Edit: December 25, 2017, 05:46:21 PM by Godra »

Phrog30

  • Sr. Member
  • ****
  • Posts: 273
    • View Profile
Re: Sample App - Alarming with Status & History
« Reply #11 on: December 25, 2017, 04:02:16 PM »
Why do you say it doesn't observe bits 0 and 15. The only bit that is ignored is bit 0 in the first word. That's alarm number 0, which I never use because you can't have zero of something. It's base 1.  If you changed, I understand, but my app doesn't behave the way you described.

Godra

  • Hero Member
  • *****
  • Posts: 661
    • View Profile
Re: Sample App - Alarming with Status & History
« Reply #12 on: December 25, 2017, 04:48:41 PM »
What was stated applies to C# version, so whomever might want to quickly test it with MODRSsim2 simulator can do so.
Not necessarily that it's bug free but the code is there and can be changed.

You posted a sample app so you can always expect people to make changes to it.

Since you didn't really provide all the details of how to test your app, I did it my way.
« Last Edit: December 25, 2017, 04:53:53 PM by Godra »

Phrog30

  • Sr. Member
  • ****
  • Posts: 273
    • View Profile
Re: Sample App - Alarming with Status & History
« Reply #13 on: December 25, 2017, 07:42:49 PM »
What was stated applies to C# version, so whomever might want to quickly test it with MODRSsim2 simulator can do so.
Not necessarily that it's bug free but the code is there and can be changed.

You posted a sample app so you can always expect people to make changes to it.

Since you didn't really provide all the details of how to test your app, I did it my way.

Gotcha. I didn't get specific because I honestly didn't believe people would use it.

Godra

  • Hero Member
  • *****
  • Posts: 661
    • View Profile
Re: Sample App - Alarming with Status & History
« Reply #14 on: December 30, 2017, 01:20:20 PM »
Here is the link to slightly expanded version of the ML1100 sample app from the very 1st post in this topic:

https://www.dropbox.com/s/kntgsz1nwaqfi3w/AHMI%20Sample%20App%20-%20ML1100%20Alarm%20Logging.7z?dl=0

The Display Test screens have been modified to the:

     - Alarm Test screen, with buttons to activate each alarm. Do note that buttons, app-wide, have the Security property which allows specific people access certain features (as suggested in the very 1st post).

     - ModbusRTU Test screen, to perform simple readings on Channel0 of the ML1100

The ModbusRTU Test screen doesn't have anything to do with the Alarm Logging. It was created so I could test the Modbus side of the ML1100 controller in a parallel communication. There are also 2 sample RSLogix .rss files included, one for ModbusRTU Slave and the other for MobusRTU Master settings on Channel0.
« Last Edit: December 30, 2017, 01:26:44 PM by Godra »