AdvancedHMI Software

General Category => Support Questions => Topic started by: JohnnyTronic on February 16, 2020, 07:18:32 PM

Title: Using the control messagelistbybit as an alarm display.
Post by: JohnnyTronic 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.
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: Godra 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.
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: JohnnyTronic on February 17, 2020, 10:29:13 AM
thanks, I will try soon.
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: JohnnyTronic 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?


Title: Re: Using the control messagelistbybit as an alarm display.
Post by: Godra 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.
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: JohnnyTronic 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.
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: Godra 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.
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: JohnnyTronic on February 19, 2020, 03:18:34 PM
Ok, hopefully tonight I can give details. thanks.



Title: Re: Using the control messagelistbybit as an alarm display.
Post by: JohnnyTronic 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.
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: JohnnyTronic 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. 
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: Godra 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
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: JohnnyTronic 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.
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: JohnnyTronic on February 22, 2020, 12:01:28 AM
good news, this time it worked. Thanks.
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: Godra 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).

Title: Re: Using the control messagelistbybit as an alarm display.
Post by: g.mccormick 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.
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: patrick.n on January 28, 2022, 02:23:45 AM
USAGE TIP:  When Using Different Drivers

EthernetSLCMicro... driver will only read the PLCAddress eg N7:0 so only use PLCElementBitWidth = Integer_16bit. 

EthernetCLX driver:  works best if you create an array of INT (16bit) eg MyIntArray[3] then set PLCAddress = eg: MyIntArray[0]

   
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: pal on January 29, 2022, 03:49:24 PM
An alternative is to use the message list by values . I use mainly allen bradley 5000 and it has a useFul instruction - FBC . ( File Bit Compare ) . The biggest alarm array Iv'e programmed had 203 alarms and used an array of 8 32 bit words. Using a timer when an alarm is found , the display will cycle through any active alarms in the array , stopping for the timer setting at each alarm .
Regards Pal
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: BlueAltezza on June 17, 2022, 03:43:01 PM
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

Another post to bring this back from the dead, but I've been trying to follow these steps and keep getting the same "BC30456   'GetComComponent' is not a member of 'Utilities'." error upon rebuilding the solution.
Using v399xR1, tried with VS 2019 and 2022.
After the error I can repeat the add existing step with the original MessageListByBit.vb from a working project and can rebuild without a problem.
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: Godra on April 24, 2023, 10:41:14 AM
You should download and use the latest beta version of AdvancedHMI to avoid seeing those errors.

Otherwise, look at this post: https://www.advancedhmi.com/forum/index.php?topic=2491.msg15019#msg15019
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: nadolnya on August 31, 2023, 09:00:35 AM
Hi,

I have the same problem as description above - messages don't clear correctly. After installation a new MessageListByBit created by Godra and added special code in driver's utilities to avoid ComComponent problem I can use this object but it doesn't work properly.
1. The messages show for all of bits but they don't update automatically. The only way to show another combination of active bits is to set all of them to 0 in PLC and set them again in combination that we want. 
2. The messages show but before, it is necessary to set first bit from 0 to 1 to display messages for another bits.

I'd like to have an automatically list that change in any time when variable value will change and shows me actual messages due to bits that are active without resetting them all before, like typical alarming in HMI.

I use Guardlogix from AB
Variable's name : Alarms1
Data Type : DINT [32bit]

Settings of MessageListByBit in attachment

Really appreciate if someone helps me how to fix it  :-\
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: nadolnya on August 31, 2023, 11:51:42 AM
Another question about 64-integer settings. I'd like to increase the amount of bits for alarms, because 32 is not enough for me. I changed the PLC variable for LINT [64 bits] and it doesn't work completely.

Curious about any possibilites to increase the amount of alarms to amount that I want on list(more than 64).

Settings of MessageListByBit in attachment
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: Godra on September 02, 2023, 11:29:44 AM
This modified control was originally intended for Modbus communication.

If it does not work properly with AB then look at Reply #16 for alternative.
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: Godra on September 02, 2023, 11:46:25 AM
Also check Reply #15 for suggestions related to AB drivers.
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: nadolnya on September 22, 2023, 04:50:09 AM
Hi,

Another question about message alarm. Is it possible to put dynamic text depends on variable from PLC in one message text ? In my program i have a general bit for cylinder's error and another tag [integer] for error code.
Title: Re: Using the control messagelistbybit as an alarm display.
Post by: Godra on September 24, 2023, 02:14:16 PM
Maybe use a separate AHMI control, like a BasicLabel, and point it to that integer tag to get the error code.