LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you parse out a text file in a menu driven vi.

I'm using a file reader vi to read in the entire text, then using a pull down menu to select an instrument in the text, parse out the data. For some reason the data will not pass through the while loop. How can I achieve this?
JC
0 Kudos
Message 1 of 9
(3,657 Views)
JC,

Could you please elaborate your question. You haven't provided a clear picture of what you are doing, and what the problem is.

Specifically, if you would let us know what data you are trying to pass, and post a screenshot of the diagram showing the problem, we can be of more assistance.

Thanks,

Mike Du'Lyea

Advanced Test Engineering
0 Kudos
Message 2 of 9
(3,657 Views)
Mike,
I'm using text files that contain GPIB commands for certain instruments. I only want to modify the .ini file for future commands changes. Once the user selects the instrument from the pull-down menu, it will send the correct commands from the .ini file to the front panel, letting the user know what is being sent to the instrument.
Download All
0 Kudos
Message 3 of 9
(3,657 Views)
I can see your code, minus the File Reader of course, but I don't understand the question yet.

You said you are having problems getting the text through the loop. Please explain this.

Thanks
0 Kudos
Message 4 of 9
(3,657 Views)
That is the problem, I'm not understanding why the data is ending at the while loop and not continuing on to the string indicator's on the front panel. Once the data comes out of the scan from string, it goes to the while loop and stops.

I'm wondering if there is a better way to have a pull-down menu that parses out text data and send's it not only to an instrument, but to the front panel as well.
0 Kudos
Message 5 of 9
(3,657 Views)
Jeff;

I quickly looked at your code. Keep in mind that I am not sure the purpose of the VI.

In the state SMHU the setting for the String Subset VI (0 offset, 0 length) will only return an empty string.

I am suspecting that something similar is happening with the other case. I don't know to what menu are you looking at.

Enrique

PD: To Labviewguru - I noticed that the link you provided at the first response to this question is a wrong address, not your website!!
www.vartortech.com
0 Kudos
Message 6 of 9
(3,657 Views)
Enrique,
The purpose of this vi is to take a set of GPIB commands for instruments, put them in a .ini file, and be able to change only the .ini files at a later date.

My vi attached here reads in the .ini(all text), and, depending on the instrument chosen, will send the correct GPIB commands to that instrument, and also send the commands to the front panel, allowing the user to see what was sent.

I have attached a corrected vi that will not allow the text data to pass thru the while loop.

Is there a better way?

Jeff
Download All
0 Kudos
Message 7 of 9
(3,657 Views)

I looked at the Discussion Grp.  Did this ever get resolved??  I'm trying to do, kind of, the same thing.  Just want to read in a Text File and create a menu selection from it.  Using a text file created in Notepad then read into LV using Read from Text File.vi then ????

Thanks,

Clint

0 Kudos
Message 8 of 9
(3,178 Views)
One additional comment.  Is there any info on using Get Menu Selection and Enable Menu vis ??  One example calls for a sample.rtm but I can't find that any where.  The calling vi needs it to work.  Is there any doc on how to create and why you use a rtm file??  Maybe I'm making more out of this than I should.  All I want to do is beable to create a menu from a txt or ini file.  The reason is the text in the file is huge and could possibly chg.  I don't want to hardcode in a menu selection then have to chg it later.  Just chg the text file.
0 Kudos
Message 9 of 9
(3,158 Views)