LCM Module:LCM under Linux

From LEXWiKi

(Difference between revisions)
Jump to: navigation, search
(How to use the DEMO application)
(How to use the DEMO application)
Line 19: Line 19:
== How to use the DEMO application ==
== How to use the DEMO application ==
[[Image:lcmctl.JPG]]<br />
[[Image:lcmctl.JPG]]<br />
-
#Key-in 1 then Key-in message for UP line
+
#COM Port selection
-
#Key-in 2 then Key-in message for LOW line
+
#Confirm COM Port select
-
#Key-in 3 then Key-in message for message Auto-Show<br /><br />
+
#Upline message enter
-
 
+
#Upline message send
-
Notes:We use the number char for line switch ,whereby this DEMO Application doesn't support number char display(0~9)!!<br />
+
#Clear upline
 +
#Lowline message enter
 +
#Lowline message send
 +
#Clear lowline<br /><br />
== Sample code Introduction ==
== Sample code Introduction ==

Revision as of 17:05, 27 April 2009

Contents

LCM Module Spec

LCM Module spec and command list :LCM-Spec

The Sample code source you can download form

Source file: LCM_src_v11.tar.gz

Binary file: LCM_v11.tar.gz

How to Switch functions

Our LCM module can support TTL and RS232 type,Please make sure your serial port support type,
And switch LCM JUMP as below picture!!

Function:
Image:LCM_RS232.JPG

TTL Function:
Image:LCM_TTL.JPG

How to use the DEMO application

Image:lcmctl.JPG

  1. COM Port selection
  2. Confirm COM Port select
  3. Upline message enter
  4. Upline message send
  5. Clear upline
  6. Lowline message enter
  7. Lowline message send
  8. Clear lowline

Sample code Introduction

Open COM Port Device

In Sample code /LCM.cpp lin 25

  portinfo_t portinfo ={
  '0',                         // print prompt after receiving
  9600,                      	// baudrate: 9600
  '8',                         // databit: 8
  '0',                         // debug: off
  '0',                         // echo: off
  '0',                         // flow control:none
  '4',                         // default tty: COM2
  '0',                         // parity: none
  '1',                         // stopbit: 1
   0    	                // reserved
  };
   PortSet(fdcom, &portinfo);
   /*******************init to clear the Screen*******************/
   fdcom = PortOpen(&portinfo); //Open the COM port devices
   PortSend(fdcom, &clrcom, C8); //Clear All screen message

Send the UP line message to LCM Device

In Sample code /LCD_CTLDlg.cpp lin 15 and 58

   char upline[C32]={0x1b,0x51,0x41}; //for LCM UP line command
   gets(message);
   sprintf(upline+3,"%s\r",message);
   PortSend(fdcom, upline, C32); //Send the message to LCM

Send the LOW line message to LCM Device

In Sample code /LCD_CTLDlg.cpp lin 16 and 66

   char lowline[C32]={0x1b,0x51,0x42}; //for LCM LOW line command
   gets(message);
   sprintf(lowline+3,"%s\r",message);
   PortSend(fdcom, lowline, C32); //Send the message to LOW Line

LCM Command list

Please check the page6 in spec file ,you can download form LCM-Spec

Personal tools