Axcent3 programming - akeyb and akeyp
electro
Posts: 15
Hi folks,
I'd like to be able to retrieve mainly text, entered on a touch panel using the on screen keyboard, does anyone have any ideas on how to achieve this in the Axcent code?
Many, many thanks in advance!
-Dave
I'd like to be able to retrieve mainly text, entered on a touch panel using the on screen keyboard, does anyone have any ideas on how to achieve this in the Axcent code?
Many, many thanks in advance!
-Dave
0
Comments
DEFINE_DEVICE
dvPANEL = 128
DEFINE_VARIABLE
PANELBUFFER[255]
DEFINE_START
CREATE_BUFFER nPANEL,PANELBUFFER
DUMP[50]
DEFINE_PROGRAM
IF(LENGTH_STRING(PANELBUFFER))
{
SELECT
{
ACTIVE(FIND_STRING(PANELBUFFER," 'KEYB-' ",1)):
{
DUMP = REMOVE_STRING(PANELBUFFER," 'KEYB-' ",1)
(* now PANELBUFFER has your Keyboard Text *)
}
ACTIVE(FIND_STRING(PANELBUFFER," 'KEYP-' ",1)):
{
DUMP = REMOVE_STRING(PANELBUFFER," 'KEYP-' ",1)
(* now PANELBUFFER has your keypad String *)
}
ACTIVE(1): // any other String from panel
{
}
PANELBUFFER = ''
}
}
Should work, but no panel and master on my desk to check at the moment....
Regards,
A few notes, device 129 is an AXP-T/S EL panel.
I moved the 'DUMP[50]' statememt up into the Define_Variable section, but I also left it in the Define_start section where it didn't seem to error.
'Send_String HOSTPC,PANELBUFFER' was me trying to get the keyboard text entered, to be send out through the first RS-232 port (HOSTPC).
I had to change the // quotes to (*quote*) format.
I had to modify the final 'PANELBUFFER = '' command as the compiler said that an ACTIVE statemenet should be before it.
As you might of guessed I am fairly new to this language, but feel free to look at my changes and see what I've coded wrong
Many thanks again for your help!!
We've assigned what was panelbuffer to DUMP, therefore you want to send DUMP to the rs232 port.
Kevin D.
Actually, from what I see, KEYP- and anything the preceeds it would be assigned to DUMP and PANELBUFFER would contain the text that was entered, so SEND_STRING HOSTPC, PANELBUFFER should work.
One thing I would do is eliminate the sending of the string to the 232 port until you have verified that the rest of your code is working, unless you have already verified that SEND_STRING HOSTPC, WHATEVER is actually communicating.
Here is something that should show you what is happening. I keep getting an eval error when I try to compile, so I apologize. If you can figure out what I did to upset the axcent gods, the logic should work. You will need to create 2 variable text buttons on you touchpanel, but this will give you instant feedback on the touchpanel to see what is happening:
Hope something here helps.
Jeff
Doh.. Sure wish I knew what I was reading last night..
Kevin D.
Cheers!
-Dave
Thanks for all the help!
-Dave
Hello i have another problem,i want to take some commands from rs 232 port of axcent3 and just send it in different way from another rs232 device...Is this possible in axcent..I saw part of code below.can i use like this?Its easy for me in netlinx but i havent done with axcent controller yet.So i need some help.I hope you understand my duty.
Want to take reply from one rs232 port.Comment it somehow with find and remove strings..after this send it to another rs232 port...Can anyone help me please?
OK, just to be clear....you are taking replies from a serial device on port 1, then saving and manipulating that devices replies and then sending the new manipulated string to another serial device on port 2....correct?
If so, then yes, that is very possible. you'd need to create a buffer for your device on port 1 and use find_string and other buffer processing commands. Save the desired strings to a variable or several variables then add whatever you want to it, then send it out port 2.
In DEFINE_START
CREATE_BUFFER dvPORT1,PORT1_BUFF
In DEFINE_PROGRAM
IF(LENGTH_STRING(PORT1_BUFF))
{
SEND_STRING dvPORT2,"PORT1_BUFF"
CLEAR_BUFFER PORT1_BUFF
}
That is a valid Axcent command, but I have never used it and I am not sure if it is used for sending or receiving strings or both. If it works great!
From Axcess help file
The REDIRECT_STRING(entry#,dev1,dev2) function will pass all strings from dev1 to dev2, and all strings from dev2 to dev1. Entry# specifies which of the 8 possible redirections.
Examples:
REDIRECT_STRING(1,RS232_1,RS232_2)
Enables passing of strings from device RS232_1 to RS232_2.
REDIRECT_STRING(1,0,0)
Disables passing of strings from device RS232_1 to RS232_2.