Determination of array size in bytes

Dear forum users,
I want to determine the size of an array subset in bytes.
At the moment I try to do this as shown in my attached program: Simply said, I am reading in my data (example data can also be found in the attachment) and convert them into an array. From this array I am taking the subset I am interested in. This array subset is saved in a new file from which I determine the byte size with the “Get File Size.vi”.
That are a lot of steps with file saving (deletion of the compulsory created new file not mentioned) just to get the byte size of this array subset.  And with this approach the file size (the byte size of my array subset) is unfortunately depending on the format with which I save the file (%.6f or similar), but I would need the byte size of this subarray as it would be in the original file (see my comment on the front panel).
Therefore, I want to know if there is a better, simpler, quicker and correct way to get the byte size of a subarray.
I would be very happy about every comment and help!
Attachments:
ByteSizeOfArraySubsetLV2011.vi ‏18 KB
ByteSizeOfArraySubsetLV8_6.vi ‏15 KB
ExampleData.txt ‏1114 KB

Dear GerdW and smercurio_fc,
Thanks a lot for your replies! Perhaps I should have mentioned that I need the size of my array (string…, I am confused now) in bytes because I want to use later in my program the “Set File Position.vi” (which needs an offset in bytes). With this vi I want to read in my data again but starting after the data which I have used in my array (I try to make bunches out of my file).
Ok, the suggestion of GergW is a step forward, but it does not work correctly. I have modified my program a bit (see attachment), so that it gives back the file size of the original file and the length of the string after the file has been read in. Interestingly, the numbers are not the same. The same is also true for my subarray (and the string length is still dependent on the format with which I convert my array to a string).
So once again asked: If I take from my original file lines 3 to 12, copy them in a new file and save this file, then I can read out the size of the file (191 bytes). How can I get the same number in LabVIEW after reading in the original file and taking the same subarray? I hope my question is clearer now (it is surely suffering a bit from my bad English. I am sorry!).
I hope to hear from you again!
Attachments:
ByteSizeOfArraySubsetLV2011_2.vi ‏14 KB
ByteSizeOfArraySubsetLV8_6_2.vi ‏11 KB

Similar Messages

  • How do I determine array size in a formula node

    I am feeding an array into a formula node to perform an operation on. However the size of the array can be an arbitrary size. How can I determine its size to use for iterating through a for loop?
    I suppose that I could add another input that is fed with the array size from the array palate but I would like to know if it can be done inside the formula node itself.

    Your own advice is the only and best one.
    greetings from the Netherlands

  • Data type of preprend array size in Flatten To String block

    Hi 
    The data type of the preprend array size in Flatten To String block is given as I32. Is it somehow possible to reduce the data type to I8, since the width and height of my array won't exceed 255 ?. I also need to do the same in Unflatten To String as well. 
    Best regards
    Oesen

    Oesen wrote:
    Hi 
    The data type of the preprend array size in Flatten To String block is given as I32. Is it somehow possible to reduce the data type to I8, since the width and height of my array won't exceed 255 ?. I also need to do the same in Unflatten To String as well. 
    The short answer is no.  This is because the index is an I32.  NI likes to keep integers as an I32 whenever possible for reasons like this.
    Since you are dealing with a 2D array (width and height), it will actually use 2 I32s before the actual data.
    As Ravens stated, you could put in your own array sizes before the array in the string.  But it is worth saving 6 bytes?  Not likely.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to adjust a "control array" size

    I have a program that creates a digital PWM signal with variable duty cycle. The duty cycle changes every 50 ms, but the overall wave frequency stays at a frequency determined by the user. I have the VI attatched.
    My problem is this...I need to be able to control the overall cycle time. This means the size of my array of duty cycles needs to adjust based on the cycle time (i.e. a cycle time of 1 second would require 20 of the 50 ms slots, while a 1.3 second cycle would need 26).
    I currently have only 4 slots in my array, meaning the total cycle time is .2 s. I understand how to manually add and remove elements to the array, but I can't figure out how to add a control to it so that the array size changes automatically, allowing much quicker entry of data. As of now I can make it work, it just takes super long to add or delete array elements. The ideal situaton would have a constant control for cycle time divided by 50 that would change the array size.
    I can't find any info on this, and I think I even saw a post asking that this kind of feature be added. I'm relatively new to this program.
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    var_duty_cycle.vi ‏25 KB

    Currently, your VI is a one-shot deal. What you need is a state machine that updates the pct duty cycle array control as a function of the frequency while the current I/O code is idle.
    I would use an array of clusters, where each cluster contains e.g. a sequence number, a duty cycle, and a string as element label. Show the scrollbar and set the size whenever the relevant inputs change. Do you want to reset the current setting when the number changes or do you want to retain the current settings as much as possible? You could just use the existing values, reshape to the larger or smaller size, and write it back to the control via a local variable. Set all elements  except the percent to disabled so they act as indicators and cannot be changed by the user.
    (You also need to program around it if the operator tries to manually add more elements. A better solution would be this idea, so vote for it .)
    Some more general comments bout your code:
    Why do you use extended precision floating point. All your waits are internally just integers. EXT makes no sense
    There is a primitive for 1/x. However, you could just do a 1000/x and eliminate the multiplication afterwards. SInce you are dealing with integers, you can even do the division using quotient&remainder. Depending on the allowed frequency range there are possibly no orange data needed at all.
    Make the diagram constant representation match the rest of the code.
    The pulses/50ms indicator belongs before the loop. No need to recalculate and refresh it over and over from the same input values.
    LabVIEW Champion . Do more with less code and in less time .

  • Two instances of quirky behavior: array size of empty array and tab control freeze

    LV 7.1
    Array size of empty array. Adding empty arrays to an array of higher dimension produces a fantom array of non-zero size.
    Tab control freeze. An event structure with checked 'lock front panel until the event case completes' option permanently freezes the front panel in certain special circumstances.
    Zador

    tst wrote:
     Tell me if you still think this makes sense.
    Whew, let me look at this tonight after I activate the 4D module in my brain.
    (I think it makes sense, though ) Generally I look at the product of the dimensions array to determine if an array is empty. You can initialize a multidimensional array with some dimensions at zero and it is reproduced nicely in the array size output. Also the "Empty array" tool correctly identifies it as empty, even if some dimensions are nonzero.
    Message Edited by altenbach on 03-15-200612:42 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    init.png ‏3 KB

  • Array size

    Hi,
    I am concatenating 9 arrays of 30 bytes each in order to build an 270 bytes array, but it seems that I can on read 170 bytes instead of 270.
    even if I am tring to tile down my output array I cannot.Is there any limitation in terms of array size?

    Hello Reddy,
    Here my code, I cannot expand my output array I don't know why?as I said I can only read 127 bytes approx.
    Attachments:
    concatenate array bytes1.vi ‏49 KB

  • Array size in Analog Tacho Processing vi

    Hi
    I would like to know more about what Analog Tacho Processing vi does particularly on the array size that it generates.
    Attached is an example of vi that comes with LabVIEW. I used the array size function to show the size of the signal before passing thru the Analog Tacho Processing vi, and after the signal passes it. When we run the PC fan runup.dat file (which can be found in the LabVIEW order analysis Example Data), we can see that the array sizes for before and after passing thru the Analog Tacho Processing vi are 58368 and 1455, respectively. What I would really want to know is how the 1455 is generated.
    Any help is greatly appreciated.
    Thanks
    Attachments:
    Getting Started Exercise_Order Analysis.vi ‏330 KB

    Since the Express VI calculates rotational speed based on pulses per revolution, it will use those pulses to calculate the speed profile.  For example your input waveform may have 1000 data points to describe 3 pulses, the VI is going to just use those 3 physical pulses to determine rotational speed (based on the value you set for pulses per revolution).  Thus you will never see the same number of points on the input and output of this VI.  If you are trying to determine the exact formula it is using I will not really be able to help you with that.  
    My best suggestion would be to use context help and the detailed help for that VI, you can also right click and open the front panel of the Express VI if you are so inclined.
    Happy Programming!
    Kyle 
    Applications Engineer
    National Instruments

  • Cluster size in bytes programatically

    Is there something that implements a C stype "sizeof" in labview? I need to call a dll and pass in a cluster value and it's size in bytes.
    Thanks
    Eugene

    If the cluster doesn't have variable length data (strings and arrays), flatten the cluster to string and get the string length.
    LabVIEW, C'est LabVIEW

  • How do you determine the optimal size for Mozilla Firefox?

    How do you determine the optimal size for cache in Mozilla
    Firefox? I am using Firefox 7.0.1 on a 64-bit Windows 7 Ultimate operating system with 3GB RAM and 300 GB hard drive, but I have other computers running Windows XP. If the answer doesn't apply to all current versions of Firefox on all supported Windows operating systems, please explain the differences. Is there a formula for calculating the best cache size?

    I found that the best idea is to let Firefox decide that itself.

  • How to get the file size (in bytes) for all files in a directory?

    How to get the file size (in bytes) for all files in a directory?
    The following code does not work. isFile() does NOT recognize files as files but only as directories. Why?
    Furthermore the size is not retrieved correctly.
    How do I have to code it otherwise? Is there a way of not converting f-to-string-to-File again but iterate over all file objects instead?
    Thank you
    Peter
    java.io.File f = new java.io.File("D:/todo/");
    files = f.list();
    for (int i = 0; i < files.length; i++) {
    System.out.println("fn=" + files);
    if (new File(files[i]).isFile())
         System.out.println("file[" + i + "]=" + files[i] + " size=" + (new File(files[i])).length() ); }

    pstein wrote:
    ...The following code does not work. Work?! It does not even compile! Please consider posting code in the form of an SSCCE in future.
    Here is an SSCCE.
    import java.io.File;
    class ListFiles {
        public static void main(String[] args) {
            java.io.File f = new java.io.File("/media/disk");
            // provides only the file names, not the path/name!
            //String[] files = f.list();
            File[] files = f.listFiles();
            for (int i = 0; i < files.length; i++) {
                System.out.println("fn=" + files);
    if (files[i].isFile()) {
    System.out.println(
    "file[" +
    i +
    "]=" +
    files[i] +
    " size=" +
    (files[i]).length() );
    }Edit 1:
    Also, in future, when posting code, code snippets, HTML/XML or input/output, please use the code tags to retain the indentation and formatting.   To do that, select the code and click the CODE button seen on the Plain Text tab of the message posting form.  It took me longer to clean up that code and turn it into an SSCCE, than it took to +solve the problem.+
    Edited by: AndrewThompson64 on Jul 21, 2009 8:47 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to determine the database size corresponding to the nber records in DSO

    Hi Colleagues,
    I would like to determine the database size corresponding to my new BI project.
    I know the number of records uploaded in the DSO from the source system for the intialization phase.
    How can I deduct the database size / disk size corresponding to the number of record uploaded ?
    Thanks,

    Hi Ram,
    I am with SAP BI Release SAPKW70019
    I do not have the option Single Table analysis -
    I have in DB02 or ST04 the following options.
    *- Space*
    -- space overview
    ->database
    --overview
    ->users
    --overview
    --detailed analysis
    -> tablespaces
    --overview
    --detailed analysis
    -> segments
    --overview
    --Detailed analysis
    --Detailed Analysis Aggregated
    -> Additional Functions
    --Collector Logs
    --BW Analysis
    Where should I go through ?
    Thanks

  • Change array size and delete duplicate row

    Hello,
    I am running a program that does a for loop 3 times.  In each loop, data is collected for x and y points (10 in the example provided).  How can I output the array with the 30 points in a simple 2D array (size 2x30)?
    Also, from the array, how do I delete duplicate rows that contain the same x-value? 
    Thanks,
    hiNi.
    Solved!
    Go to Solution.
    Attachments:
    array size.vi ‏10 KB

    Hello,
    THANK YOU for solving my first issue!  Attached is the data set that contains the duplicate entries for the x-axis values.  The y-axis value may be different, but not the x.  I would like to delete the 2nd row that contains the same x-value.
    Here is simple example of my input and desired output:
    IN: 
    28.512000 -115.310532
    28.812000 -86.937660
    29.112000 -116.877052
    29.412000 -87.223625
    29.412000 -111.349045
    30.012000 -86.510780
    30.312000 -112.048187
    OUT:
    28.512000 -115.310532
    28.812000 -86.937660
    29.112000 -116.877052
    29.412000 -87.223625
    30.012000 -86.510780
    30.312000 -112.048187
    I am thinking of comparig the last x-axis value to the current one, and if it is the same, then not parse that row.  The attached VI is as far as I got.
    Any help will be greatly appreciated.
    Thanks,
    hiNi
    Attachments:
    delete duplicate row.vi ‏8 KB
    data.txt ‏1 KB

  • In app store some applications are of very small size like 15-20 Mb and after installing them they become more than 100 mb. how to determine their actual size???

    in app store some applications are of very small size like 15-20 Mb and after installing them they become more than 100 mb. how to determine their actual size???

    The app store size is probably just the software, while the size on your iPhone includes data.
    You can determine the size on your iPhone by looking at Settings > General > Usage.

  • Set Fixed Array Size

    Hello. I am trying to develop a VI for an FPGA target and I'm trying to make it so whoever is using the VI can specify the size of an input array when they instantiate it (such as by having an input to the VI that says "max array size" or something). So far it seems like the only way to do something like this is to go into the VI itself and manually set the array size for each input array for the VI (i.e. open the VI, right click on each input array, select "Set Dimension SIze", choose "fixed", set number of elements). I'd like to have one point where I can set the size of all the arrays at once (since in my case they are all the same size), and let the person using the VI set it to the proper size for whatever application they are using it for (to be clear, let's say I have two uses for this VI, and in one case I have an input array of size 100 and in anohter use of size 1000, I'd like to be able to set these somehow instead of doing it through the dialog). Thanks.
    Solved!
    Go to Solution.

    Unfortunately, per-call configuration of array size is not something that is supported today. This is a great idea, I would suggest that you post it on the FPGA Idea Exchange so we can get a feel for how many other people need this same feature.

  • In InDesign, how does one determine the pixel size of a text box? Specifically, we need to write text to specifications of 600 pixel width, and have no idea a) how to scale a text box to specific pixel width, b) how to

    This may be a basic question... but in InDesign, how does one determine the pixel size of a text box? Specifically, we need to write text to specifications of 600 pixel width, and have no idea a) how to scale a text box to specific pixel width, b) how to determine what word count we can fit in, and c) how to do it in a table? Thanks!

    Set your ruler increments to pixels Preferences>Units & Increments. You can fill the text box with placeholder text Type>Fill with Placeholder text and get a word count from the Info panel with Show Options turned on from the flyout.
    From the Transform panel you can set a text box's width and height

Maybe you are looking for

  • Firefox always shows text fields in light blue. Can't fix it. Help plz. Hate using IE.

    Some web text fields I can type in and I don't see the text just a light blue bar in the field. Other text fields I can see the text I type into them but all the text fields are always light blue. I tried un-installing and re-installing many times. O

  • Canon CameraWindow DC 8.8 crashes on Mac OS X 10.7.5

    I have Canon CameraWindow DC 8.8 with Mac OS X 10.7.5. It was working fine, but since last update, this software is not working anymore. First, when I connected the camera, the software was launched, but now, it start pops up, but stop imediately. Lo

  • Sharing pictures from iphoto to NON-apple users

    Can you share pictures from iPhoto to people that don't have an apple device? Everything I have found says they must have an apple device. I am trying to share a bunch of pictures to a friend that has a Window-based computer. Thanks

  • 00439 : Feature not enabled : Database Queuing

    Hi, I get the "Database queuing not enabled" error. As a result, i cannot create any queues, moreover, the default SYS queues have not got created. Someone advised me to run the following scripts 1) dbmsaqad.sql 2) catqueue.sql 3) catdefrt.sql I did,

  • HELP:  I've created a mess!!

    In an effort to free up space on my Macintosh HD I moved the "music" folder (120 GB) to another internal HD that had tons of room. This folder contains essentially all the content in itunes. When I opened itunes it said that all the files were missin