Storing akeyp data
troberts
Posts: 228
Hello All,
Just wondering if there is a way to store, in a netlinx processor, the keys entered from either a akeyp or akeyb?
In other words, without having to create my own keyboard and channel numberts, if I type the numbers 1234 on the internal keypad of either a TP3 or TP4 touchpanel can I see, on my processor that someone just typed 1234?
Thanks,
Tim
Just wondering if there is a way to store, in a netlinx processor, the keys entered from either a akeyp or akeyb?
In other words, without having to create my own keyboard and channel numberts, if I type the numbers 1234 on the internal keypad of either a TP3 or TP4 touchpanel can I see, on my processor that someone just typed 1234?
Thanks,
Tim
0
Comments
Yes, the user results from AKEYP or AKEYB entries can be trapped with the STRING handler of the DATA_EVENT for the TP and it can be read in with DATA.TEXT.
Data from the touch panel that is generated from a keypad entry will start with ?KEYP-?
Data from the touch panel this is generated from a keyboard entry will start with ?KEYB-?
For example:
I hope this gets you started in the right direction.
Joe
And to add to Joe's posting, you can initialize the keypad or keyboard with a unique string that will also be returned to you in the DATA_EVENT STRING handler. This can be useful for determining which keypad or keyboard popup was used if you use multiple keypads or keyboards in your TP files and Netlinx programs.
For example,
will generate STRINGs that start with 'AKEYP-ONE' and this can be used in your STRING handler parser to determine which keypad/keyboard was used and then what you want to do with the data.
Joe
1) copy a keypad/keyboard popup page from the panel template into your panelfile
-> keep in mind that this is a popup page now; if necessary to open from the master, use like SEND_COMMAND PANEL,'@PPN-MYKEYPAD'
2) in TPD4, on this popup, mark the textfield and have a look at its general properties
3) the NAME is the keyword which is sent from the panel into the master when DONE is pressed on the keypad popup. Rename the button like you want
Is there a way that i can cause the AKEYB to report it's information on Modero Port 14 instead of 1. I need the data on port 14. Is this possible without redirecting the string with netlinx code?
No, this is a limitation in firmware. The keypad/keyboard responses will only come on port 1. But if you rename the textfield like described before, you can differ by name from where the data was sent. And because port 14 must also be only if port 1 is online, it should not be a problem but only if you work with the port 14 within a module or similar.
If you use the same code in your module, you shouldn't have any issues. You could also add timeouts to the call that would close the keyboard and reset the nCURRENT_OP variable to zero after 30 seconds or whatever.
Jeff
In the line,
DATA_EVENT[dvPanelReal.Number:1:0]
If dvPanelReal was defined as 10001:14:1 would the DATA_EVENT above really occur for device 10001:1:1? If so, THAT"S AWESOME! I've never seen that before, That's totally COOol! What if device 10001:1:1 wasn't even defined anywhere in the code (inside or outside the mod), would this event still work?
Wow, i feel like i'm a serious pro every now and then; but then somehow, i end up learning something totally new to me. If the above DATA_EVENT works, that's coolness man. FINESSE, i tell ya!
Anyway, can't wait to get a response.
Alex
Works pretty fine :eek:
Port 1 of a device is always available. So in our module, we just pick the Device number from the outside panel, and use it to pick up any strings from its port 1. It doesn't matter if I'm using device names or if I'm working with the device structure.
Yeah, it's cool
Find attached an working example and have fun!
OK, that's corrent.
But if we modify the module in the way it should work some more flexible.....
But, of course, we need a correct setup of the M2M network.
What if the real device of the module. the dvRealPanel = 10001:14:1, wasn't defined as 10001:14:1 and wasn't real, but instead was a virtual device combined with many other devices. For Example.
vdvThePanel = 36001:1:1
COMBINE_DEVICES(vdvThePanel , 10001:14:1, 10002:14:1, 10003:14:1)
DEFINE_MODULE 'TheAKeybCatcher' inst1(vdvThePanel.....
Once vdvThePanel is passed to the module, is there no way to get the port 1 akeyb data from each panel combined in the vdvThePanel?
But - if on the first panel is a textbox named KEYB_P1- and on the second panel a textbox is named KEYB_P2-, you'll get different strings thru the virtual device.....
Hi all,
I've worked around this by just building a keyboard. What I do is open the System Project properties and just copy the internal keyboard. Then I paste it into the touchpanel file as pop-up. First I change all the STRING port numbers to my desired port say 14. Then I go to each individual button and assign the string output. First time I did this was a Kaliedescape server so my string output was like "KSCAPE_KBD-a". That string is then sent out to the port 14 via the button press. Then I just parse the DATA.TEXT in the STRING: handler. Yet another way to accomplish the same thing....gotta love code.