03-01-2006 10:13 PM
03-01-2006 10:29 PM - edited 03-01-2006 10:29 PM
If the pattern is regular, you could reshape the array into a 4 x N/4 array and take the first column/row.
If the pattern is irregular, you could built a new array in a loop. (Most likely you can modify this for direct use in your code and built the array only with good elements from the beginning).
The attached shows both possibilities. (LabVIEW 7.0)
(If the array is very large, there are a few tweaks to make it more memory efficient, but the above should get you started)
Message Edited by altenbach on 03-01-2006 08:33 PM
03-01-2006 11:07 PM
@beccccc wrote:
... Alternatively is it possible to outpul NULL from a case statement rather than an empty string?
It sounds like individual strings are being produced in the code - from inside a for-loop (or while loop)?
If the problem is that some loop is generating an element every iteration, but there isn't data every iteration, then you, may be interested in the "Shift Register".(see example)
Cheers.
03-01-2006 11:17 PM
Thanks guys, The first solution is working quite well, but I will explain how I came up with the problem for further clarification.
I have saved data into a text file which is in the format: channelNo-Data\n so..
0001-1234
0002-1233
0003-1222
0001-1235
0002-1372
etc.
I am then seperating the channelNo and the Data out of the string
Running it through a case statment as a way of sorting the data into channels.
The problem I found with my case statement was that when the channelNO isn't equal for the channel number I am looking for then you need to output some data.
This is all inside a for loop to build an array of numbers which when i use "empty string" for a false case outputs an array which contains data followed by a series of string elements which are empty.
03-02-2006 12:17 AM
03-02-2006 01:20 AM
03-02-2006 02:03 AM
03-02-2006 03:00 AM - edited 03-02-2006 03:00 AM
Hi beccccc,
Thanks for the example of your code - glad you asked, Altenbach
Here are some more ways to extract the channel data. Like Altenbach said early-on, "if the pattern is regular" ...
Cheers
Message Edited by Dynamik on 03-02-2006 03:01 AM
03-06-2006 07:52 PM
Hi Dynamik ,
I am using labview 7.0, so I can't see the code you produced, could you attach it as a jpg?
Becccc
03-07-2006 04:00 PM
Hi becccc,
This is the core code in 7.0. When saving to previous version, 7.1 complained about some of the other diagram objects, so they are omitted.