10-03-2011 02:55 PM
The Read From Text File vi can be used to read lines from file (right click menu -> read lines). You can then use regex to parse the informations that you want. Attached is a modified version of majoris vi.
I recommand this site http://www.regular-expressions.info/ to get more familiar with regex.
Ben64
10-03-2011 03:01 PM
10-04-2011 07:03 AM
Yes i would like to be able to sort through commands from left to right so i can say alright i want this command then this command then this command...ect. and be able to sort out all lines that match the commands for a start and an end to subtract their timestamps and get multiple times to monitor how long each strat line to end line took to plot. I am having trouble getting either of the vi's to work would you suggest me doing a sequence structure with a case structure in each to select each command and having two of these for the first line (start command) and for the second line (end command). also how can i get the vi to select every one of the start and end lines for that specific command instead of just the first one that comes up. I appreciate you all for bearing with me on this subject.
Triff
10-04-2011 08:31 AM
10-04-2011 08:42 AM
I'm getting the feeling that what's really needed here is a review of Labview itself. I'd seriously recommend reviewing the tutorials on this website and elsewhere to understand all that Labview can do. Once you're comfortable with alot of basic Labview concepts, this should be a breeze for you (Regular Expressions notwithstanding).
No need for the sequence structure: In fact, as a rule, you should avoid it at all costs. What you want to do at a high level is make a VI for parsing each line of the input. You do this by putting your parsing VI in a while/for loop that is autoindexed on the array of command lines. Once you do that you can do alot of stuff. For instance, once you parse the data (and maybe turn it into a useful format... i.e. turning those text time stamps into numeric seconds, or milliseconds), still inside the for loop, you could then collect all the similar commands into seperate arrays. Then you can go through those arrays (with a different for loops) and subtract every pair of commands (which are the same) giving you the time in between each command start and command end for that command. A case structure based on the command is likely necessary for what you do, and as long as your commands are sufficiently predictable, you can wire the output of regular expression match for the command: (Cmdr2|...) to a case structure and then write in each command case to handle it differently.
There's probably like 100 more ways to do it. Depends on a lot of different factors.