AdvancedHMI Software
General Category => Additional Components => Topic started by: Godra on February 03, 2015, 09:09:50 PM
-
If anyone might find it useful, here is a link to C# version of LED Matrix Control:
http://www.codeproject.com/Articles/62576/A-C-LED-matrix-display
The code provided can be converted into a VB Net code (I used SharpDevelop 4.4), and a few small changes need to be made so the code could work and control created in Visual Studio. Then it can be converted into an AHMI control to get and show values from a PLC.
It is possible to add bunch of new properties and a few subs to make this control interactive in the Design mode.
I can not post a code but could provide directions to those who might be interested.
-
- Download the 3 attached files
- Open AdvancedHMI in Visual Studio
- Right click the PurchasedControls folder in the AdvancedHMIControls project and select Add->Existing Item
- Browse to the files that were downloaded and add them to the project.
NOTE: In order to see the XML file, you must change the filter in the Add File dialog window to show all files
- After adding the XML file, select it in Solution Explorer, then go to the Properties Window
- Change the property BuildAction to Embedded Resource
- Build the Solution and you should then see the LEDMatrix in your Toolbox
-
Hey Archie, I added this and it seems to work ok. What is the difference between the LED Matrix and the LED MAtrixControl? Thanks
-
The LEDMatrixControl is the basic Winforms control, it has no links to a driver and is not integrated into AdvancedHMI. The LEDMatrix can be connected to a driver.
-
Very nice.
Just a minor correction would be to have either "Public Property value As String" with capital "V" in value or to have PLCAddressValue with lower case "v" (this PLCAddressValue appears to be looking specifically for upper case "V"). The same goes for the line "value = "abcdef".
And for those who might like this, keep ScrollEnable at False and add the following code to the end of the LEDMatrixControl.vb, just before "End Class" line:
Private Sub LedMatrixControl_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.MouseHover
ScrollEnable = Not ScrollEnable
End Sub
This way you can have the text start scrolling on MouseHover but will have to do another MouseHover to stop scrolling.
Try not to change the MouseHover to Click event since that might interfere with Keypad popup (unless you are not to use that feature).
Scrolling the text is generally useful for long lines of text that go beyond the size of LEDMatrix display and would kind of imply ScrollDirection = Left.
-
Characters of this control could be improved for better visual appearance. Characters "g j p q , and ;" have additional line added (see the attached file).
It is also possible to insert small logos or pictures with a single character. Check the attached picture (a "^" character was used to show the picture, but any other character could be designated to do the same - and you would never see that character being displayed again // always consider using the least used character for something like this, maybe "~" or "`", since the same xml file will be used by other LEDMatrix controls that you might put on that same form).
For this you would need to modify LedMatrixSymbolFile.xml but still preserve proper formatting, just like it is already.
You could also use ASCII Art Generator, found here http://sourceforge.net/projects/ascgen2/ , and convert some simple pictures by using only 2 characters "#" and "_" since these are used in the mentioned xml file.
The control seems to be designed to handle any number of LED lines that you would include in the xml (the small picture has 22 lines).
Besides for scrolling feature, this control is just a fancy way of displaying something (labels and/or text and picture boxes could do that as well). Still, thank goodness that we have it.
-
Just a minor correction would be to have either "Public Property value As String" with capital "V" in value or to have PLCAddressValue with lower case "v" (this PLCAddressValue appears to be looking specifically for upper case "V"). The same goes for the line "value = "abcdef".
I made the correction and uploaded the file in the previous post. Thanks for catching.
-
You are welcome.
The sooner all the bugs are reported to you, the sooner they will get fixed.
Considering what you've offered to the world for FREE and how fast you work and respond to all the issues, you are definitely allowed to make any mistake.
-
Hi, Archie
I have added 3 files to PurchasedControls, and set BuildAction to Embedded Resource at xml file, but when i rebuild i had some errors.
here i give the attachment.
-
You can correct all errors related to LEDMatrix and that might eliminate the very first error.
Rename CommComponent to ComComponent (one "m").
Rename AdvancedHMIDrivers.IComComponent to MfgControl.AdvancedHMI.Drivers.IComComponent.
-
You can correct all errors related to LEDMatrix and that might eliminate the very first error.
Rename CommComponent to ComComponent (one "m").
Rename AdvancedHMIDrivers.IComComponent to MfgControl.AdvancedHMI.Drivers.IComComponent.
thanks Godra, now it works nicely :)