LCD menu ?

BTCAD

Active Member
Hi guys, I would like to know if anybody tried to build a lcd menu? I mean something basic like :
 
Pump ---- alarm ----- state
Temp ----- actual temp
Generator ----- alarm   --- state --- control
 
 
Each sub menu should work with a specific part of the code.
 
 
For exemple if I choose ''Generator'' and ''state'' I would like to be able to read the state of the generator, in that case, ''Perfect'' or ''Repair''.
 
For exemple if I choose ''Pump'' and ''alarm'', I would like to be able to read ''Pump is ok'' or ''Alarm Pump''
 
 
I don't know how to start the program and if it's doable.
 
 
Thank you fr any suggestions.
 
 
 
In WC32, you can directly
PRINT1 r PRINT2 to print different strings on line 1 or line2.  You can also have string table to store different strings.
 
Yes I know I have one set at home!! It's a wonderfull product,
 
 
 
How do I call a string from the PLC program?
 
 
I'm looking for a starting code for an lcd menu. I tried different way to do that but nothing work very well. Any ideas?
 
START
TSTEQ KEYUP 1 RAM10
PRINT1 "MENU"
TSTEQ KEYDOWN 1 RAM11
PRINT1 "OPTION"
TSTEQ RAM10 1
CALLSUB MENU
TSTEQ RAM11 1
CALLSUB OPTION

END



MENU:
TSTEQ KEYLEFT 1
PRINT2 "P1"
TSTEQ KEYRIGHT 1
PRINT2 "P2"
TSTEQ KEYDOWN 1 RAM1
TSTEQ RAM1 0
CALLSUB MENU
TSTEQ RAM1 1
CALLSUB START




OPTION:
TSTEQ KEYLEFT 1
PRINT2 "PP1"
TSTEQ KEYRIGHT 1
PRINT2 "PP2"
TSTEQ KEYUP 1 RAM2
TSTEQ RAM2 0
CALLSUB OPTION
TSTEQ RAM2 1
CALLSUB START
 
This is only what i can do. I would like to push the key up and have menu1, menu2, menu3 and push the key down and have option1, option2, option3 etc. Is it possible?
 
START

SET RAM3 1
TSTEQ KEYUP 1 RAM10
PRINT1 "MENU"
TSTEQ KEYDOWN 1 RAM11
PRINT1 "OPTION"
TSTEQ RAM10 1
CALLSUB MENU
TSTEQ RAM11 1
CALLSUB OPTION
END

MENU:
TSTEQ RAM3 1
PRINT2 ""
SET RAM3 0
TSTEQ KEYLEFT 1
PRINT2 "P1"
TSTEQ KEYRIGHT 1
PRINT2 "P2"
TSTEQ KEYDOWN 1 RAM1

TSTEQ RAM1 0
CALLSUB MENU
TSTEQ RAM1 1
CALLSUB START

OPTION:
TSTEQ RAM3 1
PRINT2 ""
SET RAM3 0
TSTEQ KEYLEFT 1
PRINT2 "PP1"
TSTEQ KEYRIGHT 1
PRINT2 "PP2"
TSTEQ KEYUP 1 RAM2

TSTEQ RAM2 0
CALLSUB OPTION
TSTEQ RAM2 1
CALLSUB START
 
In WC32, there is a GUI section allow user to define string table, to store up to 32 strings. 
Then in the PLC program, you can select which string to print, using print1 or print2 command, please refer to WC32 programming guide.
 
When string length is longer than the LCD size, UM216 will automatically scroll it slowly to repeat showing the string.
 
If you want to make a user menu, then you probably in the first line prompt user what action, line2 display that value.
 
You can display character ^ and v hint user for moving up or down on your LCD display.
 
You can display character ^ and v hint user for moving up or down on your LCD display.


can you show me an exemple of this?
 
Yes I got it! But the str2 to 32 do not work, only the str1 work. Did you know this ''bugggg'' ?
 
When I use string table and try to print a string on the lcd, it can't show more that 25 characters. The 26th is a ''/'' like this.
 
Could you please let us know if you saved longer than 26 character in your string, would that display whole string correctly after power off and power on the board?
 
Back
Top