02-26-2013 09:42 AM
Hey Everyone,
I am trying to create a vi that will take my txt look-up table and find a specfied pathloss from it. I was using an xml format but the continues writing process to the file was lagging pretty bad. So I have decided to make a switch to txt. The one thing I liked about xml is the I could assign a header and search for that string and import the pathloss and frequency into an array and use it in my teststand code. Can txt do about the same? I have looked through the tools on labview and I have found huge sections on xml alone. If I leave it in an xml format and write it to an xml file can I still search for the header and pull the right data? Attached is my vi that I will be using to create the txt file, the vi that I used to parse through the xml file, and a sample txt file (so you can get an idea on where my mind set is ).
Thanks,
dlovell
02-26-2013 09:48 AM
can you upload it in LV2011 version.??
02-28-2013 11:05 AM
Hey Nghtcrwlr,
Here are the vis in 2011.
Thanks,
dlovell
03-01-2013 04:38 AM
Hi dlovell
I dont understand you question clearly. Are you now trying to read the attached text file and search for something? What does the array name stand for? I see nothing to match the array name in the attached text file.
03-04-2013 12:57 PM - edited 03-04-2013 01:00 PM
Hey Nghtcrwlr,
Yes that is correct. I am doing a search on the contents in the txt using the header name. I sent the wrong txt file that is suppose to work with the Find Array_TestStand.vi program. Attached is part of the entire look-up table. You can see that the header the program is suppose to search for looks like this: "<Name>RF Switch Matrix I1 to O1 50000000</Name>". The problem I am having is using the "Find Array_TestStand.vi" to do txt instead of xml.
Thanks,
dlovell
03-05-2013 03:03 AM - edited 03-05-2013 03:04 AM
Hello dlovell
Well, there is no direct VIs available to convert XML to text, tht i am aware of. Otherwise you will have to program it yourself.
Another option is to search for what you need like searching the Array name then using search/split string search waht you need and son on. But i guess then u will extract the dimension first and then repeat it for the specified number of time...That is really a tedious task.
May be some other LV experts can give you some other tips.
03-07-2013 10:13 AM
What do you mean by "The problem I am having is using the "Find Array_TestStand.vi" to do txt instead of xml."
XML is text, so what do you expect ?
Can you give an example of the output you are seeking ?
Maybe some kind of small database is what you are looking for. But you need to give some more information on what you are using the data for and what format you are expecting it in.
03-07-2013 06:00 PM
Hey dkfire,
Thanks for responding. I am aware that xml is just a form of txt the problem I am having is the search vi isn't working on txt files. If you look at the data after each header you will see two values, a frequency and a pathloss. I would like to store these values into an array and then use them in any of my teststand sequences. I was hoping to keep the xml format because I like how they are structured with the headers. Is there anyway to take the existing vi and have it search through the txt file and extract the desired data without having to completely tear apart the vi. I am no where close to being that adept with labview. Hope this helps to understand my problem.
Thanks,
dlovell
03-09-2013 05:12 PM
Right now you get an two dimensional array out with two values. What is it you are missing ?
Do you want all the values from all the names ?