Slow Vi using analog I/O

Hello,
I'm having issues fixing my labview code to have an efficient response time. I tried multiple things to fix my issue, but can't seem to find a solution. I'm not as comfortable with LabVIEW as I am with other coding languages so troubleshooting this problem has been tough for me.
The purpose of this code is to take in an analog input of a limit switch being pressed, and upon doing so, switching the control from one channel to the other channel. The code works the way I want it to, but the issue is that it's just too slow for the application. Any assistance with this code would be much appreciated.
Attachments:
FES Switch Lab(04_12_12).vi ‏253 KB

Justin,
1. and 2. Most of the 3 seconds comes from the signals you are feeding to the DAQ Assistants. The 2000 constants in the image are the sampling parameters: 2000 samples per second and 2000 samples. That means you have a 1 second signal. You do this twice with different amplitudes and formulas.  To get to less than 200 ms with this program structure you need to change the sampling rate or the number of samples.
3. The code in the case structure is identical in both cases except for a Stop Task (which probably is not needed at all) and the boolean output.  Move the DAQ stuff outside the case structure and only have one copy. The code in the two frames of the sequence structures is the same except for the formula and amplitude. Create arrays of the formula strings and amplitude values and put just one copy of the code in a for loop. You can use the error wires to create data dependencies to make things happen in the desired order.
4. and 5. Anything which is duplicated probably only needs to be there once. If ELVIS retains the values put on the outputs, you would only need to write one sample for each value at the time you want it to change. Your code writes 2000 identical samples and then 2000 more of a different value.
6. How does a constant power supply generate a trigger if it never changes?
I presume the DAQ Assistant2 reads the limit switch.  However, nothing in your code behaves differently as a result of the inputs except the boolean indicators.  If the DAQ writes are supposed to change the channel, you need to write something different for false and true.
Is there a reason for using buttons for indicators? This tends to confuse users who wonder why pushing the buttons does not do anythimg.
Here is a cleaned up version which should work the same as yours.  I do not have any DAQ hardware or the DAQ Assistant so I did not test.
Lynn
Attachments:
FES Switch Lab(04_12_12).2.vi ‏108 KB

Similar Messages

  • Torque control is not working for my system using analog feedback

    In the test bed, we are testing a brushless DC motor and a load motor generates torque to the test motor. The test motor is running with torque control scheme. They were connected together and I measured the torque signal to feedback the signal and control it. However, I just realized it only control when the torque was static. If I commanded a certain torque value (in this case, counts command), it kept generating that value. However, it did not generate the same torque in different position. I heard NI motion controller could develop torque values by mapping the torque signal with encoder signal. If it's true, the torque generation based on analog feedback, also, needs constraint by rotor position, right? W
    hen I turned on the load machine with constant speed (50 RPM), the torque from the test motor did not provide the constant torque that I commanded. It generated the fluctuated torque values. This means the max torque was generated at one point and decreasing by rotating the shaft and increasing the torque. Keep going in this way. Could you please tell me if this is the correct response when we are using analog torque feedback?
    Thank you.

    Try the following:
    1.-Set your test motor to encoder feedback instead of analog feedback.
    2.-Load a velocity move on the axis for the test motor.
    3.-Set the following error limit on you axis to 0 (disable following error).
    4.-Use the load torque limit function to limit the amount of torque the 73xx PID loop will generate,this value is in volts, so you will need to do a correlation between the voltage output from the controller and the torque reported by your torque cell.
    5.- Start the load motor.
    6.-Engage the cluch.
    7.-Start the velocity move on the test motor, you will see the torque ramp up to the torque limit.
    8.-Call the load torque limit function on the fly to vary the torque setpoint to where you want it.

  • My MacBook Pro is running very slow when using the internet and sometimes gives the pinwheel of death, any suggestions on how to fix?

    My MacBook Pro is running very slow when using the internet and sometimes gives the pinwheel of death, any suggestions on how to fix?

    <http://www.thexlab.com/faqs/sbbod.html>

  • E book bought from Waterstones is very slow in use can you, help?

    E book bought from Waterstones is unreasonably slow in use can you help, please?
    I purchased a copy of “The Complete English Poems” by John Donne as an e-book, I downloaded the e-book successfully, as well as the new Digital Editions software and transferred the e-book to my Sony Reader. However when I try to use the book it is slow opening up and very slow moving between sections, or navigating between the poem and the notes on the poems, typically between three and five minutes. In practice this means that if I wish to consult a note on a poem it can take five minutes to move from the poem to the note then another five minutes to navigate back, giving a time of ten minutes to consult a note. This is not really feasible.
    I have had no problem downloading and reading other books, from Waterstones bought after the John Donne.
    I have tried deleting and re-loading the John Donne, as well as resetting the reader to no avail.
    I contacted Sony support who says that as my other e-books from Waterstones and other sources work perfectly, then the fault lies with “The Complete English Poems” and not the Sony reader.
    Please note that I had a similar problem with a Waterstones edition of “the King James Version of The Holy Bible. “ This problem was never resolved.

    You need to install more RAM.
    Your year and model IMac can take a total of 6 GBs of RAM.
    Correct, compatible and reliable Mac RAM can ONLY be purchased from online RAM sources Crucial memory or OWC (macsales.com).
    The 6 GB RAM kit can be found here.
    http://eshop.macsales.com/shop/memory/iMac/Intel_Core_2_Duo_PC2-6400
    If you haven't use this application often, completely uninstall CleanMyMac.
    Total, useless "junkware"/"Garbageware"/malware.
    http://macpaw.com/support/cleanmymac-classic/knowledgebase/how-to-uninstall-clea nmymac-classic
    http://macpaw.com/support/cleanmymac/knowledgebase/how-to-uninstall-cleanmymac-2
    Ditch ALL Googlewares. They are ALL a serious resource hog on the OS X system.
    https://support.google.com/chrome/answer/95319?hl=en
    https://support.google.com/drive/answer/2375081?hl=en
    If you do not like Apple's Safari web browser, download, install and try Mozilla FireFox, instead.
    The current, up-to-date version of FireFox is fully compatible with OS X and is regularly updated by the great developers of the Mozilla group.
    I have, also, stopped using the Google search engine, regularly and use DuckDuckGo as my default search engine.
    You have too many and duplicate user login/startup items.
    Add or remove automatic items
    Choose Apple menu > System Preferences, then click Users & Groups.
    Select your user account, then click Login Items.
    Do one of the following:
    Click Add below the list on the right, select an app, document, folder, or disk, then click Add.
    If you don’t want an item’s windows to be visible after login, select Hide. (Hide does not apply to servers, which always appear in the Finder after login.)
    Select the name of the item you want to prevent from opening automatically, then click Delete below the list on the right.

  • Acrobat XI pro - Slow when using 'save as' or saving merged pdf

    System:
    Windows 7 pro 64-bit
    AMD FX 6300 processor
    HD 7770 1 GB video card
    1 TB disk space
    16 GB RAM
    MS Office 2013 Plus
    Adobe Acrobat XI Pro
    Issue:
    Saving pdf is very slow. Regardless if the location is a network location or desktop. Using the 'save as' option is also very slow. It's super slow when using the 'merge' option.
    Troubleshooting: 
    - uninstalled adobe, rebooted system, reinstalled adobe, installed updates - no changes
    - tried using optimize pdf option  when saving- no changes
    - ran adobe in compatiblity mode - no changes

    All available updates have been applied/installed.

  • Problem with InDesign CC redrawing the screen too slow while using Zoom tool

    Hello. I got a problem with InDesign CC redrawing the screen too slow while using Zoom tool. Sometimes it takes more than a secong to zoom in or out. However InDesign CS6, Photoshop CC, Illustrator CC works just fine. What could be the problem, videocard or something else? Below is my PC configuration: OS Windows 8 Pro (x64); processor Intel Core i7 2600k CPU 3,40GHz; video adapter NVIDIA GeForse GTS 450; monitor NEC PA271W (2560x1440).

    Yes it’s a bug. The trick is to select the tool and then left click the photo information strip and hold for a few seconds until you see the windows bar at the top of the screen (not responding)
    The lasso tool should then work normally.

  • HP Photosmart 8750 prints slow when using Photo Gray Cartidge

    HP Photosmart 8750 prints slow when using Photo Gray Cartidge ... sometimes indicates Black Cartridge failed, however upon reinserting works slow

    Welcome to the HP Forums ButchG,
    I see by your post that when printing with the photo gray cartridge the black cartridge will indicate that it has failed.
    I can help you with this issue.
    I would do a power reset to see if that will resolve the issue.
    With the printer still turned on, disconnect the power cable from the back of the printer, if the printer has external power module with a detachable power cord disconnect it for 15 seconds and then reconnect it.
    Hold down the power button for 10 seconds to drain the power.
    Then disconnect the power cable from the wall outlet.
    Wait 10 seconds and reconnect the power cable back to the wall outlet first, then the back of the printer and power it on again.
    Make sure the printer is connected directly to wall outlet. (don't use a power hub or a surge protector)
    I have provided a document for the cleaning the contacts and reseating the cartridge.
    'Cartridge Failed' or 'Cartridge Not Compatible' Error Message.
    What are the ink levels?
    Are you using Genuine HP Cartridges?
    Check the date on the cartridges to make sure they are still in warranty. (not old stock)
    If you need further assistance, let me know.
    Have a nice day!
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • How to implement the function "Slow Play" using MPMoviePlayerController?

    Does anybody have idea to implement the function "Slow Play" using MPMoviePlayerController or some other indirect solutions? Thanks. Kevin.

    You can use the changeSelection(...) method to change the cell with focus.

  • Lightroom 2.4 Is Too Slow To Use As A Professional Product

    Hello -
    I would like to know how to get Lightroom to respond in less than 4-8 seconds for almost any task.
    From returning to Grid mode (4.5 seconds) to adjusting a routine crop and angle (5-7 seconds per move, 60-90 seconds total) to simply shift-selecting three to fifty photos (4-9 seconds) no matter what I do in Lightroom, it is worse that Photoshop 1.0 on a Mac Plus. Really.
    Returning to Lightroom from another app - 7 seconds.
    Getting the menus to drop down - 4 seconds.
    My lightroom settings:
    standard preview size: 1680
    Quality: High
    Discard 1:1: Never
    write changes to XMP: off
    Catalog: 127 mb on F drive (24 gig free)
    Catalog: 13.5k photos, 95 gig on F drive
    Cache: 6 gig on F drive
    NVIDIA settings: performance over quality
    My computer:
    HP 8730 elitebook
    4 gig ram
    XP Pro, SP2
    Proc: Core 2 Duo T9400, 2666 MHz (10 x 267)
    DirectX    4.09.00.0904 (DirectX 9.0c)
    Chipset: Cantiga PM45
    Video: NVIDIA Quadro FX 3700M  (1024 MB)
    (2x) 250 gig 7200 rmp HD
    Before anyone says to export to a new catalog and re-import, etc, use a smaller catalog, etc, be advised that I have done all of that. I have imported only 250 images to a new catalog, on a newly installed OS, with Lightroom as the ONLY application. Still it acts this sluggish.
    I have scoured the boards for solutions, and having tried all the varied fixes to no avail, I really quite strongly feel that a person should not EVER be in the position or running some of the most powerful available hardware and STILL have to wait interminable seconds for Lightroom to respond.
    This software, as it stands now on the PC platform (unless I am missing something quite obvous) is absolutely unusable in its present state.
    Can someone from Adobe or a board guru please respond in kind to my request for help?

    Photo_op8 wrote:
    BradKaye wrote:
    I'd have to agree with the subject of this 100%, even though I'm not experiencing anywhere near the levels of lag ellsworth is on any of my primary workhorses.
    1st-Gen 17" MacBook Pro 2.4Ghz Intel Core 2 Duo with Hi-Rez Screen (about 2 years old)
    1st-Gen MacPro (Dual Twin-Core 3Ghz, 3x, 10k-RPM 150GB Raptor RAID-0, partitioned to System/Scratch/Files (in that order) 16GB RAM...blah blah (about 2.2 years old)
    3 week old MacPro  2x2.66 Quad-Core MacPro, 16GB RAM, Multiple Partitioned (System/Scratch/Files)  Internal 4x-1.5TB RAID-0, 4x 1.5TB eSATA RAID-0, 2x NVIDIA GT 120's, 30" NEC 3090WQXi, 26" LaCie 526, 24" Apple LED Display
    OS 10.5.8 on all machines.
    Let me repeat-
    Partitioning ONE drive to contain system files, application, cache, catalog and photos=SLOW.
    It really doesn't matter that the drive is 7200 or 10k rpm if ALL items reside on the same drive. The MacPro has four bays. One drive for system and catalog, second for cache, third for photos=FAST.
    Wow, I'm glad you repeated that, and used capitalized text so that I would be sure to understand.
    Clearly, the benchmarks I have off of the various evolutions of my last 3, $10k computers must be in error. (single system disk, RAID-0 system disk, 10k RPM system disk, RAID-0 3x -10K rpm system disks, multiple scratch volumes on different drives, singular scratch volumes on RAIDed drives, tested via benchmark programs and application specific batch tests, etc.etc.)
    More importantly as an issue of forum protocol, you didn't actually read my post.
    Brad Kaye wrote:
    I partition about 10% of the outside of a drive as separate and put the information I need to get to most quickly which tends to be the system folder then scratch disk in a another separate partition and then I leave the rest on that drive as gobs of 'B' space for media and other crap files, reserving the first 10%-30% of the outside of a different drive (or RAID-0 sets) for my files and Lightroom catalogs.
    I'm throwing 370 mb/sec between two individual sets of 4 drive RAID-0 sets.  Single 7200rpm drives sling about 80 mb/sec.  My drive arrangement isn't the reason Lightroom IS TOO SLOW TO USE AS A PROFESSIONAL PRODUCT.
    Also, since I referenced and linked the former software engineer turned photo FREAK in my post, whose blog I started reading last year corroborating the decisions I've made in my previous system setups with immaculate documentation and testing procedure your response even more seems like the entire reason I rarely bother posting in community forums.  You seem to be here to spout, not to contribute and learn.
    Take a look at all of the info contained here: (I've already read it, all of it, and more)
    Diglloyd Mac Performance Guide
    and if you still think I'm wrong, lets have an informed debate about it.  Really.
    Otherwise, lets please keep this topic moving forward with the issues Adobe needs to address next to make Lightroom a better product for professional photographers, and specifically, help out ellsworth999 who started this topic, who seems to have a big helping of problems on his plate. I can't speak to him directly of his problems since I'm not using the Windows version of the software.

  • Why is it taking 19 hours to encode four avi. files. I just bought a new 21" iMac last week and it is just to slow to use. Thanks

    I just bought a new 21" iMac last week and it is just to slow to use. Before it used to take a couple of hours now its just way too long

    Hi
    As I understands it - This has nothing to do with Your iMac - Any Mac would take the same time.
    May be OS and support on the Window-PC platform handles this better.
    • .avi - is no specific codec (file format) but a container and the codec in this might not be one that iDVD can directly use (encode to .mpeg2 as on DVD disks)
    So either it just can't do it - or -
    iDVD has to back-encode to an usably codec - THIS IS WHAT I THINK HAS HAPPENED
    This back-encoding can take serious time - AND the final result usually is far from Good.
    I would
    • find out in what codec the .avi file is (I use QuickTime and in this inspector to read what codec .avi contains) (.mov is also a container)
    • import it into a program that can transcode to a better codec for iDVD - streamingDV or AIC (I GUESS)
    • then use this in iDVD
    Yours Bengt W

  • Suddenly, time machine is very slow. Used to take up a minute and now more than half an hour. Does anybody know how this can happen? Indexing the back-up disk is off, but Timde Machine keeps on indexing!

    Suddenly, time machine is very slow. Used to take up a minute and now more than half an hour. Does anybody know how this can happen? Indexing the back-up disk is off, but Timde Machine keeps on indexing!

    same issue here...

  • 4 to 4.1 - too slow to use.

    Since upgrading to 4.1 LR has become too slow to use.
    The problem lies primarily, but not restricted to, the noise reduction sliders.  The luminance slider specifically.
    Unless I can fix something I will have to return to an older version, Im actually thinking of going back to 3.6 which worked fine on my machine - AMD E2, Dual Core graphics, 4gm RAM.
    Please help.

    The queries are the same across all three database platforms and have been examined by our dba's and run through SQL Server optimizer to get the access path. All queries are very simple...the system was originally written in Btrieve. It is "record at a time" in nature. The program that does the screen refresh does three seperate queries...all something like, select * from tablename where key = 'abc'. The program then combines the data into a single record and returns the results. Like I said...SQL Server 1 second. Each of the three tables has 30,000 records, all with unique keys. The data returned to the application is probably 50 records, each 200 bytes...all character data. All tests were done with the same workstation on the same LAN....I don't think LAN latency is the problem here. Using other query tools, the response back is good, as expected.
    Another example...at application startup, we load all of the metadata (columns, primary key segments and index segments) into memory using the standard odbc api calls...SQLColumns, SQLPrimaryKeys and SQLStatistics. SQL Server loads this in maybe 8-10 seconds while Oracle loads in 15 minutes at best. These queries we don't control and it is still unbelievably slow. Again, using the ODBCTEST utility, the results for these api's come back pretty quick.
    If it is our application causing the problem in some way then it should be equally slow across all platforms, right?
    By the way, we had one of your Oracle Consultants in house trying to solve the metadata problem and he was unable to find any problem in our application and had no answers for us.
    Thanks for the quick response.
    Lon Diehl

  • Mac pro too slow to use, spinning ball, no finder response, only hard power off, installing system stalls at 18 minutes left.

    mac pro too slow to use, spinning ball, no finder response, only hard power off, installing system stalls at 18 minutes left.
    It is taking an hour to power up and mac apple logo appear onscreen. No finder controls or "clicks" are being recognized. Spinning beachball all the time.
    Using hard power off and holding the mouse down, I was able to open the optical drive and then restart with "c" and ask the dvd to reinstall the system, but it has stalled before finishing the installation.
    This happened about 4 days ago, first it started responding slowly, and then it just keeps spinning the beachball. I can't find hardware test. I did run etrecheck, it did not have any error messages, but I can't copy or move the data anywhere.... I am not able to access the mac pro with another machine, and now I am stuck in install freeze, so I can't copy etrecheck by hand onto a piece of paper.
    Without being able to finish a reinstall, what can I try?
    After it got bad, and before it got REALLY bad, I managed to repair permissions, but it took a long time. Most of a day. When I restarted from that, things were only worse.
    Mac Pro 1,1 , 11 GB ram, 7300, 5TB hard drives, OS 10.6.8,  the drive containing the system folder is/was 700 used, 290 free. While I could get commands to respond, I put Activity monitor on the desktop and watched it.  System memory was 3.31 GB used, about 7 free, and some wired. No app was using a huge amount.
    what should I try next? I put a bid on a new/old machine so that I could move the 4 hard drives over.

    Thank you for all your suggestions. Please correct me as I articulate this.
    I have three versions( 5, 6, CC) of the Adobe Master Collection which I keep active for different clients. I have final cut and motion. I have Office 365. I have a collection of graphic apps that are individually not too big but in all, my app folder is 65GB and my bootcamp partition is 61GB. I can't fit all this on 120 ssd and a 256 will be full once I install, correct? drives should be half open?
    Somehow I did not make it clear enough that I was trying to copy onto a 2TB drive I had just initiallized in order to try and save files from my startup drive. I don't use time machine. I take a day or a few days worth of documents and physically move them to another drive at night.  If a series is finished I make two dvd's as well. The second black drive that was failing was the drive I moved my backup documents onto. At no point was I trying to backup onto the failing drives. I was trying to copy off both of them onto the other two drives, a third aux backup that has been there for a while, and a newish 2 TB which I designated as the startup drive when all this trouble started.
    I wondered if there were any good techniques for trying to get the data off the failing drive. Thanks for the suggestion of Data Rescue 3. I don't have it yet, but I will try it as soon as I get it. I was never trying to repair in place.
    I am very interested in getting a pci bracket and an ssd, but I may wait until I can afford the larger one. If I get an older bracket that is compatible with my old mac pro 1,1  ,  I'd like to be able to move it to a mac pro 3,1 if I get one. Will the larger ssd drives be compatible with the sata in a pci bracket that can work in my mac pro 1,1 ? sata 2 versus something else? If 240 or 256 is my size limit, how much more than my 65 and 61 GB partitions can I put on there? How much of a scratch disc can I make if I leave another 39 GB of headroom on my bootcamp partition? I'm filling 165 GB without making any allowance for temp files.
    You have said that 120 is enough for any system. I think I must be misunderstanding something. Are you saying that assuming that most people run office and photoshop and maybe lightroom?
    I have and use 4 HDD in this machine, mostly for document storage in two places.
    I took out all but the group of 2GB ram chips I bought a year and a half ago. The old ram had passed the hardware test the last time I had access to the hardware test. Two black drives failed, one was a year old and one was a year and a half old, and that it may have been exacerbated by the heat wave. I don't know why the video and the monitor were affected save that the startup drive was failing. I am trying to replace the card.
    With all this said, I am also looking at a used mac pro 3,1 with a better video card since a newer machine will likley be compatible through another OS upgrade. If a machine costs only a little more than a new card, it might be a better way to go.
    I don't have any sources that offer an ssd for 100. ( of a size that is useful)
    How large is your application folder?

  • Google maps keeps giving "Still loading... Slow? Use the troubleshooting guide or basic HTML" message and won't load maps

    I go to Google Maps and try to enter address in search bar.
    Message pops up: "Still loading... Slow? Use the troubleshooting guide or basic HTML"
    Nothing ever comes up -- map does not load.
    If I append "q?=us" to url (below) (without quotes), it works.

    &q=us does not work.
    Starting firefox in safe mode does not work
    Map loads but entire page except main menu is non interactive.
    "Still loading... Slow? Use the troubleshooting guide or basic HTML"
    It comes up on google.com.au but not google.com
    It happened after they added the new privacy popup with with MapGL also being added.
    Disabling all cookies with Web Developer or browsing in private mode works but when settings are put back to normal it stops working.
    I deleted all cookies and cleared cache but that did not help. Strange that clearing cookies did not solve the problem because disabling cookies works.
    I tested with another browser and it works... but I want firefox forever.

  • Query runs slower when using variables & faster when using hard coded value

    Hi,
    My query runs slower when i use variables but it runs faster when i use hard coded values. Why it is behaving like this ?
    My query is in cursor definition in a procedure. Procedure runs faster when using hard coded valus and slower when using variables.
    Can anybody help me out there?
    Thanks in advance.

    Hi,
    Thanks for ur reply.
    here is my code with Variables:
    Procedure populateCountryTrafficDetails(pWeekStartDate IN Date , pCountry IN d_geography.country_code%TYPE) is
    startdate date;
    AR_OrgId number(10);
    Cursor cTraffic is
    Select
              l.actual_date, nvl(o.city||o.zipcode,'Undefined') Site,
              g.country_code,d.customer_name, d.customer_number,t.contrno bcn,
              nvl(r.dest_level3,'Undefined'),
              Decode(p.Product_code,'820','821','821','821','801') Product_Code ,
              Decode(p.Product_code,'820','Colt Voice Connect','821','Colt Voice Connect','Colt Voice Line') DProduct,
              sum(f.duration),
              sum(f.debamount_eur)
              from d_calendar_date l,
              d_geography g,
              d_customer d, d_contract t, d_subscriber s,
              d_retail_dest r, d_product p,
              CPS_ORDER_DETAILS o,
              f_retail_revenue f
              where
              l.date_key = f.call_date_key and
              g.geography_key = f.geography_key and
              r.dest_key = f.dest_key and
              p.product_key = f.product_key and
              --c.customer_key = f.customer_key and
              d.customer_key = f.customer_key and
              t.contract_key = f.contract_key and
              s.SUBSCRIBER_KEY = f.SUBSCRIBER_KEY and
              o.org_id(+) = AR_OrgId and
              g.country_code = pCountry and
              l.actual_date >= startdate and
              l.actual_date <= (startdate + 90) and
              o.cli(+) = s.area_subno and
              p.product_code in ('800','801','802','804','820','821')
              group by
              l.actual_date,
              o.city||o.zipcode, g.country_code,d.customer_name, d.customer_number,t.contrno,r.dest_level3, p.product_code;
    Type CountryTabType is Table of country_traffic_details.Country%Type index by BINARY_INTEGER;
    Type CallDateTabType is Table of country_traffic_details.CALL_DATE%Type index by BINARY_INTEGER;
    Type CustomerNameTabType is Table of Country_traffic_details.Customer_name%Type index by BINARY_INTEGER;
    Type CustomerNumberTabType is Table of Country_traffic_details.Customer_number%Type index by BINARY_INTEGER;
    Type BcnTabType is Table of Country_traffic_details.Bcn%Type index by BINARY_INTEGER;
    Type DestinationTypeTabType is Table of Country_traffic_details.DESTINATION_TYPE%Type index by BINARY_INTEGER;
    Type ProductCodeTabType is Table of Country_traffic_details.Product_Code%Type index by BINARY_INTEGER;
    Type ProductTabType is Table of Country_traffic_details.Product%Type index by BINARY_INTEGER;
    Type DurationTabType is Table of Country_traffic_details.Duration%Type index by BINARY_INTEGER;
    Type DebamounteurTabType is Table of Country_traffic_details.DEBAMOUNTEUR%Type index by BINARY_INTEGER;
    Type SiteTabType is Table of Country_traffic_details.Site%Type index by BINARY_INTEGER;
    CountryArr CountryTabType;
    CallDateArr CallDateTabType;
    Customer_NameArr CustomerNameTabType;
    CustomerNumberArr CustomerNumberTabType;
    BCNArr BCNTabType;
    DESTINATION_TYPEArr DESTINATIONTYPETabType;
    PRODUCT_CODEArr PRODUCTCODETabType;
    PRODUCTArr PRODUCTTabType;
    DurationArr DurationTabType;
    DebamounteurArr DebamounteurTabType;
    SiteArr SiteTabType;
    Begin
         startdate := (trunc(pWeekStartDate) + 6) - 90;
         Exe_Pos := 1;
         Execute Immediate 'Truncate table country_traffic_details';
         dropIndexes('country_traffic_details');
         Exe_Pos := 2;
         /* Set org ID's as per AR */
         case (pCountry)
         when 'FR' then AR_OrgId := 81;
         when 'AT' then AR_OrgId := 125;
         when 'CH' then AR_OrgId := 126;
         when 'DE' then AR_OrgId := 127;
         when 'ES' then AR_OrgId := 123;
         when 'IT' then AR_OrgId := 122;
         when 'PT' then AR_OrgId := 124;
         when 'BE' then AR_OrgId := 132;
         when 'IE' then AR_OrgId := 128;
         when 'DK' then AR_OrgId := 133;
         when 'NL' then AR_OrgId := 129;
         when 'SE' then AR_OrgId := 130;
         when 'UK' then AR_OrgId := 131;
         else raise_application_error (-20003, 'No such Country Code Exists.');
         end case;
         Exe_Pos := 3;
    dbms_output.put_line('3: '||to_char(sysdate, 'HH24:MI:SS'));
         populateOrderDetails(AR_OrgId);
    dbms_output.put_line('4: '||to_char(sysdate, 'HH24:MI:SS'));
         Exe_Pos := 4;
         Open cTraffic;
         Loop
         Exe_Pos := 5;
         CallDateArr.delete;
    FETCH cTraffic BULK COLLECT
              INTO CallDateArr, SiteArr, CountryArr, Customer_NameArr,CustomerNumberArr,
              BCNArr,DESTINATION_TYPEArr,PRODUCT_CODEArr, PRODUCTArr, DurationArr, DebamounteurArr LIMIT arraySize;
              EXIT WHEN CallDateArr.first IS NULL;
                   Exe_pos := 6;
                        FORALL i IN 1..callDateArr.last
                        insert into country_traffic_details
                        values(CallDateArr(i), CountryArr(i), Customer_NameArr(i),CustomerNumberArr(i),
                        BCNArr(i),DESTINATION_TYPEArr(i),PRODUCT_CODEArr(i), PRODUCTArr(i), DurationArr(i),
                        DebamounteurArr(i), SiteArr(i));
                        Exe_pos := 7;
    dbms_output.put_line('7: '||to_char(sysdate, 'HH24:MI:SS'));
         EXIT WHEN ctraffic%NOTFOUND;
    END LOOP;
         commit;
    Exe_Pos := 8;
              commit;
    dbms_output.put_line('8: '||to_char(sysdate, 'HH24:MI:SS'));
              lSql := 'CREATE INDEX COUNTRY_TRAFFIC_DETAILS_CUSTNO ON country_traffic_details (CUSTOMER_NUMBER)';
              execDDl(lSql);
              lSql := 'CREATE INDEX COUNTRY_TRAFFIC_DETAILS_BCN ON country_traffic_details (BCN)';
              execDDl(lSql);
              lSql := 'CREATE INDEX COUNTRY_TRAFFIC_DETAILS_PRODCD ON country_traffic_details (PRODUCT_CODE)';
              execDDl(lSql);
              lSql := 'CREATE INDEX COUNTRY_TRAFFIC_DETAILS_SITE ON country_traffic_details (SITE)';
              execDDl(lSql);
              lSql := 'CREATE INDEX COUNTRY_TRAFFIC_DETAILS_DESTYP ON country_traffic_details (DESTINATION_TYPE)';
              execDDl(lSql);
              Exe_Pos:= 9;
    dbms_output.put_line('9: '||to_char(sysdate, 'HH24:MI:SS'));
    Exception
         When Others then
         raise_application_error(-20003, 'Error in populateCountryTrafficDetails at Position: '||Exe_Pos||' The Error is '||SQLERRM);
    End populateCountryTrafficDetails;
    In the above procedure if i substitute the values with hard coded values i.e. AR_orgid = 123 & pcountry = 'Austria' then it runs faster.
    Please let me know why it is so ?
    Thanks in advance.

Maybe you are looking for

  • How can i let Displaytag work in an Oracle 10g Portal environment?

    Hi there, I'm already searching and trying this for a week, but didn't succeed yet. I want to use displaytag to be able to sort and page data in a HTML table on a very generic and easy-to-use way. Locally in JDeveloper 10.1.3 on OC4J (embedded) it wo

  • Installation j2sdk1.4.2 win98

    Hi I was interested in reading the messages from daljaxon on this topic... I have had very nearly the same problem, namely, getting the path correct. I also installed the j2sdk cobundled with netbeans into program files, then tried to set the path to

  • Re: Transaction for OBYC

    Hello Experts, In obyc i created a new Trasaction CCC for Commission purpose but if i see in OBYC for CCC i can see only Valuation modif & GL Account, i cannot see the Valuation class because i need to assign GL Account base on Valuation class not on

  • How to fill Bapireturn table ?

    Hello All, I've created a BAPI . In this BAPI as I shud not use exceptions I need to fill the BAPI Return Table. Can anyone tell me how to fill this BAPI Return Table ? I saw a FM BALW_BAPIRETURN_GET2 . How to use this FM ? Any help is appreciated .

  • My 6th generation ipod quit working.

    My 6th generation ipod quit working.  The battery was low, but I plugged it into a charger immediately.  I've tried a car charger, wall outlet and iTunes does not recognize it to charge or reset.  What should I do?