LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using labview to control a pc via keyboard

Hi,

 

I know this may sound a bit odd but i had a discussion with a college who wants to automate the setting up of a computer bios.  i am looking at this to see if it can be done using labview.  i am only looking to use the keyboard to send scripted ascii codes to the PC under test so if done in the correct order will configure the bios how we need it. 

 

i am saying this can't be done because to connect one pc to another via usb they won't see each other as a keyboard unless labview can emulate this. can it?

 

i am interested in your thoughts.

 

0 Kudos
Message 1 of 13
(3,213 Views)

I am not sure how well that would work, one slight change in the BIOS and you need to write a new script...

 

Anyway this and this should tell you everything you need to know.

========================
=== Engineer Ambiguously ===
========================
Message 2 of 13
(3,196 Views)

+1 kudos from my for RTSLVU's answer, I'd do the same. Instead of simulating a USB keyboard I'd rather simulate a PS/2 one.

 

Here is some more information about the physical protocol layer: PS/2 Keyboard and Mouse Protocol. This pdf was linked in this thread which has some more information.

 

Depending on what exactly you want to achieve and what your expertise on programming vs. electronics is, you could of course also open up an old keyboard and solder relays to the keys you need. That is not generating the signal you need via generating the signal itself, but by simulating the keypresses...

 

And there is of course another possibility: If the remote computer allows terminal emulation (like VT100) or has a full remote access features (like hp's iLo or Dell's DRAC), you could use these as well.


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
0 Kudos
Message 3 of 13
(3,147 Views)

A direct PC to PC connection via USB, and having one PC simulate being a keyboard won't work at a hardware level. The USB interface on a PC is normally connected to a host controller, whereas a keyboard is a USB device. LabVIEW won't be able to help.

 

One solution for automated keyboard scripting is to use a Teensy dev board. It includes a USB stack capable of emulating a keyboard (and mouse/joystick). It could be programmed to playback a series of keyboard presses when a digital line is triggered, or act as a relay from a PC (running LabVIEW) to receive keypress commands via UART, and write them out as key presses.




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
Message 4 of 13
(3,140 Views)

Thanks MichaelBalzer this is exactly what i was thinking, the PC under test/config  would have to see the controlling PC as a HID device which it cant.  i was also thinking along the lines of having an interface between the 2 i will check out the Teensy or similar devices i am sure this would work.

 

The PC that needs controlling is USB only there are no PS2 ports (isn't this a bit old now).   

0 Kudos
Message 5 of 13
(3,120 Views)

Arduino seems to be able to do it too:

https://www.arduino.cc/reference/en/language/functions/usb/keyboard/

 

Sounds like a lot of fun. You could even program the Arduino to send stuff at a press of a button. Once programmed, you don't even need the "master" PC to be connected anymore. That would give you a portable bios programmer...

Message 6 of 13
(3,098 Views)

 


wiebe@CARYA wrote:

Arduino seems to be able to do it too:

https://www.arduino.cc/reference/en/language/functions/usb/keyboard/


Thanks anyway but i have just found this myself. 

0 Kudos
Message 7 of 13
(3,095 Views)
0 Kudos
Message 9 of 13
(3,090 Views)

wiebe@CARYA wrote:

BTW.

PS2 should not be a problem.


Be careful with these, you might have a wrong expectation what they do. The cheap, passive adapters just physically connect lines. They do not adapt the protocol used.

 

They work only when you have e.g. a keyboard or mouse that supports both PS/2 and USB.


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
0 Kudos
Message 10 of 13
(3,081 Views)