From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-01-2012 10:48 PM - edited 10-01-2012 10:51 PM
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.
But it does not work. Can anybody help?
Solved! Go to Solution.
10-01-2012 10:54 PM
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?
10-01-2012 10:58 PM
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?
10-01-2012 11:01 PM
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.
10-01-2012 11:01 PM
Can I use a flat sequence? I mean set the value of the control through value node, only after "Reninit"?
10-01-2012 11:03 PM - edited 10-01-2012 11:11 PM
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.
10-01-2012 11:10 PM
Thanks Raven. It works like magic!!
Why would the wiring of the error wire prevent race condition?
10-01-2012 11:13 PM
Dataflow!
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.