LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read data from a PS2 port (keyboard)

Solved!
Go to solution

I am currently trying to utilize a barcode scanner that is connected via a ps2 port. It works similarly to a keyboard.

 

However, i have a problem taking signals from a ps2 port, as i do not know any function that could do that in LabVIEW.

 

Please advice.

 

Thanks a lot guys.

 

Cheers,
Justin

0 Kudos
Message 1 of 8
(6,040 Views)

Open LabVIEW and navigate to Help >> Find Examples.  Then search for "parallel", and you will find two examples: Parallel Port Read and Write Loop.vi and Parallel Port Additional Data Register Inputs.vi.

 

Try that and see if it works for you.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Message 2 of 8
(6,023 Views)

Easy way : A String Control  , however the control need the focus

More sophisticated: the keyboard vis located at connectivity-input devices

 

How to know was this a keyboard or a scanner input ??? 

Most scanner can be configured to send some pre- and post-codes (liker termination characters). So you 'only' have to configure your scanner and write an filter that catch the scanner inputs.

 

It is good practice to filter and PROOF the input, since most scanners accept a lot of codes, so (like always) you have to expect the worst.

If this string goes to a database : code injection via barcode strings is a proofed concept Smiley Surprised

 

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 3 of 8
(6,015 Views)

Dear Adnan,

 

Thanks for your advice. However, i am not sure if a PS2 port can be read in similar fashion as the Parallel port as mentioned. Are they both the same?

 

Please advice. And thanks again for the suggestions.

 

Cheers,

Justin

0 Kudos
Message 4 of 8
(6,008 Views)

You have functions to read the keyboard in the functions pallette.  navigate to connectivity>>input device control and here you will find the vi's specific to key board.  But how does the system distinguish between barcode reader in PS/2 and keyboard.  Does they both use same protocol for data transmission.

 

Give a try and post back for queries.

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 5 of 8
(5,999 Views)

Dear Henrik,

 

Do you know of any keyboard emulators around? Btw, is there any software that can help configure the scanner pre- and post- codes? Atm, i know that the scanner has a default "/n" or "enter" post code, that can be helpful.

 

Please advice.

 

Thanks for your kind assistance and your time.

 

Cheers,

Justin

0 Kudos
Message 6 of 8
(5,984 Views)

Hey there JK1,

 

Thanks for your input.

 

Anyway, do you know of any methods of how to utlize the "prompt user for input" dialog function to close with the "enter" key. This is because, the scanner works like this:

 

*scan*

the barcode is to be scanned is numbered 12345678

*beep*

 

the scanner will emulate the keystoke of a keyboard "12345678(followed by the enter key)" or "012345678/n"

 

*in a text doc* -> it will if you scan 2 barcodes in sequence tagID is 111 and 112 respectively

111

112

(take note that there is an line spacing which emulates the "enter" key at the end of the scan; the default config of the scanner)

 

thus, if i use the the dialog function, i would require the use of the mouse or an additional keystroke "tab" inbetween the scanned numbers and the "enter" or "/n" to close the dialog box.

 

Is there any way to automate this  "prompt user input" dialog to close automatically given the scanner ends with the "enter" key?

 

Thanks for the advice.

 

Cheers,

Justin

 

 

0 Kudos
Message 7 of 8
(5,974 Views)
Solution
Accepted by topic author Justin Lim

quick shot , add a manual cancel function, appearance, dialog option, ...

 

Message Edited by Henrik Volkers on 04-06-2009 12:10 PM
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Download All
Message 8 of 8
(5,965 Views)