LED Matrix Programming in C#

A major part of my job is to manage the processing of 60 some odd external data feeds which are all fairly unique.  These processes drive front end content and is a necessity for our core business.  I am continually asked for statuses of each of these, it was time to display these on a ticker.

I bought a 4U2SEE LED Matrix on eBay for around $150, and much to my surprise it wasn’t difficult to get working with custom code.

4U2SEE LED Matrix Info and Specs:

one_line_sign_options

2.1″ Characters

  • 64 K pf Memory
  • 8 Bit CPU
  • 140 degree viewing angle
  • Standard Aluminum enclosure
  • Indoor Usage Only
  • RS232 or RS485 communication with sign standard
  • Programmable via hand-held remote controller or SIGMA 3000 software
  • Three ways to mount the sign—hanging, side-mounted, and sitting
  • Ethernet communication (Enhanced Version Only)
  • 1024K of Memory (Enhanced Version Only)
  • 32 Bit CPU (Enhanced Version Only)
  • Available in Tricolor only

Taken from: Link: http://www.hyperionsigns.com/modules.php?name=NavSystem&sp_id=100

 

Although this sign does allow for Ethernet communication, I wanted to first write a windows form application to send text over the serial line as a proof of concept.  I tried finding any API information on this sign and/or any advice on how to program it, but LED Matrices tend to be quite unique from brand to brand.  In hopes to get some documentation I emailed the manufacturer and they sent me documentation listing all the HEX values that you could send to this sign and what they did.  The protocol for this sign is called Simplified Jetfile II Protocol v2.4  and the documentation for this protocol can be found here.

I broke down the full array of bytes to send to the sign into chunks: BeginCommand, SizeCommand, ColorCommand, DisplayModeCommand, TextCommand, EndCommand, and a concatenated version of all of these commands:FullCommand.

   1: string BeginCommand = "01-5A-30-30-02-41-42-06-1B-33-62-1C-";
   2: string ColorCommand = mColor;
   3: //colors = 30-37
   4: string SizeCommand = "1A-30"; //30 is size param
   5: string DisplayModeCommand = "0A-49-31"; //0A-49 is text moving -XX is display mode
   6: string TextCommand = mCommandString;
   7: string EndCommand = "03";
   8: string FullCommand = BeginCommand + ColorCommand +SizeCommand+ DisplayModeCommand+TextCommand + EndCommand;
   9: //4A is First Letter
  10: //03 is the last command
  11: //37 is color
  12: /33 is display mode
  13: //construct full command

Now that I had the protocol specifications I had to figure out how to communicate over a serial port using C#. After some research I came up with this code to communicate over the serial line:

   1: public void Init()
   2: {
   3:     sp = new SerialPort();
   4:     sp.BaudRate = 19200;
   5:     sp.DataBits = 8;
   6: }

I needed to send my FullCommand as bytes, so I used NeilCK’s Hex Encoding class

   1: ByteArray = HexEncoding.GetBytes(FullCommand, out discarded);
   2: sp.Open();
   3: sp.Write(ByteArray, 0, ByteArray.Length);
   4: sp.Close();

And that’s it!

Continue reading » · Written on: 08-04-07 · 9 Comments »

9 Responses to “LED Matrix Programming in C#”

  1. Chris Gray wrote:

    This is great, I have been looking for a way to hack this sign for some time now…and wasn’t able to reverse engineer the protocol. Is there any way you could post the entire source? I was unable to get the example above to work. Thanks again!

    May 25th, 2008 at 4:39 pm
  2. konks. wrote:

    Hey Chris, I haven’t run this sign in a while… it’s collecting dust now. I’ll dig through my archives and try to find the code for you. To hold you over until then.. Here is a link to the protocol’s specifications:
    http://www.copyandwaste.com/downloads/SimplifiedJetfileProtocolV2.4 .pdf

    May 26th, 2008 at 6:46 am
  3. Chris Gray wrote:

    Andrew,

    Thanks for the info on the JetFile protocol! I have spent the last week or so trying to reverse engineer the protocol using the companion software package (Sigma 3000) and a port sniffer. It has been a very frustrating experience as I am sure you are also very aware. I am curious as to which tool you were using to read data sent over RS232?

    The sign I am trying to hack is a MVS 780RG (http://uslightingproducts.com/product_detail.php?cid=2&id=49). It appears to be the same (or very similar to) your 4U2SEE so I think I am on the right track here. I attempted to use the code from your post but have had no luck to date (I am sure it is something obvious that I am missing). I was curious as to what value you were sending in the mColor member? From the comments it appears you are sending 37 which would be ‘Mixed colors palette 4’ (according to the protocol spec). I’ll comb the documentation again when I get home…

    Thanks again for your time. You have been a great help!

    Chris

    May 27th, 2008 at 6:11 pm
  4. duy wrote:

    source code led matrix programming

    May 28th, 2008 at 11:37 am
  5. Eric Schuyler wrote:

    I also have one of these signs and have been trying to program it from my own application, without success.

    I have the JetFile protocol spec and have been sending commands that look almost exactly like the code posted, as well as looking at the output from the Sigma 3000 program.
    I used the freeware SHDCom program from http://wshdcom.exor.hr/.

    I noticed that the Sigma program sends and receives lots of data in addition to the command structure documented in the spec.

    Please post any complete working code samples. I’ll let you know if I manage to get my program working.

    Regards,
    Eric

    June 6th, 2008 at 6:29 pm
  6. konks. wrote:

    I lost my original code, but I got my sign working again. It alsow now works for Chris Gray….

    The problem is that when I try to send a “file” to the sign,
    c:\sequent.sys (on the sign) does not
    get updated. So you create a legit file with sigma editor, rename it
    without an extension. Push
    the renamed file with sigma play. This will update the sequent.sys
    file on the sign. Now run my
    program which sends a file named “A” to the sign and it should work.

    Open Sigma Editor:
    ——————
    1) Click new file
    2) enter in “working?”
    3) Save to computer as “A.nmg”
    4) Exit Sigma editor
    5) Rename file to “A” (no extension)

    Open Sigma Player:
    ——————
    6) Click on List Manage
    7) Expand My Play List
    8) Select all files in the right hand pane and delete them
    9) Click the add button and find the “A” file in step 5
    10) Send to sign

    Compile my program (CinderSerial)
    ———————————
    1) Type in text you want to be displayed
    2) Select a color
    3) (display mode isnt implemented yet)
    4) Click submit

    You can download my code sample at Cinder Serial

    June 14th, 2008 at 7:10 pm
  7. konks. wrote:

    I have revisited the 4U2See sign and got it working (somewhat hackishly).

    http://www.copyandwaste.com/archive/2008/06/14/4u2see-led-sign-revisited.aspx

    Try it out and tell me how it goes.

    June 14th, 2008 at 8:25 pm
  8. tartag wrote:

    Real interested in following these developments if any keep ‘em comin’!

    June 19th, 2008 at 9:57 pm
  9. Jason Boucher wrote:

    Good Evening, I recently aquired a MVS780RG sign. I wanted to program the sign from my computer but had a few quetions. First, Where can I aquire the Sigma Editor software in which you guys were talking about, if somewould would be wiling to contact me to help me out jboucher@primustel.ca i would really appreacate it. Also I was thinking of useing RS232 to connect to the sign, does anyone have a pinout of the correct cable to use for this.

    And my last question, there are jumpers on the back of my sign, one that says RS232, One that says Modem, and one that says 422

    I am guessing these are other ways to communicate to the device, which is best to use, and how can i tell if it has the ability to be programed through Ethernet?

    Thank You.

    December 12th, 2008 at 11:43 am

Leave a Reply