06-18-2007 02:35 AM
Hi
I would like to know how to change the location of the cursor in a string array.
I am using a bar code reader. I used Key Focus so that my 2D array will be selected. However, what I want to do is to input the 1st bar code from my bar code reader in (row 0, column 0) and press enter. The 2nd bar code read will be in (row 1, column 0) and so on. I do not want to use keyboard at all (except for the Enter after each bar code).
This will mean that I want to programmatically select the 1st element in the array and have the cursor there. After the bar code is read and I press Enter, the cursor will go to the next element and wait for the input from the bar code reader.
I hope I am clear on my requirement.
Regards
Lee
06-18-2007 06:21 PM
Hi Lee,
What you are attempting to do is actually a bit tricky; I would recommend that you look at the following forum post for some suggestions. In particular, I believe the GenEventProg[2].vi file attached to this forum post should answer your questions.
http://forums.ni.com/ni/board/message?board.id=170&message.id=70107&requireLogin=False
06-18-2007 08:04 PM
06-18-2007 08:19 PM
06-18-2007 08:25 PM
Hi Mike,
Its a USB one. (Its this model => http://www.it3800.com/default.asp)
Its the programming part that I am unable to get it right. I have no problem using this USB bar code reader with a string control. But now I want to use it in an array.
Could you help me?? Give me some light ![]()
Regards
Lee Ping
06-18-2007 08:38 PM
06-18-2007 09:13 PM
Hi Mike,
Do you mean that I only need to have a 2D array on my front panel and use my bar code to scan, that's all?? This does not work.
I have tried initialising a 2D array to empty string and have my 2D array inside a While Loop. However, when I run this vi, the 2D array got initalised but when I use my bar code reader to scan, the array does not get updated. I do not want to use my mouse to click on which element in the array to store the bar code that is being read. I will it to update one by one from left top down to right top down. The only external key to press will be Enter on the keyboard when the user have got the bar code in one of the element in the array and moved on to the next element in the array.
If I used your method, I need to use my mouse and click on one of the element until I see | in the element then I can use my bar code reader to scan and that element will get updated with the bar code being read. Correct me if I am wrong
Thank you & Regards
Lee
06-18-2007 09:54 PM
06-19-2007 12:41 AM
Hi Mike,
Thank you so so much. I finally got it to work. I did not include the highlighting part. I did change some of the properties of the controls on the front panel (eg. Input string control, OK button).
Thank alot. You are the man. ![]()
Thank you & Regards
Lee
06-19-2007 02:16 AM