LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Prompt user for info" VI

Solved!
Go to solution
Hi, in one part of my NI Project, I want to use the "Prompt User for Input" VI to for an user introduce 4 numeric values and those values go to a knob (pin positions in the picture) with 4 position for the user to select which position he desire. The knob goes to case structure with 5 positions.  I want that the positions inserted by the user go to each position in the knob.  So, I have a button (enter pin position in the picture) enabling the prompt user input  Vi that put the information into a indicator and then go to the case structure for the positions and everything is inside of a time loop.  As soon as the user enter the information of the positions, those values go to the Knob but as soon as I press ok in the dialogue message, start again and again asking me for position for ever.  So I would like to know how to make an user input values every time he pulses a button to give values to the knob, is that the way using  "Prompt User for Input"? How do I make that with a pulse only ask me once the values and put them into the knob?
Download All
0 Kudos
Message 1 of 10
(4,009 Views)
Change the mechanical action of your Boolean from "Switch" to "Latch".
0 Kudos
Message 2 of 10
(3,994 Views)
I have done it, but it is still doing the same
0 Kudos
Message 3 of 10
(3,985 Views)
That doesn't make much sense. Can you upload your VI?
0 Kudos
Message 4 of 10
(3,974 Views)
Yes, here it is, but it has third party hadware so you will see and error messages trying to upload AO/AI/DIO, but you can delete that part on the top.
0 Kudos
Message 5 of 10
(3,961 Views)

I have no idea what happened to your switch, but it was definitely not behaving correctly. I replaced it with a new switch, set the latch to "Latch When Released", and it operated correctly. Very strange.

 

Note that if you bypass the execution of the prompt then it will return all zeros for the positions. You will want to have shift registers so that if you skip the execution of the prompt then you will use the previous values. I'm assuming this is the behavior that you will probably want. 

0 Kudos
Message 6 of 10
(3,942 Views)
Yes, thats what I want, to register the values and do not change then until press the buttom again. How do I save them?
0 Kudos
Message 7 of 10
(3,926 Views)
I changed the buttom and it is working now, so extrange
0 Kudos
Message 8 of 10
(3,923 Views)

Wolfson wrote:
Yes, thats what I want, to register the values and do not change then until press the buttom again. How do I save them?

As I indicated, you need to use a shift register. You can either use 1 shift register and bundle your values, or use 4 shift registers. Use a case structure driven by the Boolean control to determine whether to run the prompt VI, or to pass out the previous values. Shift registers are discussed in the LabVIEW manual and in the tutorials. You can look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

0 Kudos
Message 9 of 10
(3,899 Views)
Solution
Accepted by topic author Wolfson
Thank you very much for your help.
0 Kudos
Message 10 of 10
(3,871 Views)