03-28-2008 02:37 PM
Hi Subhashini,
The first thing I want to mention is that everytime you use a While Loop, you should always include an option to stop it with a stop button, rather than just the status of the error wire. If you do not do this, the VI will run continuously if it does not read an error, and you will have no way of stopping the VI. You will then need to shut down and restart your PDA.
Also, I see that you are using the One-Button Dialog Box VI to display each string. To do this properly, I would suggest using a For Loop rather than a While Loop, and set the N terminal of the For Loop to the number of lines to read. This way, the VI will display a dialog box for each line, and then the VI will stop. I've included an edited version of your example that uses this method.
Please let me know if you have anymore questions, thanks!
03-29-2008 01:47 AM
Hello Meghan,
Thanks for ur response. I see that u have hard-coded the number of lines to read from the text file. In my application, i cannot hard-code the number of lines to read from text file because this will vary from file to file! Is there any function available in LabVIEW PDA to get the number of lines in a text file? If yes, then the approach u have suggested will work for me.
Also, please note that the example i had posted did work on the desktop. So i feel that there is indeed a problem with 'Read lines' option checked on PDA.
Thanks & Regards,
Subhashini
03-31-2008 10:43 AM
Hi Subhashini,
The attached screenshot of a block diagram shows how you can programmatically count the number of lines in a text file. You can then wire this value into your the N terminal of your For Loop.
04-02-2008 04:37 AM
Hello Meghan,
Thanks. Can u please give me the names of the array functions that u have used to 'Convert to an array and get number of rows'? Iam not able to fully make out which array functions u have used. If possible, please send the VI.
Thanks & Regards,
Subhashini
04-03-2008 09:52 AM
Hi Subhashini,
Attached is the VI which will programmatically determine the number of lines in a text file. Hope this helps, thanks!
04-04-2008 12:17 AM
04-07-2008 10:28 AM
Hi Subhashini,
Could you try running the VI with the input wired so that you are not prompted to select a file? This might be the problem. If you are still seeing errors, you might want to take a look at this KnowledgeBase. Give this path format a try, and let me know if it works.
04-14-2008 08:33 AM
Hello Meghan,
I ran the VI on desktop with the input wired as u suggested, but still same problem - "# of Lines" is zero.
Thanks & Regards,
Subhashini
04-18-2008 04:57 PM