DAQmx+6009: Reading the current counter value is too slow

I have a thread that runs a software loop that I need to run as fast as possible. One of the things I need to do is poll the current counter value from my 6009, and branch if it's changed from the last time I read it. Over 90% of the time spent in my 1.2ms loop is doing this read. My goal is to get the loop under 50us.
What I really need here is an accurate timestamp (20us or better) for every time the counter changes (up to 1kHz). When I detect a change, I currently get the timestamp by calling QueryPerformanceCounter().
Here's how I create the task:
    DAQmxErrChk( DAQmxCreateTask("",&taskHandle) );
    DAQmxErrChk( DAQmxCreateCICountEdgesChan( taskHandle, line, "", DAQmx_Val_Falling, 0, DAQmx_Val_CountUp ) );
    DAQmxErrChk( DAQmxStartTask(taskHandle) );
And here's the line of code that goes so slow in my loop:
    DAQmxErrChk( DAQmxReadCounterScalarU32( taskHandle, 10.0, &count, NULL ) );

I updated a robot control from a Mac Powerbook with a PCI expansion chasis running Mac OS9, Labview 5 and DAQ to a Mac Mini (intell) with 6009 and 6501 USB cards  running Mac OSX, Labview 8.5, and DAQmx-base.  I have connected wheel encoders (pule train and direction) to a 6009 and a 6501.  It all seems to work, except the tuning of velocity control loops is not as good as before, indicating some delays.  The loops run every 100msec (10Hz update) so I expected a synchronisation problem rather than latency.  I did some measurements today and found that reading the 2 counters and the 2 digital inputs takes over 20msec.
 I get better performance from VISA with a serial to USB converter.  I have a program reading 25byte packets every 20msec.  Although I did run into the USB latency problem with another serial application.  I have a serial device that requires a response t changing CTS (clear to send) in less than 1.2msec, and VISA was taking 1.5msec.
On the same machine I am reading 1024 samples from an analog input every 100msec with out any timing issues - (once I got the incredibly slow start and stop vis outside the loop - they take about 200msec each.  Taking the start and stop vis outside the loop reduced my loop time from 450msec (approx) to 100msec.  The only problem is that to do this I have to run in continuous mode and can't  use an external trigger (it has to restart on every trigger, so the start and stop vis have to be in the loop).
So it appears that I have updated my technology by 10 years only to find that USB is incredibly slow - something that is not in any of the NI doccumentation that I can find.  Does NI have any documentation on what to expect in terms of performance from these USB devices and any suggestions on how to get better performance, apart from buying more expensive hardware?
Thanks 

Similar Messages

  • How to get the current month value for a customer exit variable?

    How to get the current month value for a customer exit variable? 
    And also if we have an InfoObject with date value (including date, month, year), then how to derive the month value from this date type of Char.?
    Thanks!

    Hi Kevin,
    Check here........
    Re: Customer Exist for "From Current Date To Month End"
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edcd4597335a
    Cal month
    Regards,
    Vijay.

  • Why customer exit variable to grab the current month value doesn't work?

    In CMOD, input the following code to grab the current month value from the system date:
    Grab the month value with System Date
    WHEN 'CURMONTH'.
        CLEAR l_s_range.
        l_s_range-low = SY-DATUM+4(2).
        l_s_range-sign = 'I'.
        l_s_range-opt = 'EQ'.
        APPEND l_s_range TO e_t_range.
    In Query Designer, create a formula variable CURMONTH processed by customer exit and the dimension under the Currency/Unit tab is "Number".  Put the formular variable in the column as a KF.  When running the query, the column with the formular variable shows values of "2,0000000" other than just "2" I want for the current month.  If  the dimension under the Currency/Unit tab is "date", the column with the formular variable shows values of "00/00/0000".  Any idea?  How to grab the correct current month value which is 2 from the system date.
    Thanks!

    Oh ok , try the below options, As such I dont see any errors in our code .
    Not sure if you have ABAPER's in your team, just check with them once on the FM we are trying to see .
    Next , do you hvae 0CALDAY available in your report ? If so try to restrict that field with variable "0DAT" and write the same code you have written for your formula variable , but instead change the variable name to "0DAT" and try if this gets the month . let me know if I'm not clear .

  • How can we read the screen field values from the report selection screen wi

    Hi expart,
    How can we read the screen field values from the report selection screen with out having an ENTER button pressed  .
    Regards
    Razz

    use this code...
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_posnr.
    **Read the Values of the SCREEN FIELDs
    CALL FUNCTION 'DYNP_VALUES_READ'

  • How to get the current selected value of a combo box or a option button?

    Hello All,
    I want to catch the current selected value of a combo box and also of a option button and want save it into different variables in my code. These option button and combo box are in a SAP business one form which I have created through VB dot.net coding.
    But I don't know how to do that, can any one send any example code for this.
    Regards,
    Sudeshna.

    Hi Sudesha,
    If you want to get the selected values you can do it as follows: The Combo Box value you can get from the combo box. If you want to get it on the change event, you must make sure that you check when BeforeAction = False. If you want to get an Option Button value you should check the value in the data source attached to the option button.
            Dim oForm As SAPbouiCOM.Form
            Dim oCombo As SAPbouiCOM.ComboBox
            Dim oData As SAPbouiCOM.UserDataSource
            oForm = oApplication.Forms.Item("MyForm")
            oCombo = oForm.Items.Item("myComboUID")
            oApplication.MessageBox(oCombo.Selected.Value)
            oData = oForm.DataSources.UserDataSources.Item("MyDataSourceName")
            oApplication.MessageBox(oData.ValueEx)
    Hope it helps,
    Adele

  • Read the Current BP number before saving

    HI Experts,
    From the Identification tab iam creating the BP by entering all the mandatory fields and then i click on END button instead of "Save" so on this END button event i want to read the current BP which is not yet saved in the database.
    Iam writting the logic of END button in the IF_CRM_IC_PREPARE_FOR_CALLBACK~EXECUTE method of the Main View set(IUICMD/MainVS).
    data: zv_core    TYPE REF TO cl_crm_bol_core,
             zv_entity TYPE REF TO cl_crm_bol_entity_manager,
             zv_core = cl_crm_bol_core=>get_instance( ).
             CALL METHOD zv_core->get_entity_manager
               RECEIVING
                   rv_result = zv_entity.
    In Debug mode when i check the ZV_ENTITY in that there is one Private Attribute ENTITY_TAB of type Sorted Table where i can see 3 entries with OBJECT_NAME as "BuilHeader","BuilContactPerson", "BuilStandardAddress" when i check the Entity reference of ""BuilHeader" iam getting the current BP number. But how to read this entity iam not getting this.???
    I tried the below way..
    LOOP AT zv_entity->entity_tab ASSIGNING <itab>.
    ENDLOOP.
    But it says that "Access to private attribute "ENTITY_TAB" is not allowed."..
    Regards.

    Hi Hemant,
    As you are implementing your method in overview set , try to access the view controller where the BP ID is created by rereading the entity.
    DATA: lv_viewname TYPE string,
            lr_viewctrl TYPE REF TO cl_bsp_wd_view_controller.
      lv_viewname = me->get_viewarea_content( '<View Area of your view>' ).                            
      IF lv_viewname IS NOT INITIAL.
        lr_viewctrl = me->get_subcontroller_by_viewname( lv_viewname ).
        IF lr_viewctrl IS BOUND.
          TRY.
              CALL METHOD lr_viewctrl->('<method_name>')   .
               CATCH cx_sy_dyn_call_error.
              RETURN.
          ENDTRY.
        ENDIF.
      ENDIF.
    Regards,
    Nithish
    Edited by: nithish P on Feb 7, 2012 2:32 PM

  • How to get the current zoom value in ID?

    Is there any way that can get the current zoom value in InDesign?
    Thanks a lot.

    You could peek at the widget indicated in your screen shot, at least when that MDI (?) frame is showing.
    The window title at kLayoutPresentationBoss, IID_IDOCUMENTPRESENTATION also reflects the value.
    Probably best would be the kLayoutWidgetBoss, with its IID_IPANORAMA, GetXScaleFactor() - and GetYScaleFactor()!!!
    I just try to imagine how a document would look if these differ from each other ;-) and, even better, how to achieve that from the UI.
    Btw, one notification is on kDocWorkspaceBoss, protocol IID_IWINDOW, command kUpdateDocumentUIStateCmdBoss.
    Another one: there is a kDocWindowTitleModifyService ...
    Edit: of course I should again mention IID_IPANORAMA, observable from kLayoutWidgetBoss subject.
    Dirk

  • Reading the current frame of an Event Structure

    Is there a way to read the current frame (or state?) of an Event Structure?
    Richard

    johnsold wrote:
    Normally a program would not stay in an event case for long enough for the phrase "current frame" to have much meaning.  What are you trying to do?
    Lynn
    Like tst assumed, it's for edit time use. Some events take a few seconds, and the progress would be nice to watch on the FP like you'd typically do with a state machine, and with dynamic events (as opposed to just user events), it would be nice to see where the structure is going.
    I have tried something with scripting as shown, but it's not much help. There's no property "Current Frame" or similar. Visible Frame (as shown) doesn't do it.
    Richard

  • How can I read the filter dependent values in abap class implementation ?

    Hi Experts,
    I need read the filter dependent values in my Z Class implementation but I don´t know how to do it.
    In classic badi was via FT_VAL parameter.
    Now how can I do it ?
    Regars,
    Bala

    Rogerio,
    In case of badis the field flt_val gets added automatically as an import parameter when you check FILTER DEPENDENT check box. This is to restrict which implementation of the badi should be executed, if there are more than one.
    There is no such concept when you are building a class.
    If you want one of your methods to be executed on in certain cases, you need add the required logic within the method.
    If you are referring to the FILTER check box in the pic below, that is used for a different purpose. It is used to filter what is displayed on the class builder screen. F1 on the field to know more about the same.
    Thanks,
    Vikram.M

  • SapScript, How do I read the current line number?

    I have sections of text - each in it's own element with an 'include' of the standard text.
    These sections are variable in size.
    All elements are in the MAIN window.
    I do not want a paragraph to split over two pages.
    How do I read the current line number within the sapscript before the section prints so I can issue a new-page command at the beginning of the paragraph?
    Thanks!

    Yes, that does work for paragraphs.
    If I have multiple elements to print from within a loop where "at first, at each and at last" each call the Sapscript funtcion write_form - how can I keep the whole section together.  protect/endprotect will keep each element together but not the group of elements.
    There must be a way to find the current line number.

  • Limit the no of segments per IDOC to less than the current default value

    Hi friends,
    please help me in the following issue.
    The possibility to limit the number
    of segments per IDOC to less than the current default value.
    Purpose is to limit the traffic of IDOCs between systems.
    How to solve this issue to avoid traffic
    Thanks in advance.
    Regards
    Sandeep

    Hi Kiran,
    Actually we are using standard ones at that time we are getting prolems. When using custom developed ALE's
    we are putting segment size is less.To decrease segment size is there any filtering at the sender side? To change segment size may be nedd to take help form SAP.
    But if have filtering at any level from sender side need to confirm before consult SAP.
    Regards
    Sandeep

  • If the system prameter has value bigger than 1 trap the current copie value

    Hi.I have a report in which there is a requirement to be printed in two copies.So I put in the initial value of system parameter copies value 2.But I must print in the margin at the bottom of the page a label with TITLE-1 if we are in the first copie!!!, and a label with TITLE-2 if we are in the second copie.The report builder now always has the value copies=2.Is there some way to control the current copie value which means something like current page number in analogy current copie?
    Thanks in advance thrylos97.

    Hello,
    The parameter COPIES is treated by the "Printer Driver" and not by the "Data Model" / "Data Layout"
    If you want to be able to print Copy #1 / Copy #2 on the output, you have to create a repeating frame enclosing everything,
    base this repeating frame on a sql query :
    select "Copy 1" from dual union all select 'Copy 2' from dual
    and put the Copy # on the Layout
    Regards
    Edited by: dsegard on Mar 30, 2009 11:26 AM

  • I purchased an auto-renewing magazine subscription through a Newsstand app on my iPad. I have downloaded the iPhone version of that app. Can I now read the magazine on my iPhone, too, without having to purchase another subscription to the same magazine?

    I purchased an auto-renewing magazine subscription through a Newsstand app on my iPad. I have downloaded the iPhone version of that app. Can I now read the magazine on my iPhone, too, without having to purchase another subscription to the same magazine?

    What does the description for the magazine and/or the magazine's website say ? Some allow you to download on more than one device, but some magazines/newspapers only allow you one download of each copy.

  • How can I get a better driver for my 1394b Hostcontroller in my Macbook pro 2010 to solve the problem, that it is too slow under Windows 7 installed with bootcamp ?

    How can I get a better driver for my 1394b Hostcontroller in my Macbook pro 2010 to solve the problem, that it is too slow under Windows 7 installed with bootcamp ?
    WIndows can't find a better one than the installed LSI Conformed 1394 Hostcontroller

    Read and follow the Bootcamp Installation instructions that you were offered to view when you ran Bootcamp Assistant.
    Run Bootcamp Assistant again and select the option to download the Bootcamp Support software. Follow the instructions. Then boot into Windows and install the Windows Support software you downloaded and saved.

  • How to read the current value of hyperlink java bean in multiple record,

    I have used a java bean for a multi-record block item. On When-new form-instance I m using fbean package as follows
    FBean.Register_Bean(hHyperlink,1,'oracle.forms.demos.beans.Hyperlink');
    FBean.Invoke(hHyperlink,1,'setURL','Abc_Entry');
    FBean.Invoke(hHyperlink,1,'setLabel','Abc Document');
    FBean.Enable_Event(hHyperlink,1,'actionListener',true);
    You can see that I am using the number 1 which is hardcoded,for which I will replace with a incremental loop and remove it. Now when I m using the When-Custom-Item-Event, I want to read the URL for the current instance.
    I m using
    vcEventData := Fbean.Invoke_Char('CONTROL.HYPERLINK',2,'getURL');
    to get the second record value , where in I want to avoid the hardcoded 2 or 1
    Thank you

    I recommend you these forums for your question:
    Forums Home » Oracle Technology Network (OTN) » Products » Database » JVM
    Java in the Oracle Database
    Forums Home » Oracle Technology Network (OTN) » Technologies » Java » Java Server Pages (JSP)
    Java Server Pages (JSP)
    Forums Home » Oracle Technology Network (OTN) » Technologies » Java
    http://forums.oracle.com/forums/index.jsp?cat=24
    Joel Pérez

Maybe you are looking for

  • Duplicate records in BW Data Loads

    In my Project I am facing duplicate records in  Data Loads,  when I compare with PSA and DSO.  How to check those are duplicate and is there any mechanism through Excel Sheet or any?  Please help me out.  Advance thanks for your quick response. Edite

  • Change Range of viewobject at runtime in ADF UIX

    Hi, I use ADF UIX for listing a rowset of a table. I have set default range 10 from UI. I wish change this range at runtime and I have recovery the corresponding viewObject from application module. I have set range size to -1 and after execute query,

  • Error when creating Alert on PER_PERIODS_OF_SERVICE table (error:DRG-10502)

    R12.1.3 I have create an alert on PER_PERIODS_OF_SERVICE table (after insert, after update). After Terminating an employee, ALert Manager is attempting to run the DQM Serial Sync Index Program and am receiving the following error: DRG-10502: index AR

  • How to stop the message

    I have bought a iphone 5s to my mum recently. Her iphone and my iphone both using my apple ID. She always received messages that supose send to me. And that cost money. how could we stop it

  • My Mac pro is running very slow. Memory used 3.99 out of 4.00

    Hello, My mac is running very slow - I have noticed that memory used is 3.99 out of 4.00 and the process taking most of it is safari web content. Problem also appears when I use Firefox - this happens even I only have safari or firefox open. No other