Author Topic: LED Matrix Control  (Read 7856 times)

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
LED Matrix Control
« 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.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5261
    • View Profile
    • AdvancedHMI
Modified Version for AdvancedHMI
« Reply #1 on: February 07, 2015, 06:58:37 PM »
- 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
« Last Edit: February 08, 2015, 09:54:55 PM by Archie »

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: LED Matrix Control
« Reply #2 on: February 07, 2015, 07:34:41 PM »
Hey Archie, I added this and it seems to work ok.  What is the difference between the LED Matrix and the LED MAtrixControl?  Thanks 

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5261
    • View Profile
    • AdvancedHMI
Re: LED Matrix Control
« Reply #3 on: February 07, 2015, 08:04:35 PM »
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.

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: LED Matrix Control
« Reply #4 on: February 07, 2015, 09:56:51 PM »
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:

Code: [Select]
    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.
« Last Edit: February 07, 2015, 11:45:04 PM by Godra »

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: LED Matrix Control
« Reply #5 on: February 08, 2015, 09:41:32 PM »
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.
« Last Edit: June 22, 2020, 12:00:12 AM by Godra »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5261
    • View Profile
    • AdvancedHMI
Re: LED Matrix Control
« Reply #6 on: February 08, 2015, 09:56:36 PM »
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.

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: LED Matrix Control
« Reply #7 on: February 08, 2015, 10:40:16 PM »
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.

honeydrop

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: LED Matrix Control
« Reply #8 on: November 27, 2016, 11:28:08 PM »
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.

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: LED Matrix Control
« Reply #9 on: November 27, 2016, 11:43:55 PM »
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.

honeydrop

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: LED Matrix Control
« Reply #10 on: November 28, 2016, 11:32:15 PM »
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 :)