Bug when searching array of refnum

This one just bit me so I thought I should share.  It looks like the Search 1D Array function behaves unexpectedly when used with an array of VI refnums.  So far I have only reproduced it in LabVIEW 2009 SP1, but I ran some code in 8.6.1 that seemed to have the same symptoms.
When I run the code above, I always get a zero for the output "index of element".  In the example shown I expect to get 3.  In fact if you change that 3 on the array index to any number, you get zero on the output.  My workaround is to typecast the refnum array to an array of I32 and also typecast the refnum that I'm searching for.  That makes it work, but I'm still freaked out by the odd behavior.
Note that the VI you throw the snippet into must be reentrant.  I believe the search is getting confused because the refnums all point to the same VI, albeit different instances of that VI.  Of course, that is the whole point of using the search 1D array function.  I am trying to identify a particular instance. 

Photon Dan wrote:
This one just bit me so I thought I should share.  It looks like the Search 1D Array function behaves unexpectedly when used with an array of VI refnums.  So far I have only reproduced it in LabVIEW 2009 SP1, but I ran some code in 8.6.1 that seemed to have the same symptoms.
When I run the code above, I always get a zero for the output "index of element". 
 I believe the search is getting confused because the refnums all point to the same VI, albeit different instances of that VI.  Of course, that is the whole point of using the search 1D array function.  I am trying to identify a particular instance. 
Somewhat poor assumption.
"Different instances of the same vi"  It Would be more correct to say the referances are all the same as they point to the same constant.  Therefore since A [] are all the same you are returning the first match index 0.
Probe the array to confirm.
Turn on "Show constant folding" to see that the Loop doesn't really run 
Jeff

Similar Messages

  • Bug: when fetching arrays of rows with null data values

    Using Oracle ODBC Driver 8.01.73.00 or 8.01.74.00 (called
    8.1.7.3.0 and 8.1.7.4.0 on the Oracle downloads page).
    When fetching multiple rows, and where some of the data is null,
    the the indicator variable quite often (but not always) has
    incorrect values.
    Is this a known bug? This seems like something that lots of
    people would encounter so I find it hard to understand why it
    hasn't already been fixed.
    Also, how do I report this as a bug to Oracle? I couldn't find
    the place on the site to do this.
    To reproduce:
    Create the following data in Oracle
    create table null_test
    item_id number (10, 0) not null,
    data1 number (10, 0) null,
    constraint null_test_pk1 primary key (item_id)
    insert into null_test (item_id) values (1);
    insert into null_test (item_id) values (2);
    commit;
    When you run the code to print out indicators and values, you
    get this output
    4: 1 -1:
    4: 2 0:-858993460
    The code to do this is as follows (put in your own values for
    the #defines at the top)
    #include <windows.h>
    #include <sql.h>
    #include <sqlext.h>
    #include <stdio.h>
    #define DB_NAME ""
    #define USER_NAME ""
    #define PASSWORD ""
    #define TEST_RETVAL(R) if (R != SQL_SUCCESS && R !=
    SQL_SUCCESS_WITH_INFO) return 1;
    int main()
         SQLRETURN retval;
         SQLHENV henv;
         retval = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE,
    &henv);
         TEST_RETVAL(retval);
         retval = SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION,
    (void*)SQL_OV_ODBC3, 0);
         TEST_RETVAL(retval);
         SQLHDBC hdbc;
         retval = SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc);
         TEST_RETVAL(retval);
         retval = SQLConnect(hdbc, (unsigned char*)DB_NAME,
    SQL_NTS, (unsigned char*)USER_NAME, SQL_NTS, (unsigned char*)
    PASSWORD, SQL_NTS);
         TEST_RETVAL(retval);
         SQLHSTMT hstmt;
         retval = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt);
         TEST_RETVAL(retval);
         const char* Query =     "select item_id, data1 from
    null_test order by item_id";
         const int NumRows = 13;
         int NumRowsFetched;
         retval = SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_BIND_TYPE,
    SQL_BIND_BY_COLUMN, 0);
         TEST_RETVAL(retval);
         retval = SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_ARRAY_SIZE,
    (void*)NumRows, 0);
         TEST_RETVAL(retval);
         retval = SQLSetStmtAttr(hstmt,
    SQL_ATTR_ROWS_FETCHED_PTR, &NumRowsFetched, 0);
         TEST_RETVAL(retval);
         SQLINTEGER rgnItemId[NumRows], rgnData1[NumRows],
    rgnData2[NumRows];
         SQLINTEGER rgnItemIdInd[NumRows], rgnData1Ind[NumRows],
    rgnData2Ind[NumRows];
         retval = SQLBindCol(hstmt, 1, SQL_C_LONG, rgnItemId, 0,
    rgnItemIdInd);
         TEST_RETVAL(retval);
         retval = SQLBindCol(hstmt, 2, SQL_C_LONG, rgnData1, 0,
    rgnData1Ind);
         TEST_RETVAL(retval);
         retval = SQLExecDirect(hstmt, (unsigned char*)Query,
    SQL_NTS);
         TEST_RETVAL(retval);
         for (int i = 0; i < NumRows; i++)
              rgnData1Ind[i] = rgnItemIdInd[i] = rgnData2Ind
    = 0;
         while ((retval = SQLFetchScroll(hstmt, SQL_FETCH_NEXT,
    0)) != SQL_NO_DATA)
              TEST_RETVAL(retval);
              for (int i = 0; i < NumRowsFetched; i++)
                   if (rgnData1Ind[i] == SQL_NULL_DATA)
                        printf("%2d:%5d %2d:%6s\n",
    rgnItemIdInd[i], rgnItemId[i], rgnData1Ind[i], "", rgnData2Ind
    [i], rgnData2[i]);
                   else
                        printf("%2d:%5d %2d:%6d\n",
    rgnItemIdInd[i], rgnItemId[i], rgnData1Ind[i], rgnData1[i],
    rgnData2Ind[i], rgnData2[i]);
              for (i = 0; i < NumRows; i++)
                   rgnData1Ind[i] = rgnItemIdInd[i] =
    rgnData2Ind[i] = 0;
         retval = SQLCloseCursor(hstmt);
         TEST_RETVAL(retval);
         retval = SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
         TEST_RETVAL(retval);
         retval = SQLDisconnect(hdbc);
         TEST_RETVAL(retval);
         retval = SQLFreeHandle(SQL_HANDLE_DBC, hdbc);
         TEST_RETVAL(retval);
         retval = SQLFreeHandle(SQL_HANDLE_ENV, henv);
         TEST_RETVAL(retval);
         return 0;

    We get this problem too. We do a large fetch (200K rows)and find
    that not only do the null indicators report incorrectly, but the
    data for the nullable column is corrupt as well.

  • Redraw bug when searching for text

    I have discovered a bug in CVI 2012 SP2, 13.0.2 (278).  It has to do with the MDI windowing interface and text searching.  Here are the steps to reproduce this.
    1) I have chosen to have my code and UIR windows open in a non-maximized manner.
    2) Now, open at least two windows so they overlap.
    3) Do a multi-file search
    The current position index of a code window either in our out of focus gets moved by several lines.  But! The text on this window doesn't get refreshed though, resulting in some strange artefacts.  Examples:
    Another...
    A curious workaround is if you resize slightly the offending window, all the contents "snap" back to the new scroll index.
     

    Oh dang, you're right.  2013 SP2.
    It seems to only happen with CTRL + SHIFT + F (multi-file find).  Here's a better reproducible procedure:
    CTRL + SHIFT + F on a keyword / string
    In the results window, double-click one in a different file, not the file you started the CTRL + SHIFT + F search on!
    Now, get back to the original source file that you started the CTRL + SHIFT + F search on.  Then you'll see the bug.
    Seems to be irrespective of particular *.c or *.h files.  Any source/header file will do.
    Yes, to fix the bug instantly, simply resize the offending source/header file in any dimension, and display bug disappears.

  • Annoying problem when searching contacts

    Ive got an N81 and this is the first time ive had a nokia in years. My previous phones never had this problem.
    When searching the phonebook, lets say i press 'M' not only do the contact that start with 'M' come up but also for example a contact by the name of 'Dave M' or 'John Mob' as the second word begins with 'M'. Is there a way just for the first word that starts with 'M' to come up eg. 'Mary' and not for contacts that contain 'M' in the second or thrid word. Hope I make sense.
    Can you please implement this in the next firmware for the N81?
    Thanks

    that error is because of:  http://bugs.archlinux.org/task/20371
    just use http over ftp and it would be fine

  • IE opening multiple windows when searching google only.

    We have a problem where IE opens multiple windows when searching in Google. As a result of this we are receiving Google sorry page informing us that Google is receiving automated search requests from our public IP. Is there any quick fix to this problem
    apart from restoring and reset setting  in IE.
    Is anybody else facing this issue.?
    REgards
    Nahas

    Hi Nahas,
    Thank you for your update.
    Based on the current situation, you may remove any Google domains in your trusted sites for a test.
    Tools>Internet Options>Security tab, click "Reset all zones to default"
    Trusted sites icon, 'Sites' button. Remove any Google domains in your trusted sites list.
    For more information, you may refer to:
    Understanding Zone Elevation
    http://blogs.msdn.com/b/ieinternals/archive/2012/09/24/zone-elevation-security-warning-websites-in-less-privileged-zone-can-navigate-csrf-xss-protection.aspx
    Also, you may try to contact Google to confirm this.
    http://support.google.com/?hl=en
    If you wants to report a bug to Microsoft. I would like to share the link below with you.
    https://connect.microsoft.com/
    Thanks for your understanding.
    Regards,
    Blair Deng
    Blair Deng
    TechNet Community Support
    Spot on Blair. Thanks for the fix!
    Worked for me:
    Tools>Internet Options>Security tab, click "Reset all zones to default"

  • Latest patch has a bug in search box

    I Searched for books in my collection and removed al text from the search box. Since then my collection  is showing empty when search box is empty and shows only when I type some thing in the search field. I re. Installed the app but still the same problem.
    I am typing a e I o u in the search box because the titles will have atleast these vowels
    pplease fix tis

    We are fellow users here on these forums, if you want to leave feedback for Apple then you can do so via this page : http://www.apple.com/feedback/ibooks_ios.html (there is a 'bug report' option in the 'feedback type' box on that page)

  • AR9.x bug in search facility

    The attached test sheet, which is also available at:
        http://www.galcit.caltech.edu/~jjq/4adobe/search-bug.pdf
    shows that there is a bug in the search facility of AR9.x .
    The bug is particularly insidious as it causes AR to exit
    without warning.
    James Quirk

    I've now had a chance to try the search-bug.pdf on a Ubuntu 9.04 machine,
    the behaviour is certainly different than on my SUSE 10.3 box. AR9.x
    passes the test as written i.e. it can find the word "quick." But if I reload
    the document and search for another one of the test words (e.g. fox)
    AR fails to find the word. Therefore I'm left wondering if the search
    facility is accessing an unitialized variable, resulting  in variable behaviour.
    Another observation which backs this up is that on the SUSE 10.3
    box,  AR9.x does not exit when searching for the /Widget text "quick"
    provided one first searches for a word in the regular page stream.
    However it fails to locate the word, again indicating that something is amiss.
    James
    p.s. Is there any reason why AR9.1.3 cannot be run using strace?
    I tried, but unlike previous AR releases it causes my X-server to hang.

  • Scroll bug in search result in contacts

    Got a bug in contacts when search result need to scroll (more than 10 results) cant choose last result contact. Its scroll away every time you trying to scroll it.

    I'd similar problems.
    The search option didn't find many massages I posted.
    Searching for JClient gives just a single item !!!!
    What's wrong ?
    TIA
    Tullio

  • [svn] 3791: Fix bug when resetting stylesheet on FxApplication

    Revision: 3791
    Author: [email protected]
    Date: 2008-10-21 13:23:09 -0700 (Tue, 21 Oct 2008)
    Log Message:
    Fix bug when resetting stylesheet on FxApplication
    SDK-17691 RTE loading styles
    When the FxApplication replaces its style sheet, it unloads the previous skin and loads in a new one. With the new skin, it creates a new instance of the contentGroup. However, when the content is added to the contentGroup, it has already been parented by the previous version of the contentGroup. This causes the RTE because the content is not in the correct state.
    The solution is to set the old contentGroup's content property to null when we remove the skin. We also force the contentGroup to validate immediately because the new contentGroup was processing its content array before the oldGroup had removed the content as children.
    QE Notes: Needs testing
    Doc Notes: none
    Bugs: SDK-17691
    Reviewer: Glenn
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17691
    http://bugs.adobe.com/jira/browse/SDK-17691
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxContainer.as

    The password history check is not honored in a password reset. It always been like that and it is documented:
    "Password History Length Constraint: If all of the following conditions are true, the following constraints MUST be satisfied:
    The requesting protocol message is a password change (as compared to a password set)."http://msdn.microsoft.com/en-us/library/cc245669.aspx
    So changing it is not a correcting a bug but asking to change the design. From a pure support perspective, you switched from bug request to design change request. Which might still be arguable if you have a solid business case.
    Password set is given through an extended right, so by default only administrators or operators have this right. So it comes down to trust those individual. If you cannot, then you don't give them the right and you implement other identity
    management solution (Password Self Reset for example).
    Other fancy and not useful information:
    http://msdn.microsoft.com/en-us/library/cc245692.aspx 
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  • Compare and search array

    Hallo
    I have to compare a input data and the ideal data. so far i have understood how to do comparision but the problem create when ideal array have same element with different respective value , similarly input dat are appears to be also same but while doing search in final output array  in 3 column looks different than as it should be.
    hope you understand my problem
    thanking you
    BR
    kalu
    Solved!
    Go to Solution.
    Attachments:
    array%20(modified)[1].vi ‏17 KB

    Hi Kalu,
    Check the attached VI. Let me know if it helps.
    Regards,
    Nitz
    (Give Kudos to Good Answers, Mark it as a Solution if your Problem is Solved)
    Attachments:
    array (modified)[1].vi ‏17 KB

  • Problem searching array

    I have an array in a column that I extracted from a data file. I want
    to search the array for particular values and return the index which
    is easily implemented by the search 1d array subvi. However, when I
    input the values to search, it returns a -1 for some values and others
    it finds fine where I know all the values exist. To be more precise,
    my array is about 80 values between -2 and 2 in steps of 0.05. When I
    search for -2, -1.5, -1, etc., I get the correct index. When I search
    for other numbers like -1.8, -1.7, -1.85, etc., I get a return value
    of -1. It is really strange and I am not sure of the problem. Anyone
    have any ideas? Does it have anything to do with the precision or how
    I read the spreadsheet file to extract the column?
    T
    hanks
    Heather

    Thanks for all your help. I ended up converting both the search array
    and the search element to strings with 2 decimal point precision and
    it works fine.
    You guys are the best.
    Heather
    [email protected] (H) wrote in message news:<[email protected]>...
    > I have an array in a column that I extracted from a data file. I want
    > to search the array for particular values and return the index which
    > is easily implemented by the search 1d array subvi. However, when I
    > input the values to search, it returns a -1 for some values and others
    > it finds fine where I know all the values exist. To be more precise,
    > my array is about 80 values between -2 and 2 in steps of 0.05. When I
    > search for -2, -1.5, -1, etc., I get the correct index. When I
    search
    > for other numbers like -1.8, -1.7, -1.85, etc., I get a return value
    > of -1. It is really strange and I am not sure of the problem. Anyone
    > have any ideas? Does it have anything to do with the precision or how
    > I read the spreadsheet file to extract the column?
    >
    > Thanks
    > Heather

  • Cumbersome bug when launching Fireworks Creative Cloud

    Hi,
    I have one year suscription of Creative Cloud and just few weeks since I started using it I found a cumbersome bug when launching Fireworks. The problem:
    Note: I'm on latest Mac OSX Lion 10.8.5 (but 10.8.4 has the same problem, I think even 10.8.3).
    When launching Fireworks, it never gets up and running. I had to search in google and see that other people having the same problem, and after spending lot of time I get a workaround:
    You have to go to Library -> Preferences and remove "Macromedia" folder. Then you can launch Fireworks and will run ok.
    So I would want to ask here if there's something I can do to avoid to do this over and over each time the Macromedia folder is regenerated. If not, could we get a patch for Fireworks that fixes this annoying problem?
    Thanks

    Thanks Abhijit.
    When you install CC apps using Creative Cloud, it creates shortcut in the Start menu.
    I've already done that, but there seems to be nothing in my Creative Cloud Desktop that allows me to activate the program I wish. It just tells me what is installed, CC programs and what has ben updated.
    If you are not able to to find photoshop CC icon in the start menu, please go to to ....
    As I previously mentioned, I've done that but there is no Photoshop.exe in my Photoshop CC file.
    Might it be that I've downloaded Creative Cloud from the Japanese Adobe site, I'm in Japan? Having lived in Japan for 20 years and knowing how ethnocentric this place is, to the point of them making it difficult to buy or use anything which isn't Japanese and would otherwise weaken the mercantilist ethos of the place.
    I hope not, but..... both your solutions are not enabling me to activate ant CC program.
    Thanks.

  • TS4002 I'm trying to create a new apple-id but when typing the email adress I want to use I'm told that the particular email adress is not allowed but when searching I can't find same being used. How do I find out where that particular email adress is use

    I'm trying to create a new apple-id but when typing the email adress I want to use I'm told that the particular email adress is not allowed When searching I can't find same being used anywhere. How do I find out where that particular email adress is used so I can delete it there and use it for my new apple-id?

    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up     
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        
    Also
    If you have Find My iPhone enabled, you can use Remote Wipe to erase the contents of your device. If you have been using iCloud to back up, you may be able to restore the most recent backup to reset the passcode after the device has been erased.

  • Hi I'm running Addressbook and cannot clear previous entry easily when searching my data base of around 5,000 contacts.    I prefer to view in All contacts on a double page spread with details on the right page.  Searching doesn't seem to work correctly i

    Hi I'm running Addressbook and cannot clear previous entry easily when searching my data base of around 5,000 contacts. 
    I prefer to view in All contacts on a double page spread with details on the right page.  Searching doesn't seem to work correctly in this view.
    It's always the second search that is problematic.
    I've tried typing over and all it seems to do is confine the search to the the entries that have come up for the previous search.
    I've tried to use the x to clear the previous entry and then type the next search, same problem.  The only way seems to be to move from "All Contacts" to "Groups".  Then the searched name appears and I can return to All Contacts to see full details.
    Surely three key press' are not the way it's supposed to work?
    FYI
    Processor  2.7 GHz Intel Core i7
    Memory  8 GB 1333 MHz DDR3
    Graphics  Intel HD Graphics 3000 512 MB
    Software  Mac OS X Lion 10.7.3 (11D50d)
    Address book Version 6.1 (1083)
    MacBook Pro, Mac OS X (10.7.1), 8Mb RAM 2.7Ghz i7

    AddressBook experts are here:
    https://discussions.apple.com/community/mac_os/mac_os_x_v10.7_lion#/?tagSet=1386

  • When searching the calendar in list view, appointments erlier than a few years could not be found after search. en appointment from 1974 could not be found although it appears in the list.

    When searching the calendar in list view, en appointmet erlier than a few years could not be find although the appointmet is listed in the List wiew ???,
    An appointment from 1974 could not be found, in SEARCH MODE, although it appears in the calendar.

    Pardon me for a moment while I (politely) rant in your general direction...
    This type of response is not just unhelpful—it is the antithesis of helpful.
    This is a support forum. Its purpose is helping to resolve people's problems. Sometimes those problems are going to require long explanations or lots of information. That either comes out in the original post or over the course of several back-and-forth replies; the former produces long posts but takes less time overall than the latter.
    If you don't have the patience to read through a long post, then just move on. Posting a "too long, didn't read" comment adds nothing beneficial to anyone. All it does is reveal that the person who made that comment thinks it's important to tell everyone that their attention span is too short for anything longer than a tweet.
    Yes, my post was long. Had you read it, you might have understood why it's so long. I'm trying to provide information that people searching these forums about this problem might find helpful. I did this because when I searched for info on this problem, I found lots of people with a similar problem, but no answers that went beyond "restore from backup". Since that advice wasn't the solution for me, I decided that more information might prompt someone with more knowledge and access than I have to investigate. Since you couldn't be bothered to read it, you clearly aren't the kind of person whose attention I was hoping to catch.
    Certainly I could have made the post shorter, but I think putting it into a narrative like this makes it easier to follow and provides a context that a terse recitation of bare facts does not. If you disagree, that's your prerogative, but please don't waste everyone else's time by posting a comment just to say that you didn't read it.
    I find it appalling that someone who's able to reach Level 6 on these support forums would post a "tldr" comment. That does not reflect positively on you or these forums.
    End of rant.

Maybe you are looking for

  • Any hope for music integration?

    I was just wondering if there was a chance for a future firmware update to intergrate the SD memory and onboard memory of songs. Also for the songs to play by album order and not alphabet order, and for there to be a more than 2000 song limit. I have

  • How to make clone of active directory security group

    Hi i am having one Security group in AD, i want to make copy or clone of that group with same members in different name in AD. Anybody help me out...

  • Why can't I play some of my songs?

    I just updated to iOS 5, and as I was scrolling through my songs on my iPod touch, a large majority of the songs names are tinted in grey, and cannot be played. Why is this? And how can I fix it? Anyone?

  • Crystal Report Query Advice

    Dear Guru,      Please find below, two queries which I have to show simultaneously in Crystal Reports. Showing Sales and Incoming of the said month. Incoming are irrespective invoice (i.e. invoice from previous months as long as the Incoming is in th

  • How to delete archive log by RMAN.

    Hi All, How to delete archive log by RMAN and what is the difference between delete all input & all delete input in RMAN backup.