LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

PromptPopup is transposing characters upon data entry

I am using version 7.0, and have always had an issue where upon the typing of characters in a "prompt popup" the charcters will intermittantly transpose. I am trying a barcode reader and am having the exact same problem, as I had with the keyboard. Note that this problem only happens with labwindows, and not with excell or word.
 
This is an example of the code:
 
n = PromptPopup("", "ENTER YOUR LAST NAME?", operator, 20);
    n = PromptPopup("", "ENTER THE COMPUTER NUMBER ?", computer, 20);
    n = PromptPopup("", "ENTER YOUR PART NUMBER 1 ?", pn1, 20);
    n = PromptPopup("", "ENTER YOUR PART NUMBER 2 ?", pn2, 20); 
    n = PromptPopup("", "ENTER YOUR PART NUMBER 3 ?", pn3, 20);
    n = PromptPopup("", "ENTER YOUR PART NUMBER 4 ?", pn4, 20);
    n = PromptPopup("", "ENTER YOUR PART NUMBER 5 ?", pn5, 20);
    n = PromptPopup("", "ENTER YOUR PART NUMBER 6 ?", pn6, 20);
    n = MessagePopup("", "MAKE SURE PRINTER IS ON, AND CONNECTED!");
 
Thanks for any help,
Chris
0 Kudos
Message 1 of 8
(3,798 Views)
Hello Chris,
 
I wasn't able to reproduce the behavior you are seeing.  Are you able to reproduce it consistently after following a certain sequence of events?  Do you get the behavior in Debug or Release mode?  Does the entire response get transposed?  Could you include an example of the incorrect result you get back from the prompt popup?  I would also double check that the response buffer you pass is large enough to hold maxResponseLength bytes plus one ASCII NUL byte.
 
Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 2 of 8
(3,781 Views)
Wendy,
 
Thanks for your responce. Answers to your questions below.
 
 
Are you able to reproduce it consistently after following a certain sequence of events? 
 
This problem is intermittant. The sequence of events are as follows:
 
1)  Prompt popup appears
2)  Enter data
3)  Press enter key
4)  Next Prompt popup appears
5)  Repeat 1 through 4
 
One thing I do notice is that when this problem happens, the program appears to pause or slow down for a second, then it will try to catch up quickly. When it tries to catch up, it will usually transpose characters. Also one way to keep this from happening is to slowly type the data. If you try and type too fast the program will lose track, and try and "catch up", transposing numbers.
 
This was merely an annoyance in the past because we are using keybaords for data entry, but we now want to use a barcode scanner for data entry, and the bar code scanner enters the characters fast. The transposing of barcode data happens about 20% of the time.
 
 
 
 
Do you get the behavior in Debug or Release mode?
 
I am using a standalone .exe release version.
 
 
 
 
Does the entire response get transposed?  Could you include an example of the incorrect result you get back from the prompt popup?
 
An example would be as follows:
 
CORRECT:                     123456789
TRANSPOSED                987654321
TRANSPOSED                126548937
 
It usually will invert the numbers, but sometimes it will jumble them up.
 
 
Thanks for the help.
 
Chris
0 Kudos
Message 3 of 8
(3,775 Views)

Hello Chris,

First, which operating system are you running on?  Also were you able to double check that the response buffer size is at least 21 (since you specify the maxResponseLength to be 20 in the PromptPopup)?  You mentioned that you are seeing this problem in a release executable.  Do you have access to the source code?  If you do, do you see the same behavior when you create a debug executable in CVI and debug the application within the environment?  To me, it seems like somehow you are overwritting or not correctly addressing memory.  I would suggest creating watchpoints on your variables.  This might help you further isolate when this problem occurs. 

Thanks.

Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 4 of 8
(3,744 Views)
Wendy,
 
First, which operating system are you running on?
 
Windows 2000
 
 
Also were you able to double check that the response buffer size is at least 21 (since you specify the maxResponseLength to be 20 in the PromptPopup)? 
 
Our response buffer is set to 22, and by the way, when we bar code we only enter 6 digits.
 
 
 
Do you have access to the source code? 
 
Yes, I have the source code, and can send it to you if you need it.
 
 
 
If you do, do you see the same behavior when you create a debug executable in CVI and debug the application within the environment?
 
Yes I see the same behavior while running in debug.
 
 
 
Thanks Again,
Chris
0 Kudos
Message 5 of 8
(3,741 Views)

Hello Chris,

I think at this point it might be helpful if you could post a small example program which demonstrates the problem, if that is possible.

Thanks again

Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 6 of 8
(3,739 Views)
Wendy,
 
I could you send my .c file to your NI email.
 
Chris
0 Kudos
Message 7 of 8
(3,737 Views)

Hello Chris,

I think you might already be in contact with another Applications Engineer via the phone.  You can send your code to him, and I will also take a look at it.

Thanks.

Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 8 of 8
(3,733 Views)