08-07-2008 01:58 PM
I have a dos application that I am trying to control with keybd_event. I have executed and operated external applications in a loop in the past but I cannot seem to pass any keys to this particular application. Attached are the vi and the executable. You will have to change the working and exe path to see an example of my problem. Any assistance is greatly appreciated.
08-07-2008 04:03 PM
08-07-2008 04:53 PM
What I have is approximately 9000 binary files in the bin_to_txt folder. The vi opens the dos application (BBlist.exe) and sends each of the 9000 file names to the dos application in sequence by sending keyboard strokes.
For example, if you were to manually open the BBList program the first thing it asks for is the file name. Therefore, the vi enters the file name one letter at a time as if you were doing so from the keyboard. The outer loop runs once for every file, the inner loop runs once for every keyboard stroke.
1. To test the program put BBLIST in your root folder c:
2. Make a dummy folder called bin_to_text in your root folder c:\bin_to_text\
3. Save a text file of any name you like and put it in the bin_to_text folder
4. Run the VI.
The VI should open BBList but nothing else will happen. If it were to work as intended you would see the text file name in the input field.
The way the vi works is by passing keystrokes to the active application which is the BBList at the time. To check if the keystrokes are working just maximise a text document right after BBlist opens. The text document will be the active application and you will see the name of the text file you created typed out.
Thanks for the reply, I didn't think this would get any attention.
08-07-2008 10:02 PM
08-08-2008 08:32 AM
Mike,
I have looked into that route and I am working on a solution with Teledyne. BBBATCH does not work correctly. They have recomended an alternative that I'm looking into.
08-08-2008 09:27 AM
08-08-2008 10:09 AM
smercurio,
I get an error on the "automation open". Are you able to pass a string to the application?
The three backspaces are not required. Hit any letter and it overwrites the default *.* . The keys you see in the cluster array are random. I stopped at that point because it was obviously not working correctly.
08-08-2008 10:30 AM
08-08-2008 10:42 AM - edited 08-08-2008 10:44 AM
Just a thought, i may be missing the point completely
Is it possible to get LabVIEW to write a text file of the commands you want to send. Then save this file as a batch file. Then run this file under system exec. This way you could do all the listings of files etc under LabVIEW and use system exec to run the command. for each different file LabVIEW will autogenerate a new Batch file and run it again.
Craig
08-08-2008 11:23 AM