LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

User Prompt not returning Value

Solved!
Go to solution

I have a user prompt dialog that is a slightly modified version of the standard prompt user for input express VI. I tried to modify the VI so that it would allow the user to close the prompt with a press of the enter/return key. The end goal is to have the dialog popup, the user will scan a barcode and the barcode reader appends a return character, automatically closing the dialog box.

 

I followed this from user DiscoBall: https://decibel.ni.com/content/docs/DOC-13973. The only difference between my code and the code there is my User Dialog returns a string instead of a number. See below for my code.

Prompt User.png

 

jobdialog.png

 

The problem I am running into is that the string "Item Number2" never actually is returning any value after it is called. The indicator on the front panel of the modified express vi displays the correct value after running, but the value is never returned to the VI that called the dialog. As the default express vi the value is correctly returned. The only modification I made was the addition of the event structure, so I would have to assume that my code is going wrong inside of that node.

 

Any thoughts are appreciated.

0 Kudos
Message 1 of 5
(2,463 Views)

I think that your code is more complicated than it need to be. Here is a simpler version that we can add to. Tell me what you think.

Tim
GHSP
0 Kudos
Message 2 of 5
(2,451 Views)

Well the problem with that is the code stops for any key press value. I still need to be able to enter the data, as a barcode scanner is treated like a keyboard.

0 Kudos
Message 3 of 5
(2,449 Views)
Solution
Accepted by topic author MTHPCB

Set the String control to "Update Value while Typing".

 

UPDATE.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 4 of 5
(2,442 Views)

You just have to hook the enter key back up to the stop. See new vi.

Tim
GHSP
0 Kudos
Message 5 of 5
(2,436 Views)