04-01-2013 12:13 AM
Like in c language if we use a scanf statement in a loop , every time at each iteration it will ask for the value to read from keyboard and pauses the process until the value read. How can we implement it in labview? Please help me.
04-01-2013 12:35 AM - edited 04-01-2013 12:37 AM
Hi Suri,
You will most likely need to use event structures. If you are happy to have a string control the user can type into the control and you can read it when they complete typing (Create a string control value change event)
If you want the user to be able to type all the time and not into a string input you can have a look at this post.
http://labviewdownunder.blogspot.kr/2009/11/binding-keys-to-buttons.html You will still need to look for events but it will be key down event. You can append each new key to the end of the string
EDIT:
To get the number you can then use the string palette->scan from string function and specify a number input.
Good Luck
04-01-2013 07:52 AM
04-01-2013 02:53 PM
I think thse closest to what you are looking for is the ExpressVI: "Prompt User For Input". It will open a pop-up and wait for the user input!
Othewise, if you are concerned on a "key by key" input, the other two suggestions are good but you can also take a look at the example "C:\Program Files (x86)\National Instruments\LabVIEW 2011\examples\input\InputDemo.llb\Basic Input Demo.vi" for a different alternative, not Event driven.