Showing results for 
Search instead for 
Did you mean: 

"Prompt User" dialog default input text field

Go to solution

I am trying to create a customised "Prompt User" input, where the dialog input text field will always have a default value displayed when the VI is called. I have a main VI, which calls a modified "Prompt User" VI. Below code is modified from the standard LV Prompt User. The "Default_Serial" control is wired to the connector pane as input.






The main VI then looks like this.

mainVI.JPGBut it does not work. Can anybody help? 






Download All
0 Kudos
Message 1 of 8

And in what way "doesn't it work"?


Why are you setting the value for a control through a value node, but also using an invoke node to Reinit All values to Default?  There is a race condition as to which will execute first.  But don't you think that you might be undoing what you are trying to do by setting a value for a control?

0 Kudos
Message 2 of 8

I don't quite understand.. I didn't work as I expected because when I run the main VI, it "should" show "This is default serial number.." in the input field. The in actual fact the input field is empty.

Could you please suggest what I should do?

0 Kudos
Message 3 of 8

Try removing the Default Values.Reinit All invoke node.  If that happens to run second, then it is just going to return your control back to the default value after you just set the value to something.

Message 4 of 8

Can I use a flat sequence? I mean set the value of the control through value node, only after "Reninit"?


0 Kudos
Message 5 of 8
Accepted by topic author splee

Just use the error wire so that it comes out of the Reinit node and goes into the Value node where you set the value.  That would be much simpler and you wouldn't need a sequence structure.

Message 6 of 8

Thanks Raven. It works like magic!!

Why would the wiring of the error wire prevent race condition?

0 Kudos
Message 7 of 8



A node can't run until it receives all the values on its inputs.  So it can't run until it gets a value on the error wire.  The error wire won't have a value until the Reinit node has completed.


Without any wires between the two, then you have a race condition.  Either node could wind up running first.

0 Kudos
Message 8 of 8