Author Topic: Using the control messagelistbybit as an alarm display.  (Read 8302 times)

JohnnyTronic

  • Newbie
  • *
  • Posts: 30
    • View Profile
Using the control messagelistbybit as an alarm display.
« on: February 16, 2020, 07:18:32 PM »

I tried to make an alarm display using the messagelistbybit control. Had a few problems:

The message list does not reset when a 0 is sent to the bit. I had 2 messages, bits 2 and 3. When I toggle between the two, they are on the same PLC rung but inverted, they changed position at the top of the list but did not clear. Is there a way to clear or erase messages? I was sending either 4 or 8, both alarms would have been 12, so both bits saw a 0 and did not clear.

Can I have more than 16 messages?  I am using modbus which has a 16 bit word. I suppose I could use two controls if needed.

Thanks in advanced.

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Using the control messagelistbybit as an alarm display.
« Reply #1 on: February 17, 2020, 03:44:10 AM »
You could try using the attached modified version of the MessageListByBit control.

It allows to read 1, 2, 3 or 4 consecutive 16-bit registers for the total of up to 16, 32, 48 or 63 bits and messages respectively (bit count starts at 0 and bit 63 is not observed).
It also allows to read consecutive boolean values (any number from 1 to 63 as set in the new property BoolNumberOfElements).

You need to make sure to set messages for all the bits you will be using or the "UNDEFINED MESSAGE for Bit xx" will show.
You also need to make sure that your messages are not subset of each other, like: "Motor 1" and "Motor 11" which should be changed to "Motor 1 is ON" and "Motor 11 is ON" (this is important so the messages can be cleared properly).

A new property KeepMessageHistory determines if the messages are cleared or not.
It is set to False by default, in which case the messages will be cleared as follows:

Received Value of 0 will clear all messages, otherwise each bit that changed from 1 to 0 will clear its own message (including "UNDEFINED").

PLCAddressValues property is set to accept an address without modifiers only (ex. 40001 or 00001).
PLCElementBitWidth property has 5 options: BooleanWidth, Integer_16bit, Integer_32bit, Integer_48bit and Integer_64bit
PLCNumberOfElements property was changed to read-only and is set by the PLCElementBitWidth property

If the PLCElementBitWidth property is set to BooleanWidth then the new property BoolNumberOfElements will need to be set with the correct number of elements to be used.

There might be bugs.
« Last Edit: May 02, 2020, 12:52:42 AM by Godra »

JohnnyTronic

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Using the control messagelistbybit as an alarm display.
« Reply #2 on: February 17, 2020, 10:29:13 AM »
thanks, I will try soon.

JohnnyTronic

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Using the control messagelistbybit as an alarm display.
« Reply #3 on: February 18, 2020, 01:10:16 AM »
I did the following to add the new file.

- Started new copy of advancedHMI, no modifications from original.
- Opened Solution explorer.
- Opened Advancedhmi controls
- Opened Controls folder.
- Deleted original Messagelistbybit.VB file.
- Pasted in your newer file.
- Tried to build the solution but had three errors.
- The toolbox did not include the Advanvedhmi controls.

Errors
Severity   Code   Description   Project   File   Line   Suppression State
Error   BC30456   'GetComComponent' is not a member of 'Utilities'.   AdvancedHMIControls   C:\Users\jhonf\Documents\2019\Laptop 2019 10-29\advancedhmi\Feb 17\AdvancedHMIv399xR1 (1,30)\AdvancedHMIControls\Controls\MessageListByBit.vb   1   Active
Error   BC2017   could not find library 'C:\Users\jhonf\Documents\2019\Laptop 2019 10-29\advancedhmi\Feb 17\AdvancedHMIv399xR1 (1)\AdvancedHMIControls\bin\Debug\AdvancedHMIControls.dll'   AdvancedHMI   C:\Users\jhonf\Documents\2019\Laptop 2019 10-29\advancedhmi\Feb 17\AdvancedHMIv399xR1 (1)\AdvancedHMI\vbc   1   Active
Error   CS0006   Metadata file 'C:\Users\jhonf\Documents\2019\Laptop 2019 10-29\advancedhmi\Feb 17\AdvancedHMIv399xR1 (1)\AdvancedHMIControls\bin\Debug\AdvancedHMIControls.dll' could not be found   AdvancedHMIcs   C:\Users\jhonf\Documents\2019\Laptop 2019 10-29\advancedhmi\Feb 17\AdvancedHMIv399xR1 (1)\AdvancedHMICS\CSC   1   Active


Maybe I dont know the right procedure for adding a new control?



Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Using the control messagelistbybit as an alarm display.
« Reply #4 on: February 18, 2020, 01:06:24 PM »
First you need to download the control attached in my previous post.

Close all open forms, right-click the AdvancedHMIControls\Controls folder and select Add Existing Item.

Then browse to the location where you downloaded the file, select it and if a window pops up just click Yes to replace the existing control.

Rebuild the solution.
« Last Edit: February 18, 2020, 09:22:25 PM by Godra »

JohnnyTronic

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Using the control messagelistbybit as an alarm display.
« Reply #5 on: February 19, 2020, 11:17:12 AM »
Followed your updated procedures in the three posts above. See the attached picture of the error generated. Any suggestions. I tried twice and had the same results.

Thanks, you are putting good effort into helping me.

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Using the control messagelistbybit as an alarm display.
« Reply #6 on: February 19, 2020, 03:02:19 PM »
You need to provide more details, like: did you add any messages, what address are you polling for values, if the line with yellow bulb is where it stops then hover the mouse over "j" and see what value it has...

You could also zip and upload your project to a dropbox and share it.

JohnnyTronic

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Using the control messagelistbybit as an alarm display.
« Reply #7 on: February 19, 2020, 03:18:34 PM »
Ok, hopefully tonight I can give details. thanks.




JohnnyTronic

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Using the control messagelistbybit as an alarm display.
« Reply #8 on: February 19, 2020, 11:51:36 PM »
The problem was I used bit 2 twice in the messages. I ran out of time tonight. I will open up a new version of the program and reload the control tomorrow. thanks.

JohnnyTronic

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Using the control messagelistbybit as an alarm display.
« Reply #9 on: February 21, 2020, 01:28:03 AM »
My troubleshooting:

-opened a new copy of Advancedhmi.
- set up with modbusTCP communications and opened the orginal version of messgaelistbybit. I did this to see if I was following the right procedure. I set the PLC address to 40003 and the word length to 16 bit interger. It worked as before when I hit start. I could toogle the messages with the PLC.

I built a new copy of advancedhmi added the new, your latest messagelistbybit control. I made the same mods as above. I did a rebuild and had errors as per the attached print screen.

This a different screen then the one in the post above, I dont know visual basic nor visual studio so i can use this information. 

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Using the control messagelistbybit as an alarm display.
« Reply #10 on: February 21, 2020, 09:06:35 AM »
Just follow these steps:

- Download the control again since I just updated it
- Open a fresh solution of AHMI, open the MainForm, build the solution (Ctrl+Shift+B), add a ModbusTCP driver and set it up, close the form
- Follow the steps to replace the MessageListByBit control with the one you downloaded
- Rebuild the solution
- Add the MessageListByBit control to the form and test it

JohnnyTronic

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Using the control messagelistbybit as an alarm display.
« Reply #11 on: February 21, 2020, 12:12:39 PM »
 
Quote
Download the control again since I just updated it
- Open a fresh solution of AHMI, open the MainForm, build the solution (Ctrl+Shift+B), add a ModbusTCP driver and set it up, close the form
- Follow the steps to replace the MessageListByBit control with the one you downloaded
- Rebuild the solution
- Add the MessageListByBit control to the form and test it

Thanks, I will follow above. The only step I have not been following is closing the form before rebuilding. Thanks for updating the control and the steps. will update you when I finish.

I started learning advancedhmi about 3 weeks ago and have made a huge amount of progress. Its just a sparetime project.

JohnnyTronic

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Using the control messagelistbybit as an alarm display.
« Reply #12 on: February 22, 2020, 12:01:28 AM »
good news, this time it worked. Thanks.

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Using the control messagelistbybit as an alarm display.
« Reply #13 on: March 22, 2020, 09:00:36 PM »
The control was updated and replaced again to resolve a bug related to reading Boolean values (for BooleanWidth setting).


g.mccormick

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Using the control messagelistbybit as an alarm display.
« Reply #14 on: January 21, 2022, 11:11:13 AM »
I know this is an old post, but I am not having any luck getting the inifile to work.  The control just does not seem to use what is put in the inifile.