From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

(string array indexing)

I am unsure what "reflect" means but I modified the code to what I think you mean. The Models array can be outside the while loop. It can be updated inside the loop using a local variable and I use a shift register to keep track of the Models data.

As for parsing the text file. Not as straight forward as I thought so I will look at it when I have more time.

David

Message 11 of 36
(1,898 Views)

David,

Thanks. You got me right on that one.  And I request you to please get back to me if you can figure out a way to parse the simulation file.

Thanks again.

Have a wonderful day.

Shaun

Message 12 of 36
(1,892 Views)

Shaun

I am on leave so I won't be around next week. So here is some homework Smiley Very Happy

Here is my first attempt which kind of works. It runs into trouble when reaches aichan_air_brake_press. Hopefully this will give you some ideas to be getting on with when it comes to working with strings. There might be other bugs that I haven't noticed yet. I have another idea which starts the processing at the end of the file and works backwards chopping off the # text id blocks and processing them seperately so avoid the match pattern getting too far ahead of itself.

I haven't had time to comment the code so it should be nice exercising in using execution highlighting and other debug activities

I will catch up with you when I get back from holiday. Have fun.

David

Message 13 of 36
(1,883 Views)

Hi Shaun

How are you getting on with the parsing of your file?

David

Message 14 of 36
(1,843 Views)

David,

I couldn't work with the VI you posted in your previous post as I'm using labview 8.0 and your example was in 8.2. So, could you kindly post that parsing example in 8.0..? Hope you had a nice vacation. Smiley Happy

Is it possilbe to get an array of boolean to just one value ( like either true or false)..?. I want to wire this single boolen output to the select structure.

Thank you

Have a Great Day

Message 15 of 36
(1,830 Views)
Thanks Shaun, I had a great holiday.
 
Its amazing what a holiday can do for you. Clears the part of the brain responsible for thinking in labview Smiley Very Happy. It turns out that there is an easier method to parsing the file. See attached file in LV8.
 
The Equals? function in the comparison palette is polymorphic so you can wire the arrays direct to it. This will produce an array of booleans by default. However if you right click on the Equals? function and select Comparison Mode -> Compare Aggregates then it provide a true if the arrays match.
 
cheers
 
David
Message 16 of 36
(1,822 Views)
Hi David,
 
How are you doing today..! I'm sure you feel refreshed after having a vacation. Smiley HappyGuess what, I'm goin on a vacation too (next week). Thanks for your post.
 
Couple of things,
 
I'm parsing an 1D array of controller ids. And I am able to parse them by making use of "sdlmtd to array. vi" with slight modifications. But I'm not quite getting it in the required format. Please see that basic circuit I've attached that I'm using for my application and the required format.
 
To the vi you posted in your previous post, in an effort to include another key element , I added a case structure "Chanel". What other changes should I make so that I have another column(chanel) which lists the chanel no.# for each text id.(if present)
 
 
Thank you very much.!
 
Have a Great Day..!
 
Shaun
 
Download All
0 Kudos
Message 17 of 36
(1,793 Views)

Hi Shaun

Good show, you will be looking forward to your holiday. Take a rest from all this labview you are doingSmiley Very Happy

I have attached another version with the "channel" added. Compare this to the previous version and you will see its a pretty easy mod. I have commented the block diagram outlining the changes.

Well, you are going to have to run your other question by me again. You have supplied a vi that scans a string for tokens creating a 1D array and text file with some data in it. I am assuming you want some help to extract some data from this file but you haven't said what.

David

 

 

Message 18 of 36
(1,782 Views)

Hi David,

Sorry for the unclarity in my question. I should have read the message again before posting it. Thats what happens when you are multitasking..!Smiley Happy

Ok, In the txt file attachment that I sent, all the controllers on the left side reside in an 1D array.  Each element in this array (controller array) must be parsed in to different sections or columns ( control, plot, type, bit, CH). Since each element happens to be space delimited, I was making use of the "Sdlmtd to array" vi ( with the input being a 1D string through a for loop) for parsing into sections.

With some modifications to it, it is parsing but not in the required format given in the txt file. So I wanted to know the right modifications or an effective sample code that parses the 1D array elements(controllers) in the required format.

Thanks again

Have a Nice Evening..!

Shaun

 

 

 

0 Kudos
Message 19 of 36
(1,772 Views)

This demonstates using Spreadsheet String to Array using a SPACE at the delimeter. The parsing is controlled by the Controller type.

David

Message 20 of 36
(1,765 Views)