ScanFile will ignore the zeros

Hi, I use this algorithm for some time in 2012 CVI, but now in 2013 of the CVI, I found that ScanFile does not work the same for me.

I'm not clear, whether it is a question of CVI 2013, or just a sleep bug I had never seen so far.

I'm scanning via a tabs-delimited ASCII log file.  Some "columns" text, others are digital. I prefer to browse the columns in a way not rigid; that is, I'm not strictly following the order of the column as it exists in the log file.  Here's what it looks like:

for (i=0; i%i[x]",&unitData[slot].id);
            break;
        case LOG_COL_SERIAL:
            ScanFile(fileHandle,"%s>%s[xt09]",unitData[slot].serial);        // discard tab (ASCII 0d09)
            break;
        case LOG_COL_REVISION:
            ScanFile(fileHandle,"%s>%s[xt09]",unitData[slot].revision);      // discard tab (ASCII 0d09)
            break;
        case LOG_COL_STAGE:
            ScanFile(fileHandle,"%s>%i[x]",&unitData[slot].logStage);
            break;
        case LOG_COL_RETRIES:
            ScanFile(fileHandle,"%s>%i[x]",&unitData[slot].retry);
            break;
        case LOG_COL_RUNNING:
            ScanFile(fileHandle,"%s>%i[x]",&unitData[slot].running);
            break;
        case LOG_COL_COMPLETE:
            ScanFile(fileHandle,"%s>%i[x]",&unitData[slot].complete);
            break;
        case LOG_COL_ELAPSED:
            ScanFile(fileHandle,"%s>%s[xt09]",elapsedString);    // discard tab (ASCII 0d09)
            break;
        /* Now fill a placeholder string with the remaining fields so that the file pointer stays in sync.*/
        case LOG_COL_DATE:
        case LOG_COL_TIME:
        case LOG_COL_VOLTAGE:
        case LOG_COL_CURRENT:
        case LOG_COL_STATION:
        case LOG_COL_SOFTWARE:
        case LOG_COL_SLOT:
        case LOG_COL_DESC:
        case LOG_COL_COMMENT:
            ScanFile(fileHandle,"%s>%s[xt09]",tempString);       // discard tab (ASCII 0d09)
            break;
    }

The behavior I see now, it's that if I have all zeros in my log file in the numeric columns, these are are ignored until a value is found.  Suggestions?

OK, I found the bug.  It was a little insidious guy!

It turned out that I had an empty value for a column shortly after the creation of the log file.  Thus, there was a double delimiter (two tabs) and ScanFile was apparently stop after the first tab and discard the rest of the reading.

So it's more prudent to conquer strings or values in each column.  Unless there is a safer way to sweep the line.

Tags: NI Software

Similar Questions

  • After you import the avi file to new laptop, reading looks like he will ignore the frameworks

    I created successfully a project of first Pro CS5 using my desktop computer computer (i7 with dedicated NVIDIA graphics card) without any problem. I then imported the video file avi created on my desktop to my old laptop (intermediate level) with the same edition of Premiere Pro is installed and enabled in Premiere Pro create a new project it without any problem reading. After moving first Pro CS5 to my new laptop higher end, I imported the avi file of the desktop to create a new project on the new laptop, but when I went to play the video in Premiere Pro on the new laptop, the picture is shaking during playback as executives are to be ignored. The new laptop is far superior to my old, so I don't know what is the issue. The new laptop is an i7, 64-bit, 8 Gig RAM, NVIDIA GeForce 650 M graphics card.

    Is there a different setting that I needed in Premiere Pro on the new laptop computer?

    Here are the details of video file:

    Image size: 720 x 480

    Sampling: 32

    Frame rate: 29.97

    Audio Format: 48000 Hz - 16-bit - stereo

    Project Audio Format: 48000 Hz - 32 bit floating point - stereo

    Total duration: 00 41; 31; 17

    Average: 3.6 MB/second

    Format of the pixels: 0.9091

    AVI file details:

    Contains 1 track (s) of the video and 1 audio track (s).

    Interleave: 1: 28.99

    Video track 1:

    Size is 8,34 G bytes (medium frame = 123,44 K bytes)

    There are 74673 keyframes.

    Frame rate is 29.970 fps

    Image size is 720 x 480

    The depth is 24 bits.

    Audio track 1:

    The size is 456,22 M bytes

    Rate is 48000 samples/s

    The sample size is 16-bit

    Taking your advice, I discovered an error of 'beginner '. When I imported the AVI from my office, I was a hypothesis that it was copied to the disk on my new laptop... Oops! The glitter is attributable to the project on the laptop trying to access the file through the network traffic. When I copied the avi file on my laptop, then created a new project in the key of my laptop - problem solved. Thank you, Jim, the suggestion on several disks. I'm immediately incorporate.

  • Why loop will ignore the fields?

    PDF has several pages created from templates. My function is to search all the fields with a given prefix and remove these fields to visually clean the final document and reduce the size of the file. For some reason, the function must be called multiple times to find and destroy all the fields, even if they meet the same criteria. Here's the function:

    "Miss" is the prefix of the target
    function selfDestruct (theSecond) {}

    Create an empty variable for target field
    var myFullFieldName;

    Is the number of fields in the PDF file, it traverses the
    for (var i = 0; i < this.numFields; i ++) {}

    Gets the name of the current field
    var fieldInSight = this.getNthFieldName (i);

    Splits the name field into sections and put them in a table
    var fieldNamePieces = fieldInSight.split(".");

    Checks if the field is a target
    If (fieldNamePieces [2] == alinea2d) {}

    If true, it includes the name of the field
    myFullFieldName = fieldNamePieces [0] + '. ' + fieldNamePieces [1] + '. ' + fieldNamePieces [2] + "." + fieldNamePieces [3];
    Show me what is removed
    Console.println (myFullFieldName);
    //
    this.removeField (myFullFieldName);

    } / / end of the if
    } / / end of for
    } / / end of function

    My argument is either 'single', 'double' and so on to find and remove the following (the first prefix varies, of course), for example:

    • P2.actions.single.LeftColumn
    • P2.actions.single.rightcolumn
    • P2.actions.single.resetTextBox
    • P2.actions.single.TopRow
    • P2.actions.single.BottomRow

    Whenever I have it try (either in the console or a button for executing the script), if there is a group of five (see above), it removes three the first time, the second time a fourth and fifth/last field on the third try. Regularly and in the same order each time. I have a 'group' with only two fields share the same prefix, and each time, it removes one, then the other the second time I call the function. I can't understand why he did this or how it determines the order. If there are two or twenty pages with these fields, always happens in the same way in the same order.

    It gets weirder: if I spawn new pages between the call to the function, it leap-frogs get the 'fourth' field he missed the last time and the first three pages newly laid.

    Please enlighten me. Thanks in advance.

    It is an "implicit" table, Yes, and you should treat numFields-1-0.

  • RAM preview will ignore the first second of reading suggestions?

    RAM Preview skip the first second reading, in other words, reading the Preview 1 second after the beginning of the work area.

    In the Preview Panel is not checked the box right now.

    No matter where ICT is in the timeline panel or pointing to my workspace, the RAM Preview starts 1 second after the beginning of the work area. However, after the forecast plays through the first time it starts then where his supposed (beginning of the work area). It just started today and it makes me crazy. I am on a Macbook Pro mid2012, 2.6 GHz Intel Core i7, Yosemite, 2012 CC AE and AE CC2014 (both versions have this problem).

    This bug was introduced by Mac OS x v10.10 (Yosemite). We have worked around this bug in the version of After Effects under development, which is targeted for release this spring.

  • Ignore the ASO - zero data loads and missing values

    Hello

    There is an option that ignores the zero values & the missing values in the dialog box when loading data in cube ASO interactively via EAS.

    Y at - it an option to specify the same in the MAXL Import data command? I couldn't find a technical reference.

    I have 12 months in the columns in the data flow. At least 1/4 of my data is zeros. Ignoring zeros keeps the size of the cube small and faster.

    We are on 11.1.2.2.

    Appreciate your thoughts.

    Thank you

    Ethan.

    The thing is that it's hidden in the command Alter Database (Aggregate Storage) , when you create the data loading buffer.  If you are not sure what a buffer for loading data, see loading data using pads.

  • LogFilter - ignoring the first alarm

    Here's the situation. We have three servers brprlmbpxxx and LogFilter agents deployed on each server. One of the strings match that we monitor is "Communication link failure". Every morning, we get two alerts on each server for a total of six alerts. We were informed by the developers that we can ignore these first six alerts every day. What I'm trying to do is to find a way that we do not have these six alerts but receive alerts later.

    Here is some info on this. These six alerts can come from any time of the day. So, I don't know if there is a way to configure a rule that will ignore the first two "Communication link failure" alerts LogFilter and then draw attention to any warning which follows.

    Hello Raul

    If these alerts are sent at the same time every day, you might have to try a power failure?

    Brian

  • You can change the "From" email address (sender) so that the recipient will not ignore the email as spam?

    I want to change the 'From' (sender) email name and / or address so my recipients do not ignore my eSign as spam emails. It currently shows as coming from "Adobe Document Cloud Services eSign" <[email protected]>.  I would have preferred he be having my name and/or address e-mail partner so that the recipients do not forget it. Given that we have not sent the documents through this platform, historically, customers not expect an email from Adobe Document Cloud Services eSign. It is not convenient for e-mail clients before sending documents for signature, just to make sure they know to look for this e-mail and don't ignore it as spam. This would completely undermine the effectiveness of the use of this product.

    Hi Christine,

    When you start a transaction using eSign e-mail address will be the one you mentioned above, but it also displays the name of the sender. There is no provision to change the E-mail address of the sender.

    Thank you

    Abhishek

  • Why tabs, windows and sometimes ignore the shortcut keyboard (CMD + W)? I keep having to go into file &gt; close tab

    Tabs in Firefox seem to ignore my orders sometimes seemingly random. Perhaps even more so when the tab contains a video, although I could be wrong.

    I use a 13-inch, mid 2009 Macbook Pro installed OSX 10.10.2 (the latest build), but this also happens on 17 inches from my father-in-law, Early - 2008 Macbook Pro as well.

    If a plugin like Flash has focus, then the plugin gets all keys and you have to click outside the plugin to remove the development of the plugin and make the keyboard work again.
    I don't think that protected by Flash mode applies to Mac.

    On a Mac, you may also be unable to move to HTML5 media as an alternative player, because with this drive will work the keyboard shortcuts.

  • Formula for several cells but ignore the 0 values?

    Is there a formula to multiply the three cells that will allow the formula to ignore a cell with a value of 0 and multiply the other two rather than return a result of 0?

    A B C D

    1

    10 2

    5

    100

    2 10 0 5

    0

    For example,.

    D1 = A1 * B1 * C1

    D2 = A2 * B2 * C2

    I would like the result in D2 to 50 (A2 * A2) instead of 0, but for the calculation to use A2, B2, and C2, if the value of B2 is greater than 0.

    Thanks for your help!

    You can take a look at the article, they can help you. Numbers for Mac: calculate values based on data in cells in a table

    Numbers for Mac 3.0: create formulas and use predefined functions

  • If I replace my macbook logic board it will change the series No. ?

    Hello, everyone if I replace my Board of MBA logic to the logic card of 8 GB of ram it will change the serial No. ???

    Yes. According to the place where you get the card serial number logic can be empty or all zeros.

  • How can I keep the zeros before a value?

    Hi guys

    I'm afraid that it will be the first in a series of question that I fall into my first complex program. So far, I've only done small scale, but it is heavier.

    The program will be a series of test for 10 circuits connected in 1 Panel. Each circuit have their own user serialnumber must enter in my program.

    Serial number have a first letter (A = year 2010, B = year 2011 and so forth). After that, there is a five-digit number.

    Example: A00001, A00002, A00003... etc.

    Because there are 10 serialnumbers I would like that the user inputs the first serial number: A00001. Then my program automatically increments the serial number of 1 for each circuit. Given that the letter is changed each year I put it as text to the left of the digital control, if the user only need to enter "00001".

    My program increment the serial number correctly and I can see the serial number for each circuit. The only problem is:

    What I want to see:

    User input: 00001

    SN1: 00001

    SN2: 00002

    ....

    SN10: 00010

    What I see:

    User input: 00001 (turns into 1)

    SN1: 1

    SN2: 2

    ....

    SN10: 10

    LabVIEW removes my zeros to the left of the value. Ways to change this? I tried to change the DBL to i32 or u32. I only managed to get the zeros «,»

    I could probably do any input string, but then I can't increment then user must enter 10 serialnumbers. Where I work, it is very important that the testcrew uses as few times as possible test.

    Thank you and best regards,

    Even

    Just give Format string like '04D %' in numerical order-> advanced editing mode.

    -Claude

  • Convert hexadecimal into decimal and keep the zeros on the left...

    Hello

    I hope you can help us?

    How to convert hex to Decimal and keep the zeros

    I read 002C, hex, and I want to convert it to decimal-0044.

    sscanf (MyNum, % '4 x', & DecNum); will only give me 44.

    It worked until I started having zeros.

    We will always have a 4 digit hexadecimal entry in a range

    We have the 00 leader in this case.

    How is this best?

    Thanks for the help

    Simon

    Hello

    I don't really understand your problem. Is this kind of things that you need?

    int main (int argc, char *argv[])
    {
        const char MyNum[] = "002C";
        int DecNum;
    
        sscanf (MyNum, "%4x", &DecNum);
        printf ("%04d", DecNum);
        getchar ();
    
        return 0;
    }
    

    '0044' appears on standard output when executing the printf function...

  • HP 14-ro24TX Haswell Corei3: will be the Kingston Technology work DDR3L PC3-12800 4 GB 1600 MHz on the HP 14-r024TX Haswell Corei3

    Will be the Kingston Technology work DDR3L 1.35v Non - ECC CL11 Intel SODIMM PC3-12800, computer laptop memory KVR16LS11/4 4 GB 1600 MHz on the HP 14-ro24TX Haswell Corei3?
    If this is not the case, can I have a link to a recommended? Thank you

    Hello

    Your machine is HP 14 -024TX (zero not letter o) r:

    http://support.HP.com/us-en/product/HP-14-notebook-PC-series/6874538/model/7341201/document/c04468296/

    It supports up to 16 GB of RAM as 2 units. Please use the part number on page 56 of the following book:

    http://h10032.www1.HP.com/CTG/manual/c04513798.PDF

    or from

    http://www.crucial.com/USA/en/compatible-upgrade-for/HP---Compaq/HP-14-r024tx

    Kind regards.

  • How to eliminate or remove the zeros of table 1 d

    How to remove or delete the zeros of table 1 d. Let's say I table 1 d with following elements

    "0 0 0 0 0 4 0 0 9 0 0 1 4 0 0 0 0 0 0 0 0 10 9 0 0.

    So after deletion or removal of zeros, it will become as follows

    "4 9 1 4 10 9.

    So any body can guide me how I can do? See picture attached for more details.

    Thank you

    JK

    I do not know this post might help you.

  • compare the time while ignoring the date

    I have this...

    "In the beach?" is always false no matter what that right now. I guess it's because the date is included in the comparison function.

    I need to compare these time and ignore the date. I can't find a way around it. The time will be the same every day and I would like for them

    to be one of the constants.

    Any help?

    Thank you.

    Try formatting the date in a string that does not include the day (only the hours and minutes).

    Tim W.

    Engineering applications

    National Instruments

    http://www.NI.com/support

Maybe you are looking for