help with commards on lk202-25 serial display

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
ls78
LCD?
Posts: 4
Joined: Fri Oct 31, 2008 9:54 am

help with commards on lk202-25 serial display

Post by ls78 »

hey there .

im trying to send commards ect such as clear to my display from visual basic . i can send text ok . But i cant seem to work out how to use the commard functions. im not sure what the sytax is. Im am confused from the data sheet.


i have been using hyperterm to test things .

please could someone give me an example of sending commards to display via hyperterm ect . or even better a vb snipet .

clear display or turn backlight off and on ect something simple .


any help would be great

cheers .

luke
Ray
Matrix Orbital
Matrix Orbital
Posts: 745
Joined: Thu Dec 13, 2001 4:00 pm
Location: Earth.... I think..
Contact:

Post by Ray »

Are you using vb.net or vb6?
ls78
LCD?
Posts: 4
Joined: Fri Oct 31, 2008 9:54 am

Post by ls78 »

hey thanks for your quick reply .


um i am using visual basic 2008 express .




Code: Select all




   Dim display As SerialPort
        'Creates and opens the serial port.
        display = New SerialPort("COM1", 19200, Parity.None, 8, StopBits.One)
        display.Open()
  
    display.Write("hello")
       
        display.Close()

    End Sub



like i said i can sent txt but it just wraps from row to row .




i just want to work out the commards to

simply clear the display
write to row 2 ect

any ideas ?

cheers luke
Ray
Matrix Orbital
Matrix Orbital
Posts: 745
Joined: Thu Dec 13, 2001 4:00 pm
Location: Earth.... I think..
Contact:

Post by Ray »

Well once you get that far its not that hard, for clear screen for example the manual tells you
6.1.2 Clear display (254 88)
This command clears the display and resets the text insertion point to the top left of the screen.
so the following code should do the trick

Dim ClearScreen As Byte() = {254, 88}
Display.Write(ClearScreen, 0, ClearScreen.Length)
ls78
LCD?
Posts: 4
Joined: Fri Oct 31, 2008 9:54 am

Post by ls78 »

yeah that does work , thanks very much for your help

cheers

luke
ls78
LCD?
Posts: 4
Joined: Fri Oct 31, 2008 9:54 am

Post by ls78 »

theres just one more thing i would like to be able to do ,,,

is it posssible to get the button presses from my lcd panel ?

if so how can i do it with reference to my code i supplied above ?


cheers again .

luke
Ray
Matrix Orbital
Matrix Orbital
Posts: 745
Joined: Thu Dec 13, 2001 4:00 pm
Location: Earth.... I think..
Contact:

Post by Ray »

You would use Display.Read and check the return value to see which key was pressed.
Phutisarn
LCD?
Posts: 4
Joined: Wed Nov 12, 2008 5:41 am

Post by Phutisarn »

Hi all,

I'm new to the Serial port communication. I tried out your coding style with a few adjustments for Visual C++ and it works. Below is my code
array<System::Byte>^ code = {0xFE, 0x46};
this->port->Open();
this->port->Write(code, 0, code->Length);
this->port->Close();
However there seems to be a bit slower compare to MOGD program.
I tried to use portmon to check what is happening.
MOGD# sends 2 lines of data but my program sends at least 10 lines.

Is there any thing wrong with my code? or should I find another way to send data over? Please advise.

Truly appreciated,
Last edited by Phutisarn on Wed Nov 12, 2008 7:14 am, edited 1 time in total.
Ray
Matrix Orbital
Matrix Orbital
Posts: 745
Joined: Thu Dec 13, 2001 4:00 pm
Location: Earth.... I think..
Contact:

Post by Ray »

mogd# is written in C# so is using the same serial port class you are, here's the code that opens the port and sets it up

Code: Select all

_Port = new SerialPort(comPort,speed);		
_Port.Handshake = System.IO.Ports.Handshake.None;
_Port.ReceivedBytesThreshold = 1;
_Port.WriteBufferSize = 16;
_Port.Open();
Phutisarn
LCD?
Posts: 4
Joined: Wed Nov 12, 2008 5:41 am

Post by Phutisarn »

Thank you very much Ray. I will check the code and implement it to my program.

My apology for putting the incorrect information in the previous post. I was using MOGD not the MOGD#. I just found the new version and it seems to have a bit of delay just like my program too.

Is there a significant different between two programs? Please advise.

Thanks again for your quick reply.
Ray
Matrix Orbital
Matrix Orbital
Posts: 745
Joined: Thu Dec 13, 2001 4:00 pm
Location: Earth.... I think..
Contact:

Post by Ray »

MOGD# is a newer version that supports many of our newer displays and upload protocols.
Post Reply