ImgSessionStatus returns -1 for bufferIndex : what's wrong?

I am using LabWindows/CVI, and I created a low-level ring acquisition. It works normally at first, but if I stop it and start a few times (does not always happen on the first stop / start cycle), then on the third session the function imgSessionStatus passes back "-1" for the active buffer index.  Why would it do this??
Code:
error = imgSessionStatus(Sid, &status, &currentRingBufNum);
Which is usually followed by, except when currentRingBufNum has been set to "-1" by imgSessionStatus.
error = imgSessionCopyBuffer(Sid, currentRingBufNum, (uInt8*)mainImage, FALSE);
I stop my acquisition by :
imgSessionAbort(Sid, &ringBufNum);
Then I unlock my ring buffer, dispose each element, dispose of the buffer list, close the session and then the interface. The next acquisition starts by opening the interface, opening a session, creating a buffer list, creating and allocating each element, locking the buffer list, and configuring the session to use that buffer list. Why do I get this error??
Buffer creation code:
imgCreateBufList(NUMRINGBUFFERS, &Bid);
imgGetAttribute(Sid, IMG_ATTR_BYTESPERPIXEL, &bytesPerPixel);
bufSize = AcqWinWidth * AcqWinHeight * bytesPerPixel;
for (i = 0; i < NUMRINGBUFFERS; i++)
imgCreateBuffer(Sid, IMG_HOST_FRAME, bufSize, &ringBuffer[i]);
imgSetBufferElement(Bid, i, IMG_BUFF_ADDRESS, (uInt32)ringBuffer[i]);
imgSetBufferElement(Bid, i, IMG_BUFF_SIZE, bufSize);
bufCmd = (i == (NUMRINGBUFFERS - 1)) ? IMG_CMD_LOOP : IMG_CMD_NEXT;
imgSetBufferElement(Bid, i, IMG_BUFF_COMMAND, bufCmd);
imgMemLock(Bid);
imgSessionConfigure(Sid, Bid);
Buffer disposal code:
if (Bid) imgMemUnlock(Bid);
for (i = 0; i < NUMRINGBUFFERS; i++)
if (ringBuffer[i] != NULL)
imgDisposeBuffer(ringBuffer[i]);
ringBuffer[i] = NULL;
if (Bid) imgDisposeBufList(Bid, FALSE);
Bid = 0;

I thought I would post an update in case anyone else has this problem.  I have not solved it, but a work around has essentially made it a non-issue.  imgSessionStatus returning "-1" only seems to occur on the first attempted frame grab, so I simply have my frame-grabbing callback ignore any buffers returned as "-1".  On all future iterations until the acquisition is halted, imgSessionStatus returns good buffers.
Additionally, error trapping reduced this headache while I was developing and troubleshooting it.  I wrapped all IMAQ functions with:
error = imgSessionStatus(arguments);
if (error) showError(error);
Nothing new or innovative, of course, but it was helpful.

Similar Messages

  • OK, once and for all, what is wrong with my Bluetooth!

    My warranty runs out in 3 weeks, so I need to know if I need to have my Mac sent away for repair.... again.
    I've had the mouse replaced, and it does respond better. I've tried a PRAM reset, that was supposed to stop my keyboard from disconnecting intermittently.
    But just now my setup did what it keeps doing and has been doing ever since i started using bluetooth. The keyboard disconnects, and then the mouse goes all jumpy when I move the arrow. It comes backs after a minute or two usually.
    Why is this happening?

    Welcome to the club. I've had the same problems for many months, and I've tried every conceivable fix to no avail. I'm no newbie, by the way. I've tried at least 20-25 different "suggestions" and nothing worked. I got so sick of the situation that I finally hooked up my Apple Pro keyboard and dumped the wireless unit (which used to work perfectly under Tiger and earlier versions of Leopard). By the way, I always lost Bluetooth connectivity when I had significant video activity going on, like video podcasts. I also lost Bluetooth totally when I went into Time Machine; both the wireless keyboard and mouse became useless every time. I'm convinced it's a software issue. I'm now wired with my trusty trackball and my wired keyboard and the machine purrs like a kitten. This is the only issue since 1984, when I started with Macs, that I have never been able to solve. My greatest disappointment with Apple.

  • Ipod touch 1st gen is frozen, all I see is Apple logo for 10 secs and then screen goes black. What's wrong with it?

    My ipod touch (1st gen) is frozen and does not respond. All I can see is the Apple logo for around 10 seconds and then screen returns to black. What is wrong?

    Did you already try to connect in recovery mode and restore? iPhone and iPod touch: Unable to restore

  • Google image search in ipad - returns blank page, what's wrong?

    while searching, under image tab, returns blank page.
    what's wrong?

    Works fine for me. Probably a google problem.

  • Hello, I would just like to report the little problem with the apple store. When I try to download an app it loads for about 2 seconds and then it stops downloading! I don't know what's wrong

    Hi, when I try to download an application the app stores downloads it for about 2 seconds and then it stops downloading it! I don't know what's wrong?

    Try This...
    Close All Open Apps... Sign Out of your Account... Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    Wait for the Apple logo to Appear...
    Usually takes about 15 - 20 Seconds... (But can take Longer..)
    Release the Buttons...
    If no joy...Reset all settings
    Settings > General > Reset > Reset all Settings.
    This will return all iDevice settings to factory defaults... you will not lose any data.... But you will have to re-enter all of the device settings.

  • Mac OS X 10.6.8 desktop goes black 10 secs after booting, can remain apparently asleep for 15 mins. I can't prompt it to wake, until recently it would wake when peripheral were added (earphones). What is wrong, and how can this be fixed?

    Mac OS X 10.6.8 statup problem: desktop goes black 10 secs after booting, can remain apparently asleep for 15 mins. I can't prompt it to wake, until recently it would wake when peripheral were added (earphones). What is wrong, and how can this be fixed?

    You need to fresh install 10.6, programs fresh form original sources and return only vetted files (no TM migrations) from a regular storage drive
    But this when erasing the drive use the Security Option: Zero All Data before installing 10.6
    What has happened your data got corrupted and it's corrupted on the TM drive too.
    So the Zero will map off bad sectors on your drive, the 10.6 install will be fresh, the programs will be fresh and only files will be returned, you'll find out in short order which ones they are.
    Reducing bad sectors effect on hard drives
    How to erase and install Snow Leopard 10.6
    Once you are back up, then consider making a option key bootable clone.
    Most commonly used backup methods explained

  • A few days ago i bought the macbook pro in a Providence. In late Summer i will come back to my Country - Ukraine. I would like to know about a tax for my laptop. Can i return tax? Through the TAX FREE or return in airport? What should i do?

    A few days ago i bought the macbook pro in a Providence. In late Summer i will come back to my Country - Ukraine. I would like to know about a tax for my
    laptop. Can i return tax? Through the TAX FREE or return in airport? What should i do?

    You need to talk with the tax authorities in the countries to which you traveled and that of your home country. We are all end-users liek you and not Apple agents.

  • HT1688 I recently upgrade my Iphone but the old one is still active. I installed the friendjectory app on my new phone but it will not open but for a few seconds ab=nd then closes. What is wrong and what do I need to do to make this app work on my new pho

    I recently upgraded my Iphone. Iinstalled the friendjectory app on the new phone but it will not open but for  few seconds and then closed. What is wrong and what do I need to do? My old phone is still active and working. Do I need to do something about that?

    Hi stanczak53,
    Welcome to Apple Support Communities.
    See this link for some tips on troubleshooting apps on your iPhone:
    Using apps on your iPhone
    http://www.apple.com/support/iphone/assistant/application/
    Best,
    Jeremy

  • HT4623 what is wrong when my iphone says, an error occurred while checking for updates

    what is wrong with my iphone,when i try to make software updates, i get a error message

    Try rebooting your iPad and then see if you have any success updating.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • 180 GB of my 639-GB Macintosh hard drive is used. 320 GB of my 498-GB Tie Capsule is used. Only one backup ("now") exists for the Time Capsule, which can no longer backup because of "insufficient space". How come? What is wrong?"

    180 GB of my 639-GB Macintosh hard drive is used. 320 GB of my 498-GB Tie Capsule is used. Only one backup ("now") exists for the Time Capsule, which can no longer backup because of "insufficient space". How come? What is wrong?"

    Thank you William for your most helpful response. I shall deal first with your three comments:
    Not being tech savvy, I would not have been able to make that call myself but it sure makes sense.
    I have updated my profiles as you suggest.  Excellent tip.
    This guidance is good.  Being new to Apple Support Communities, I did not find the field a labeling and guidance to be clear, a point you make.  Now I know, I shall do as you say and will use the small slim box as a header to the full message/question, which will place in the larger box below.
    Secondly, I come to your question: Did anything change on your Mac recently, such as replacing the disk or main logic board?
    The answer is “yes”.  Two events have happened both of which concerned the Time Capsule:
    The telephone company, with which I have access to the Internet and I have my email account, installed a new modum.  After the technician left I had to try and get the Time Capsule and WiFi working again which ended with my having to call Apple for technical assistance.  The Apple technician walked me through a number of procedural steps which effectively re-set up the Time Capsule. 
    Access to the Internet failed and the telephone company reset the modum.  I had to call Apple again.  This time the technician did not reset the Time Capsule but walked me through a number of steps tha included renaming the “site”  (not the Time Capsule).
    Another piece of information that may be relevant is that the MacBook Pro uses the Time Capsule for backup.  Everything appears to be in order.  When I enter the Time Capsule for this laptop I have backups going back for a long time.
    Also, I do a weekly backup of the two computers onto another external hard drive using the Time Machine software.  So I have another backup of both computers.

  • WHAT IS WRONG WITH THIS BROWSER? I NO LONGER USE IT. IT SHOWS A TAB FOR THE EWEBISIT, I CAN'T GET TO IT. I GO I IE EXPLORER INSTEAD OFDEALIG WITH THIS

    == Issue
    ==
    Firefox is having problems with certain web sites
    == Description
    ==
    I HAVE TO USE ANOTHER BROWER. T5HIS HAPPEN WAY WYWA WAY TOO MUCHN.
    <blockquote>language cleaned up by a moderator - eh
    https://support.mozilla.com/en-US/kb/Forum+and+chat+rules+and+guidelines</blockquote>
    == URL of affected sites
    ==
    http://COREL.COM
    == Troubleshooting information
    ==
    YOU ARE BLOCKING A LEGIT SITE. I HAVE TO USE ANOTHER BROWER. THIS HAPPEN WAY WYWA WAY TOO MUCHN.
    == Firefox version
    ==
    3.6.3
    == Operating system
    ==
    Windows XP
    == User Agent
    ==
    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
    == Plugins installed
    ==
    *-Adobe Acrobat Plug-In Version 7.00 for Netscape
    *NPCIG 1.0.0.3
    *1.9.0009.1
    *NPRuntime Script Plug-in Library for Java(TM) Deploy
    *Shockwave Flash 10.0 r22
    *Windows Presentation Foundation (WPF) plug-in for Mozilla browsers
    *Npdsplay dll

    Hello and thanks for responding. I don't have any add-ons. I have extensions, but they all seem appropriate. Extensions for java. I really don't add anything unless it is necessary. It seems this browser which used to be so fast is soooooo slow. It is horribly slow to open, even though I now have an extremely fast fios connection. I have read up on how to make it faster and tried a few things, they never last.
    I have a very good Norton security and I scan, but if it is something that got by, I don't know.
    But this used to be such a wonderful browser, now I hate it. I am avoiding using it. It does quirky stuff like that, when I went to the website, I had to click for support, and it was just a tab and blank page, and I was in a hurry, I needed help, I had a lot fo info to put in to tell who I was, veryify Iu had the damn software, and this browser is making my life miserable?
    well I don't need that.
    I am tired of trying to figure out what is wrong.
    What is really frustrating is not having the support. I think if they put out a browser they want people to use, they need to have support.
    I am so afraid of making it worse, I would not take any of the add-ons.
    Also, I have a twitter account in which I sell items and these are listed from one online marketplace. However, when I try and try and try and try to log in from Amazon, it never accepts my password. I thought it was a problem with twitter, now I think it is this crazy browser.
    Thanks for trying to help. I think the makers need to fix it, too many problems no support from its creators.

  • HT1351 my iphone will no longer sync music remains stuck on  'step 6 of 6', I have left it for 1,5 hrs any ideas what is wrong ?  THere is  4.6 GB  space left!

    My iphone will not sync music, I have done it many times before , there is 4,6  GB space it just remains stuck at step 6 of 6 for over an hour, any ideas what is wrong?

    You may need to do a Restart or Reset
    http://support.apple.com/kb/ht1430

  • I have been using facetime on my iphone for a while and after the recent, ios update, I cannot seem to use the facetime. What went wrong?

    I have been using facetime on my iphone5 for a while and after the recent IOS update, I cannot seems to use my facetime any longer. what went wrong?

    'The installer has insufficient privileges to modify this file C:\Program Files (x86)\Common Files\Apple\Apple Application Support\Web kit.resources\inspector\Images\Spinner Inactive Selected.gif.'
    That one's consistent with disk/file damage. The first thing I'd try with that is running a disk check (chkdsk) over your C drive.
    XP instructions in the following document: How to perform disk error checking in Windows XP
    Vista instructions in the following document: Check your hard disk for errors
    Windows 7 instructions in the following document: How to use CHKDSK (Check Disk)
    Select both Automatically fix file system errors and Scan for and attempt recovery of bad sectors, or use chkdsk /r (depending on which way you decide to go about doing this). You'll almost certainly have to schedule the chkdsk to run on startup. The scan should take quite a while ... if it quits after a few minutes or seconds, something's interfering with the scan.
    Does the chkdsk find/repair any damage? If so, can you get an install to go through properly afterwards?

  • My iPhone 4S won't turn on it's been off for two days now. I tried charging it but it makes a noise every 8 seconds,holding the buttons down and also plugging it to a computer. I need help on what to do or if anybody can tell me what's wrong with my phone

    My iPhone 4S won't turn on it's been off for two days now. I tried charging it but it makes a noise every 8 seconds,holding the buttons down and also plugging it to a computer. I need help on what to do or if anybody can tell me what's wrong with my phone

    Yes ive tried a different charger and it also nothing shows when i plug it in just makes a noise

  • What's wrong with my code for comparing date retreived from db and sysdate?

    Hi all,
    I need to retrive date from the DB and compare it to system date.i have posted the code below.i get java.sql.SQL Exception:Io exception:Socket closed.
    What's wrong with the code?please help me.Thanks in advance.
    public boolean date() throws IOException, SQLException {
    Connection con1;
    long millis = System.currentTimeMillis();
    Timestamp timestamp = new java.sql.Timestamp(millis);
    ResultSet rs4 = null;
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    con = DriverManager.getConnection(
    "jdbc:oracle:thin:@abc:1605:xyz",
    "cdf", "cdf");
    Statement stmt_exp = con.createStatement();
    rs4 = stmt_exp.executeQuery("SELECT DATE FROM TABLE_NAME")
    while (rs4.next()) {
    Timestamp timestamp2 = rs4.getTimestamp("expire_date");
    con1.close();
    catch (Exception e)
    e.printStackTrace();
    finally
    //ResultSet rs4 = null;
    //Timestamp timestamp2;
    Timestamp timestamp2 = rs4.getTimestamp("expire_date");
    if (timestamp2.compareTo(timestamp) < 0)  //sysdate < exp date
    return true;
    } else {
    return false;
    }

    Didn't you understand what BalusC said? You're closing the connection and then trying to use the ResultSet. The ResultSet will be closed when you close the connection so you can't use it anymore.
    You should close the connection last thing in your code, probably in a finally. And after you close your ResultSet and Statement.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    ----------------------------------------------------------------

Maybe you are looking for

  • White box | ipad

    hi, i built up an animation using adobe edge and imported it to indesign (.aom). on the ipad, theres a white box in the background of my animation. i really dont know what to do now, because in the indesign preview-window it seems to work. already -

  • Deactivating the Invoice Approval Workflow in SRM 5

    Hi WF GurusM We are setting up Invoice Entry in SRM 5.0 and get the message: No approval workflow found. Inform system administrator. Please can you recommend how we can temporarily deactivate this workflow, so that we no longer get this message. We

  • Lightroom preset purchase did not install - failed to validate the license online - but I am online

    Hi How can I reload/reinitiate the DL? The link in this dialogue takes me to an endless loop of adobe forums with no help available. I have no problems connecting, my cert is fine (according to the check-steps provided in the help pages) and I can't

  • PSE 8 Syncing between 2 computers: "pending" files on second computer

    I have PSE 8 on 2 work computers. I can sync the files from one computer up to photoshop.com. When I try to get the files from photoshop.com to the second computer, it shows the files as "pending." How do I resolve the pending status?

  • Photoshop Elements 13 mit der Twain Schnittstelle

    How I Scan. Photoshop Elements 13 with the Twain interface Which file should be moved or copied. With element 11 everything was working properly. I work with Win. 8 Wie Scanne ich mit Photoshop Elements 13 mit der Twain Schnittstelle. Welche Datei mu