Quadrature counter dividing and triggering

I'm currently looking into using an NI USB 6353 device in a project, and I'm confused about its capabilities. Here is what I'm trying to achieve:
1. Reading an A/B (no Z) quadrature input to increment/decrement a counter (preferrably in X4 mode).
2. Produce a digital output signal with transitions on each counter increment/decrement.
3. Frequency dividing the counter transitions to produce a digital signal used to trigger various external hardware. The divider should be specifiable (probably around a few thousand).
4. Using another frequency divided version of the counter to trigger simultaneous analogue/digital sampling on the device.
5. Have the ability to make the counter time based (just incrementing at a set frequency), rather than using the quadrature input. The resulting signals should all still be divided and output correctly.
Being able to use the digital outputs on the device independently (on demand, timing isn't particularly important here) would be great, too.
Is this possible using the DAQmx C or C# API? Are there any other devices I should be looking at?

Hi Matthew,
Matthew S wrote:
Wouldn't the change detection mean that I couldn't sample the digital input lines at a divided rate? Or can I simply implement the change detection using a single DIO port and still have the remaining DI lines to use?
I'm glad you brought it up--I guess I overlooked that you were planning to use clocked DI.  If you're using DI change detection you cannot sample the DI lines off of another clock source.  Unfortunately, port 0 is the only port that supports change detection (even though the manual currently implies otherwise) as well as the only port that supports clocked DIO.  You can still do static DI on other lines, but the clocked DI subsystem can only have one timing source.  You can always oversample your DI using the change detection, then index out 1 out of every N samples in software (the DI should be good at rates of up to at least 1 MHz continuously).
Matthew S wrote:
It sounds like the X-Series can do what we need. We'll probably stick with the 6353, because we need at least 20 analogue inputs, and sampling rates of at least 1MSps.
Keep in mind the 6353 is multiplexed--the aggregate rate is 1 MHz, but sampling 20 lines at the same time would only give you 50 kHz per channel.
Matthew S wrote:
I'm slightly confused as to how to use the change detection to implement what we want. Essentially, we'd like to take the X4 quadrature input and convert it to a step signal (as in, step/direction) that will be used to control a hardware variable antialiasing filter. Will this require another counter? If this can't easily be done on the USB DAQ device, we can do it using external hardware.
You can get the step from your x4 encoder with change detection easily enough, but I don't think there is a good way to get the direction as an external hardware signal.  I think the better option is to use a flip flop to latch the encoder state (either latch A using B as the clock or vice-versa) to obtain the direction.
Matthew S wrote:
How hard is it to get the direction and also speed (or frequency) of the
original quadrature input for each AI and DI sample taken? I assume
that the frequency measurement would require another counter? How about
direction?
If you're using a latching circuit to output the direction, you could just sample this off of one of the DI lines (assuming you have one available).  To measure the frequency of the encoder, I suggest looking into the method described in Figure 7-15 of the X Series User Manual to use another counter to measure the frequency of either A or B.  During each sample clock period the counter counts the number of encoder pulses as well as the number of internal timebase ticks that occurred during those pulses.  The driver uses this information to return the average frequency of your signal in between sample clock pulses.
So... you were right to have some concerns about using change detection alongside clocked DI.  You'll have to pick one or the other--I think I'd prefer to oversample DI and throw away samples, depending on the maximum frequency coming from your encoder.  Also of concern is the number of counters (there are 4 available on the board).  In addition to the 4 counters, keep in mind taht there is a Frequency Generator that can be used to output specific frequencies:
    {20 MHz, 10 MHz, 100 kHz} / {1:16}
Please don't hesitate to post back if you have any questions--there's alot you need to do so you might have to make some compromises.  We're starting to get into territory where an FPGA might be more suitable for your digital requirements.
Best Regards,
John Passiak

Similar Messages

  • Counter as divider and acquisitioin trigger

    Hi!
    I would like to do the following in LabView (7), using a PXI 6030E in a PXI (1010) chassis. (If neccesary I'll get a PXI6602).
    I would like to have a counter counting down from N, and then generating a pulse, or a trigger on an RTSI line, which starts an analog acquisition on the 6030E. The counter meanwhile has to reload to N and start counting down again. To put it another way, I need a configurable frequency divider which triggers an acquisition. The process needs to be done in hardware as much as possible, because I cannot afford to re-initialize the counter programatically each time it gets to zero. I was planning to use the 6030E's own counter/timers, but the chances are we'll get a 6602 because we need more c
    ounters.
    Here's your chance to earn my eternal gratitude...
    Thanks,
    Walter Tansini

    Walter,
    Although it is possible to load an initial count into a counter, it is not possible to have this value reloaded each time terminal count is reached. You could try using the Z-index functionality of an NI-TIO counter (NI 660x), but I have another idea that may provide the behavior you desire, and it can be accomplished with your PXI-6030E. You should configure a counter to perform pulse train generation. The signal you want to count should be specified as the source of the counter. You should then specify "raw" pulse specs for your pulse train. This will allow you to specify how many pulses of your source signal constitute the delay and pulse width of your pulse train. The shipping example Generate Pulse Train (DAQ-STC).vi demonstrates how to prog
    ram this task.
    Good luck with your application.
    Spencer S.

  • Generate trigger on n counts of quadrature counter?

    Hi,
    I have 6212 card. I use one counter to produce pulse train that drives a motor. The second counter reads position with quadrature encoder. Is there a way to configure the encoder counter to automatically send a pause/reference trigger to the first counter after a specified number of quadrature counts?
    Thank you

    Igor,
    I have attached the two VIs that I was using to test the simple count edges case.  You should run the Gen Dig Pulse Train-Finite-Retriggerable.vi first and then run the Count Digital Events.vi because it will send the pause trigger when the terminal count is reached.  I also looked at the Device Routes for the 6212 and you should be able to route ctr1internaloutput or ctr0 internaloutput to its respective trigger source terminal.  Please let me know if you are succesful.
    Thanks,
    Gio L.
    Digital Support - Product Manager
    National Instruments
    Attachments:
    Count Digital Events1.vi ‏32 KB
    Gen Dig Pulse Train-Finite-Retriggerable1.vi ‏38 KB

  • Problem with Roles and Triggers

    I'm having a strange problem with Roles and Triggers in Oracle. It's a little difficult to describe, so bear with me...
    I'm trying to create a trigger that inserts records into a table belonging to a different user/owner. Of course, the owner of this trigger needs rights to insert records into this other table. I find that if I add these rights directly to the owner of the trigger, everything works okay and the trigger compiles successfully.
    However, if I first create a Role and grant the "insert" rights to it, and then assign this role to the owner of the trigger, the trigger does not compile successfully.
    To illustrate this, here's an example script. I'm using Oracle 10g Release 2...
    -- Clean up...
    DROP TABLE TestUser.TrigTable;
    DROP TABLE TestUser2.TestTable;
    DROP ROLE TestRole;
    DROP TRIGGER TestUser.TestTrigger;
    DROP USER TestUser CASCADE;
    DROP USER TestUser2 CASCADE;
    -- Create Users...
    CREATE USER TestUser IDENTIFIED BY password DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP" QUOTA UNLIMITED ON "USERS";
    CREATE USER TestUser2 IDENTIFIED BY password DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP" QUOTA UNLIMITED ON "USERS";
    CREATE TABLE TestUser.TrigTable (TestColumn VARCHAR2(40));
    CREATE TABLE TestUser2.TestTable (TestColumn VARCHAR2(40));
    -- Grant Insert rights on TestTable to TestRole...
    CREATE ROLE TestRole NOT IDENTIFIED;
    GRANT INSERT ON TestUser2.TestTable TO TestRole;
    -- Add TestRole to TestUser. TestUser should now have rights to INSERT on TestTable
    GRANT TestRole TO TestUser;
    ALTER USER TestUser DEFAULT ROLE ALL;
    -- Now, create the trigger. This compiles unsuccessfully...
    CREATE TRIGGER TestUser.TestTrigger AFTER INSERT ON TestUser.TrigTable
    BEGIN
    INSERT INTO TestUser2.TestTable (TestColumn) VALUES ('Test');
    END;
    When I do a "SHOW ERRORS;" after this, I get:
    SQL> show errors;
    Errors for TRIGGER TESTUSER.TESTTRIGGER:
    LINE/COL ERROR
    2/3 PL/SQL: SQL Statement ignored
    2/25 PL/SQL: ORA-00942: table or view does not exist
    SQL>
    As I said above, if I just add the Insert rights directly to TestUser, the trigger compiles perfectly. Does anyone know why this is happening?
    Thanks!
    Adrian

    Hi Raghu,
    If the insert rights exist only on TestRole, and TestRole is assigned to TestUser, I can do the INSERT statement you suggest with no problems if I just execute it from SQLPlus (logged in as TestUser).
    The question is, why does the same INSERT fail when it's inside the trigger?

  • Function and triggers and procedures

    sorry to asking this question,
    In oracle. we use the function and triggers and procedure.
    for eg:
    if we wrote an trigger for a table. it fires at a time manipulating table. (database contains table contains datas and database also contains triggers likewise function,procedure).
    but my questions?: is
    In my database I kept only tables. no triggers,no function,no procedures. and
    i dont want to kept this triggers, function, procedures in database  Instead of i want to kept this triggers, function, procedures in business logic layers(middle tier)
    is it possible? .
    if yes means, how to write or where to write? please help me, or else send the guidance documents or blog releated to it.

    Subu123,
    the +1 related to Would be great if you can take step back and see the implementation from another angle. First see why do you need DB trigger/function etc.Then check whether it is possible to implement the functionality using ADF BC + feasibility study between 2 approaches(I didn't mean to invoke DB objects from business components, instead checking the feasibility of implement the same functionality in your EntityObj/ViewObj/Service calls )Before making a decision for or against holding fuctions, triggers and procedures in the DB, you have to get the whole picture.
    Think about a trigger outside the DB. What could this be and why or for what is it used?
    All the answers are pointing to 'lets keep them in the DB'. Now there are situation where you don't have a DB or are not allows to use it. Still there can be triggers, only they are implemented in a different way.
    The same can be said for procedures and functions.
    So you have to think about the whole problem and how each sub problem you have to solve work together to resolve the whole problem.
    I'm personally tend to keep the business logic the the DB if the business logic is already there (e.g. I have to migrate an old forms app).
    If I design a new app I tend to keep the logic in java. Only sequences (for generating ids) and some other stuff which is purely db related like cleaning up tables I keep in the DB.
    Timo

  • Info Package Group Management? and Triggering of Event Chains ?

    Hi GURU's
    Info Package Group Management? and Triggering of Event Chains ?
    Thanks
    Bhima Chandra Sekhar G

    Hi Bhima!
    IP GROUP:
    http://help.sap.com/saphelp_nw04/helpdata/en/80/1a65b5e07211d2acb80000e829fbfe/content.htm
    About chains and triggering events:
    http://help.sap.com/saphelp_nw04/helpdata/en/41/243d3828135856e10000009b38f842/content.htm
    Hope it helps!
    Bye,
    Roberto

  • Need help in user privilage and triggers

    hi,
    i need to create general users who can insert a row into a table but should not be able to delete any data, so which minimuim privilages i should assign.
    grant connect session and grant resource or anything else?
    and one more prob in triggers, i have written a trigger to trigger if expamt exceeds eclimit. i am gettin errors
    create or replace
    TRIGGER TR_EXCEEDLIMIT
    AFTER INSERT OR UPDATE OF EXPAMT ON EXPENSEITEM
    FOR EACH ROW
    DECLARE
    V_ECLIMIT EXPCAT.ECLIMIT%TYPE%;
    BEGIN
    SELECT ECLIMIT INTO V_ECLIMIT FROM EXPCAT
    WHERE ECNO = :NEW.ECNO;
    IF(:NEW.EXPAMT > V_ECLIMIT) THEN
    INSERT INTO LOG_TABLE (excno, exctrigger, exctable, exckeyvalue, excdate, exctext) VALUES (LOG_SEQ.NEXTVAL, 'TR_EXCEEDLIMIT', 'EXPENSEITEM', :NEW.EINO, SYSTEMSTAMP, ('INSERTED OR UPDATED DATA OF EXPAMT EXCEEDS THE VALUE IN ECLIMIT');
    ENDIF;
    END TR_EXCEEDLIMIT;
    errors
    Error(7,30): PLS-00103: Encountered the symbol "%" when expecting one of the following: := ( ; not null range default character The symbol "%" was ignored.
    Error(12,235): PLS-00103: Encountered the symbol ";" when expecting one of the following: ) , * & | = - + < / > at in is mod remainder not rem => .. <an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_ LIKE4_ LIKEC_ between overlaps || multiset year DAY_ member SUBMULTISET_ The symbol ")" was substituted for ";" to continue.
    Error(14,5): PLS-00103: Encountered the symbol "TR_EXCEEDLIMIT" when expecting one of the following: if

    You don't need to select the (sys)timestamp from dual, you can directly assign it:
    create or replace trigger tr_exceedlimit
    after insert or update of expamt on expenseitem
    for each row
    declare
    v_eclimit   expcat.eclimit%type;
    v_timestamp timestamp := systimestamp; -- or localtimestamp
    begin
    select eclimit into v_eclimit from expcat where ecno = :new.ecno;
    if (:new.expamt > v_eclimit) then
      insert into log_table
       (excno, exctrigger, exctable, exckeyvalue, excdate, exctext)
      values
       (log_seq.nextval,
        'TR_EXCEEDLIMIT',
        'EXPENSEITEM',
        :new.eino,
        v_timestamp,
        'INSERTED OR UPDATED DATA OF EXPAMT EXCEEDS THE VALUE IN ECLIMIT'
      dbms_output.put_line('ERROR: EXAMT EXCEEDS ECLIMIT');
    end if;
    end tr_exceedlimit;You cannot use timestamp, but you can use localtimestamp or systimestamp.
    See the Oracle Docs @ http://tahiti.oracle.com for more details on them (and triggers).
    Also:
    Error(15,5): PL/SQL: ORA-02289: sequence does not existCheck your LOG_SEQ sequence, does it exist and are privileges set correctly?
    Edited by: hoek on Jan 26, 2010 8:20 AM typo in link

  • Java stored procedures and triggers in lite

    Hi
    We are using java stored procedures and java triggers in our application for oracle lite database 5.1.
    We would like to know whether these procedures and triggers are uploaded or associated with tables or not because triggers are not being fired for the tables.
    The question is - how to find the uploaded procedures and triggers in system tables.
    We dont find any tables like (all_objects, user_objects) for this in oracle lite system catalogs given in the documentation.
    thanks in advance
    yugandhar

    I don't have much experience with Lite, but I'm running 9i Personal Edition. Any information about triggers can be found in the "ALL_TRIGGERS" view. You will want to filter out any rows where OWNER = 'SYS' unless you created your triggers as SYS. As for procedures and functions, you can see what you have created in the "ALL_OBJECTS" view where OBJECT_TYPE = 'PROCEDURE' or 'FUNCTION', once again filtering out rows where OWNER = 'SYS'. To see the code of any procedure or function, select substr(text,1,80) from ALL_SOURCE where NAME = 'function name' ORDER BY LINE.
    Hope this helps!

  • Java Stored Procedures and Triggers

    I want to to use Java stored procedures and triggers within the Oracle 11g XE
    So please , someone can help me because i tried but it didn't work
    I don't know where is the problem
    Thanks !!

    WRONG FORUM!
    Welcome to the forum but this forum is for Java JDBC questions and issues. Your question should be posted in the SQL and PL/SQL forum
    PL/SQL
    >
    I want to to use Java stored procedures and triggers within the Oracle 11g XE
    So please , someone can help me because i tried but it didn't work
    I don't know where is the problem
    >
    Mark this question ANSWERED and repost the question in the other forum
    Before you post review the Oracle Database Java Developer's Guide - it shows how to create Java stored procedures and has example code
    http://docs.oracle.com/cd/B28359_01/java.111/b31225/chfive.htm
    And in the new post don't just say "I tried but it didn't work". You need to post the code that you tried and what you mean by "didn't work".
    If you got any exceptions or errors you need to post a copy of the exact message or error that you are getting.

  • Oracle 8i Lite and Triggers

    In Oracle 8i Lite I can't find the data dictionary view of triggers (e.g.: all_triggers, etc.). I can't create triggers. Are triggers available in Oracle 8i Lite?

    Hi,
    I am qouting below from the oracle 8i Lite documentation which says it supports triggers . Please clarify.
    Oracle Lite DBMS
    Oracle Lite DBMS is a lightweight (50KB - 750KB), Java enabled database designed from the ground up for laptops, handheld computers, PDAs and smartphones. It supports industry standard ODBC, JDBC, SQLJ, and Java Stored Procedures and Triggers. It provides a streaming fast "C" interface, OKAPI, to its object kernel. It also supports Java Access Classes, JAC, a fast and easy way to make Java Objects persistent. Oracle Lite DBMS now supports all popular mobile platforms, including Palm OS, EPOC, and Windows CE, letting you deploy enterprise applications on virtually any mobile device.
    Regards
    null

  • Can i use Stored procedures and triggers with SDK

    hi all
    How to use the stored procedure and Triggers with SDK, can i get a sample code
    Regards
    Salah

    Hi, Salah.
    Use "Exec" in your query to run procedures.
    SAPbobsCOM.Recordset     oRS;
    oRS = (SAPbobsCOM.Recordset)pCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
    oRS.DoQuery ("EXEC YourStoredProcName");
    Triggers are not supported in SDK.
    Regards,
    Aleksey

  • Read access to procedures,function,packages and triggers

    Hi,
    I created a user with CREATE SESSION,SELECT ANY TABLE privilege. My objective is to create a user with read only access to other schemas. But the newly created user is not able to read procedures,function,packages and triggers. The new user need read access to procedures,function,packages and triggers. What is the priviege required for this access? Please help me to resolve this issue.
    Regards,
    Mat.

    Hi,
    Grant select all will give select privileges to all schema level objects except procedures,function,packages and triggers. But I need to grant read privileges on these objects to newly created user.
    Regards,
    Mat.

  • How to use Java code to implement Divide-and-Conquer multiplication???

    i think use Divide-and-Conquer multiplication algorithm to multiply 31415975 by 81882818. Because i have study data structure and algorithm for needs people helps to solve this problem!!! The answer is should equals the both number (31415975 * 81882818) multiplication! There are must pass the program to calculation the multiply with use divide-and-Conquer!
    How to use the program calculation the both number multiplication with divide-and-Conquer??? That is needs display the different number multiplication on the screen!!!

    This is what I think you meant to say
    yijun1988 wrote:
    I am considering using Divide-and-Conquer multiplication algorithm to multiply 31415975 by 81882818.
    Because i have study data structure and algorithm.
    I need help to solve this problem!
    The result should equal the product (multiplication) of the two numbers (31415975 * 81882818)
    The input must be passed as parameters to the program to calculate the product using Divide-and-Conquer!
    How to implement number multiplication with divide-and-Conquer?
    The steps of the algorithm need to be displayed on the screen!Which part of this are you having problems with?

  • How to get count,index and compare to arraylists

    hi
    how to get count,index and comparing of 2 arraylist.... plz suggest me asap...

    How is your question related to JDBC? And what have you done so far with your code?

  • Counting even and odd values

    Is there another way to count even and odd number than this one
    private static int countEvenOrOdd(int[] array, boolean countEvenNumbers){
              int count = 0;
              int remainderRequired = (countEvenNumbers ? 0 : 1);
              for(int i = 0; i < array.length; ++i){
                   if(array[i] % 2 == remainderRequired){
                        ++count;
              return count;
         }

    > I like hacking ;-) Have a look at this: ...
    Jos, you forgot the method for counting both:int countOddsAndEvens(int[] array) {
    return (countOdds(array) + countEvens(array));
    } ; )Yep, you're right, and for completeness reason I'd like to add the following:int countOthers(int[] array) {
       return array.length-countOddsAndEvens(array);
    }And for those junit maniacs:boolean testCounters(int[] array) {
       return countOddsAndEvens(array)+countOthers(array) == array.length;
    }btw, the moment I posted my previous reply I realized that I could've done better:int countOdds(int[] array) {
       int c= 0;
       for (int i= 0; i < array.length; c+= array[i++]&1);
       return c;
    }kind regards,
    Jos ( <-- never has to maintain others' code ;-)

Maybe you are looking for

  • Can't open a project in FCP 7

    Hello: I can't open a FCP 7 project. Every time I try to open it, the project get stuck at 2% and then I received  a notice that FCP 7 is not responding. The project is at an external hard drive. I run some tests and the drive is fine. I can open oth

  • How do I repair a scratch on my laptop?

    How do I repair a scratch on my laptop?

  • I-pod nano click wheel does not work help!

    Hi, My i-pod nano 1st gen click wheel will not work i have tried restoring,restarting and all the 5 r's but still nothing has happened... there has to be a solution out there somewhere o yea i have also tried taking out the gunk in the click wheel bu

  • Vista SP2 Update Failed To Install

    Can anyone help?  I am having a problem with this particular Microsoft update.  I have my Lenovo 3000 N500 set to automatic updates for Windows.  However, the SP2 update has failed to install on numerous occasions.  I get an error number but am unabl

  • I need help connecting a 27" display to a mid2007 intel 24" imac

    In the store I explained which model I was using and they insisted the mini displayport cable was compatible (it's not a thunderbolt display btw) but the port on my imac does not match the cable and either I need an adapter or I need to return the di