Getting Keyboard code output via the USB or serial
Moderators: chiark

Jump to page : 1
Now viewing page 1 [15 messages per page]

Forums · Technical Support · Windows CE 4.x .net

xcode
Posted 2009-08-25 2:49 AM
#
H/PC Newbie




Posts:
5
Member Nº:
11596
Location:
United States
Status:
I have a project that requires the OUTPUT code of a keyboard stroke to be sent out the USB port of a Tablet PC. If it cannot be done with a simple app running as a virtual keyboard on a Windows XP device, then I have a touchscreen device with Windows CE on it.

Is there a way to get virtual on screen keyboard output to the USB or Serial port?

Think Tablet PC with the virtual keyboard. Push the letter K and that code to cause an K on screen goes to the USB port and into a controller just like what a normal keyboard would attach to.

What I have is a CNC mill with a keyboard. I want to replace with keyboard with a Tablet PC and bring up a graphical virtual keyboard and use this to control the CNC mill. The Tablet PC however only has a USB port, but I can attach a serial IOgear device to this maybe and get my 4 wires for the keyboard code.. that is what I am thinking anyway.

OR,

I have a HMI LCD touchscreen panel. This is a Pro-Face device and it runs on Windows CE, and it has a serial port on it. Can a program be launched on it to output virtual keyboard strokes?
 Top of the page
Rich Hawley
Posted 2009-08-25 9:46 AM
#

Global Moderator
H/PC Guru

50001000
+ Subscriber


Posts:
6020
Member Nº:
122
Location:
USA
Status:
Many terminal emulators on the CE device direct the output to the serial port by default. You can use an onscreen keyboard to do the same. Most of the programs written way back then didn't direct the output to a USB port, because most devices didn't have a USB port back then. But perhaps some of them do...you would just have to load them up and give them all a try until you found one that did. It would be very easy to check with a null modem cable hooked up to another computer running a dumb terminal program. It should easily echo the character received...
 Top of the page
takwu
Posted 2009-08-25 1:06 PM
#

H/PC Elder

1000500100100100252525


Posts:
1895
Member Nº:
44
Location:
BC, Canada
Status:
Wow I would never have imagined trying to do this... Replace a keyboard with a Tablet PC? May I ask why...

Well to achieve this, first you'll need the hardware, not software. You cannot directly connect a USB host port to your mill's keyboard port, whatever format it is.

Now what kind of keyboard port is it? If it's something simple, you can get a USB to Serial Adapter (RS-232) for your Tablet PC and then, mmm, wire it up.

If that hardware is all setup, then you can think software. You probably want to write your own software to display a custom virtual keyboard in Windows that sends keyboard signals thru the Serial Port. It's probably easier than trying to capture the output of the standard virtual keyboard.

I didn't have much to go on but I hope it makes sense?

Edited by takwu 2009-08-25 1:07 PM
 Top of the page
xcode
Posted 2009-08-25 3:03 PM
#
H/PC Newbie




Posts:
5
Member Nº:
11596
Location:
United States
Status:
Yes, it all makes sense.. as I have already thought of this same thing..

I have 3 Motion Computing Tablet PC's today. 2 of them are on Windows 7...

My CNC mill is old ( 1993 ) and it requires the Tablet PC ( or any PC really ) to DNC the program to the machine to engrave. The files are just toooooo big for the amount of memory on the machine.

Now get this... this mill is running on a 286 intel chipset. The memory upgrade available is a whole 184k at a cost of $500... jump up to 384k, and it is $1000.... Just some special board with connectors which are not SIMM DIMM in and any way or fashion. It is just a common computer that boots with its propitiatory software base, and waits on keyboard input.

The keyboard is a plain A-Z with about 6 other buttons for coolant on and off, spindle on and off. Once I know this is do-able, I will track down what keystroke character is the 'other' labeled buttons. I am guessing something like F1-F9 on a regular keyboard.

I have replace this keyboard once, so I have one I can experiment with and take apart. I will try to connect it to an older PC with a PS2 port and see what characters out put with the keystrokes.

So, there is not an API or DLL that can port the commands of a keystroke out the USB or serial port of a computer? My Motion Computing tablets have USB only, but I have the IOGear serial converter and it works great with my DNC. So, I would think that once I find a program that can output keystrokes to a comm port ( USB or serial ) surely it is just passing the Scan Codes from the keyboard as outlined here > http://www.computer-engineering.org/ps2keyboard/scancodes2.html

thanks for any help and direction..
 Top of the page
hmascience
Posted 2009-08-25 5:33 PM
#
H/PC Philosopher

10010010010025


Posts:
444
Member Nº:
1883
Location:
United States
Status:
It might be easier to get a robotic arm (it doesn't have to be fancy since the keyboard is fixed and probably flat). Not very elegant, but it might be faster and cheaper...
 Top of the page
hmascience
Posted 2009-08-25 5:42 PM
#
H/PC Philosopher

10010010010025


Posts:
444
Member Nº:
1883
Location:
United States
Status:
Duh, while I was thinking of inelegant but easy retrofits, I forgot to mention the Alphasmart and its brethren. They are designed (partly) for special needs educational use, but work well as standalone word processors. Think updated Tandy Model 100 computer. The beauty part is that when they were plugged into a host computer via USB, the host identified them as a keyboard. You then pressed the appropriate key(s) on the Alphasmart and the host computer (your CNC in this case) gets a stream of output from the most, err, consistent typist it's ever had (sorry, I was always vaguely amused by the mental picture of a computer used to the stop and go typing of humans being surprised by a continuous 40 thousand character string...)
 Top of the page
takwu
Posted 2009-08-25 7:19 PM
#

H/PC Elder

1000500100100100252525


Posts:
1895
Member Nº:
44
Location:
BC, Canada
Status:
So let me get this straight... The reason you want to do this is because the file you want to upload to the CNC mill is too large for its memory. And that would be because your model is so complex it would require a huge amount of commands to engrave.

Is it possible to simply split the process up? I mean like do the engraving in stages. So the result of the first stage becomes the starting point of the next. When each stage is done, you upload the programming of the next stage. I hope this can work, which would be a somewhat more elegant solution

Those prices for the memory are outrageous But then again they charge that much because they can. IIRC these machines cost tens of thousands of dollars?

hmascience, the CNC is controlled by a 286. USB wasn't available until the Pentium era.
 Top of the page
hmascience
Posted 2009-08-25 8:55 PM
#
H/PC Philosopher

10010010010025


Posts:
444
Member Nº:
1883
Location:
United States
Status:
@takwu - thanks for the clarification. I didn't pay attention to the plumbing order (modern computer -> USB -> RS232 -> CNC) and was just thinking null modem/dumb terminal-ish thoughts.

@xcode - does "the Mule" work for this (http://www.barcodeman.com/altek/mule/). I think it does; they have a simulator page where they demonstrate a virtual keyboard, an output window with scan codes, so they have collected all the "right" pieces. Their hardware widget (the Mule) appears to be a interface box driven by that software. I think you'd have this chain: modern computer -> USB -> Mule -> RS232 -> CNC (if the CNC used a RS232 keyboard or was able to accept commands via serial port ?!?)

HTH
 Top of the page
xcode
Posted 2009-08-25 11:36 PM
#
H/PC Newbie




Posts:
5
Member Nº:
11596
Location:
United States
Status:
Hi all... thank you for the replies and some direction. The Mule kind of sounds perfect.. BUT, according to the website, the hardware interface device is no longer available... can you believe that.

Let me clarify the operation of the DNC. I dont stand there and type in the code for engraving. It is a very long amount of lines ( like 5000 lines ) of code to do even a simple word like ' I WAS HERE " .. So, the program resides on the tablet PC and outputs via a DNC piece of software to the serial port of the CNC mill... all this runs 100% fine. My project direction is to remove the existing push button keyboard and replace it with something more modern and multi functional. The tablet PC because it has to be there for the DNC of the program needing to be run. The tablet PC already has the virtual keyboard built in. I am also using Inkseine note pad. I can draw my thoughts and vise offsets on this so I dont forget my setups on the parts I make. SOOO getting the tablet PC integrated would be great, and replace that ugly and broken key input device on there now.

I think I have found another company with a device like the Mule... http://www.vetra.com/Encoder2.htm

Edited by xcode 2009-08-25 11:43 PM
 Top of the page
takwu
Posted 2009-08-26 12:54 PM
#

H/PC Elder

1000500100100100252525


Posts:
1895
Member Nº:
44
Location:
BC, Canada
Status:
Ok, so this project is not really a "need", but more like a "want"? Because everything is working, it's only that you want to get rid of the keyboard (because it's old and ugly). Now you still need to use the keyboard to start things or whatever after you upload the programs from the Tablet PC, right?

First just figure out if the keyboard port on the CNC is the old PC/AT style (likely), if so you just need an adapter to make it compatible with PS/2 keyboards. Then you can use whatever PS/2 keyboard you want with it

If I were you I'd be pretty satisfied with a brand spanking new keyboard. However, if you still want to emulate a keyboard with the tablet instead, then yes the Mule sounds like what you want. The Vectra ones can be made to work, but they really are designed to convert switches (not Serial port commands), meaning you need yet another converter from Tablet to the Vectra device.

Either way you'll need a software specifically designed to send commands thru the RS-232 port.

The Virtual Keyboard in your Tablet PC does not generate hardware keyboard scan codes. It simply generates (software) key press messages in Windows directly.
 Top of the page
xcode
Posted 2009-08-26 5:29 PM
#
H/PC Newbie




Posts:
5
Member Nº:
11596
Location:
United States
Status:
Its a 'need' when the keyboard is a piece of junk on the machine today and it cost $600 to replace. I figure instead of replacing it with a 1988 technology keyboard, I would upgrade it to something a bit more modern. Touch Screen is my target goal, but the Tablet PC is a better choice because I have to use it for programming the machine.

I purchased this device today http://www.l3sys.com/keyat/index.html .. it appears to be even better than the 'mule' was presented.

Now I am faced with exactly why I came here to these forums. I need a virtual keyboard that outputs commands to a serial port.

However, 2nd choice is a Pro-Face LCD display that is fully programmable and outputs ASCII via the serial port it has on board. Cost is a little higher going this way however.

So, why here on these forums? Because there is a ARM9 project kit http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=110372732456&ssP...
that runs Windows CE. If the Tablet PC cannot have a virtual keyboard that outputs via the serial port, can windows CE have a virtual keyboard that outputs the serial port..

So, now that I have my interface purchased that can do serial to keyboard scancodes, can I get a virtual keyboard on my Tablet PC that outputs commands to the serial port? IF NOT, can I get a Windows CE virtual keyboard that outputs the serial port? IF NOT, then I need to buy the Pro-face http://www.profaceamerica.com/cms/resource_library/products/99927d8...

thanks..
 Top of the page
takwu
Posted 2009-08-27 2:38 PM
#

H/PC Elder

1000500100100100252525


Posts:
1895
Member Nº:
44
Location:
BC, Canada
Status:
Any PS/2 keyboard should work, so you don't need to spend $600 to replace it. More like $10?

As for the Virtual Keyboard thing... Now that you found the KeyAT device, Rich's idea might work. I am not too sure about this... If you setup a modem at the serial port, you can send ASCII characters to it using simple programs. So whatever you "type" on your Tablet becomes keys in the modem interface program, which sends ASCII codes to the serial port, which is connected to the KeyAT, which translate it to keyboard scan codes and send over to the keyboard port on your CNC...

As you can tell, that's a lot of things connected to something they aren't designed to connect to...

What I suggest is to email L3 Systems (the KeyAT maker) and ask if they know how to do this. You can even direct them to this thread so they get more info. I just read some questions on their support page and someone said it works fine with Hyperterminal. It's likely that they can figure it out.

Good luck!

P.S. One last bit of advise: try a standard PS/2 keyboard (not the $600 original) on your CNC anyway, just to make sure it works before trying the KeyAT.
 Top of the page
xcode
Posted 2009-08-27 3:01 PM
#
H/PC Newbie




Posts:
5
Member Nº:
11596
Location:
United States
Status:
Takwu,

Thank you for your help and direction... Yes, I know i can put a $10 PS2 keyboard on the CNC mill.. however, the OEM keyboard has Coolant ON, Spindle on, Single step, Manual, and about 10 more special labeled buttons. That could equal F1-F10 for all I know right now today, and it might be some special character set.

I will get the old CNC mill keyboard and attach it to a 386 computer i have. then I have read there is a emulator program that will feed back what is coming in on the keyboard port so I can tell what these special keys are.

Now, I dont think I need a modem.

I have already talk with L3 systems engineer. The interface and cabling is all I need. It will go like this...

Tablet PC ( host ) connect to USB to serial converter ( IOGear ) connect to KeyAT converter connect to PS2 port on target computer.

now, the PS2 I have to create on the target computer. I have another input board on order today to play with so I dont kill my mill while I work on this project. Money is not the problem with buying a OEM Fadal keyboard, its just I want to do something different and move to some cool tool touch screen stuff.

the problem to overcome at this time is the virtual keyboard. There are 50 plus special apps online for building a virtual keyboard. NOT a one indicates that the output keystrokes can go over the serial port of a computer. See, my Tablet PC only has the USB and I am using the IOGear Serial port converter, so a Com1 will show up in the hardware aspect of the tablet PC. Getting something to talk to this besides Hyperterm is the issue now. I know hyperterm will work, I need a virtual custom build keyboard to work now.
 Top of the page
takwu
Posted 2009-08-27 7:17 PM
#

H/PC Elder

1000500100100100252525


Posts:
1895
Member Nº:
44
Location:
BC, Canada
Status:
Everything sounds good.

Yeah as soon as you figure out what those "special keys" are equivalent to on a standard keyboard, you will be set

If the standard keyboard has all the special keys you need, you don't need special software. Just use the Tablet's Virtual Keyboard to "type" in Hyperterminal. It should work just like a real PS/2 keyboard connected to the mill.
 Top of the page
hpc:factor« View previous thread · Windows CE 4.x .net · View next thread »

Jump to page : 1
Now viewing page 1 [15 messages per page]

Jump to forum :
Search this forum
Printer friendly version
E-mail a link to this thread
Seconds to generate: 0.171 - Cached queries : 67 - Executed queries : 10
Server Time now is: Wednesday, 23 April 2014 - 9:43