How PCI confugure 6071E as a counter

Hello

This may seem like simple problem: we have a 1 kHz sinusoidal topic (0 - 5V), each pulse can differ a bit, and it has about 9500 cycles. The goal is to know how many cycles (edges of low to high) are there in the second 9.5 analysis.  We try to use PCI-6071E as meter, the sinusoidal signal is connected to GPCTR0_SOURCE. It seems to give the wrong answers by using the following program. Could someone please suggest the correct way to do it? Thank you

/*********************************************************************
* ANSI C++ program: 24-bit digital counter
* To compile in cmd.exe "cl /EHsc PeakCounter.cc.
*********************************************************************/

#include
#include "NIDAQmx.h".
#include
#include
#include
#include
#include
#include
#pragma how (lib, "NIDAQmx.lib")
#pragma how (lib, "odbccp32.lib")
#pragma how (lib, "odbc32.lib")

using namespace std;

#define DAQmxErrChk (functionCall) if (DAQmxFailed (error = (functionCall))) goto error; on the other

int main (void)
{
error int = 0;
TaskHandle taskHandle = 0;
uInt32 data;
char errBuff [2048] = {'\0'};

/*********************************************/
DAQmx Configure Code
/*********************************************/
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateCICountEdgesChan(taskHandle,"Dev2/ctr0","",DAQmx_Val_Rising,0,DAQmx_Val_CountUp));   PIN - PCI6071E, initial = 0
    
/*********************************************/
Starting code DAQmx
/*********************************************/
DAQmxErrChk (DAQmxStartTask (taskHandle));

printf ("without interruption of the poll. Press Ctrl + C to interrupt\n");
While {} (1)
/*********************************************/
Reading DAQmx code
/*********************************************/
DAQmxErrChk (DAQmxReadCounterScalarU32(taskHandle,10.0,&data,)); read the counter 10 sec delay
printf ("\rCount: %d", data);
fflush (stdout);
}

Error:
puts("");
If (DAQmxFailed (error))
DAQmxGetExtendedErrorInfo (errBuff, 2048);
If (taskHandle! = 0) {}
/*********************************************/
Stop DAQmx code
/*********************************************/
DAQmxStopTask (taskHandle);
DAQmxClearTask (taskHandle);
}
If (DAQmxFailed (error))
printf ("error DAQmx: %s\n",errBuff); ")
printf ("end of the program, press the Enter key to quit\n");
GetChar ();
return 0;
}

If you do not use the 6071E to count periods of sinusoidal signal, you can do this by configuring an analog trigger then the edges of the event of analog comparison.  Analog comparison event is a digital signal generated by analog trigger circuit and again permanently with your sinusoidal signal once the task has started.  The downside is that you must use your analog subsystem to create the trigger signal.

For an example, see here.

* Edit, I just noticed that you develop using the C API.  If you don't want to go in this way and need help implementation of the C API, let know us.  The general idea is exactly the same as what I described, and which is implemented in LabVIEW code which I have shown you.

Best regards

Tags: NI Hardware

Similar Questions

  • How can I get the shutter count for my Canon 7 d Mark II using Windows XP?

    How can I get the shutter count for my Canon 7 d Mark II using Windows XP? I have been looking for many places and make downloads of files, but I can't seem to find anything. I am wary of downloading software that I know nothing. Any help is greatly appreciated.

    Hi, I paid only $2.99 acquired program namely the supreme court on a 7 d Mark 2

    Search: direstudio.com to find out.

  • An associative array, how the records using the loop counter?

    In the associative array, how the records using the loop counter? for example
    declare
        type population is table of number index by varchar2(64);
        city_population population;   
    begin
        city_population('Samillve') := 200;
        city_population('Lindenhurst') := 300;    
        
        for i in 1 .. city_population.count
        loop
            dbms_output.put_line(city_population(i)); -- compiler error
        end loop;
    end;
    /

    That would look like

    SQL> ed
    Wrote file afiedt.buf
    
      1  declare
      2      type population is table of number index by varchar2(64);
      3      city_population population;
      4      l_index varchar2(64);
      5  begin
      6      city_population('Samillve') := 200;
      7      city_population('Lindenhurst') := 300;
      8      l_index := city_population.first;
      9      while( l_index IS NOT NULL )
     10      loop
     11          dbms_output.put_line(city_population(l_index ));
     12          l_index := city_population.next(l_index);
     13      end loop;
     14* end;
    SQL> /
    300
    200
    
    PL/SQL procedure successfully completed.
    

    Justin

  • How can I check if the counter entry is synchronized with the analog output?

    Hello

    I'm working on an application for counting photons.  I use two channels of analog output on a PCI-6713 card to send a frame model to a set of XY scan mirrors.  I then a photon count unit that emits a TTL signal when the photons are detected as a result of this raster analysis.  I then use a surfboard USB-6211 to count the edges on this TTL signal.

    I have problems that seem due to synchronization problems.  I use the sample AO on the PCI-6713 card clock like the door of my meter on the map USB-6211.  I use a trigger to start digital to analog output and a trigger of arms for the entrance to counter early. Is there a way to check that the analog output and counter entry of start of operations at the same time and are are synchronized?  I basically want to monitor and compare the ao real sample of the PCI-6713 card clock door signal used by the jury of the USB-6211.  I was able to export the sample AO clock and watch it on my oscilloscope, but not the signal from the door of the USB-6211.

    Thanks for your help,

    Brian

    Update... It turns out that there is no problem of synchronization between my meter input and the analogue output.  There was a difference of impedance when I connected my unit of counting photons to my USB-6211.  This caused an error variable count rate.  After accouting for this shift, the problem disappeared.

  • When and how does the 40 M Reset counter free running?

    Hello friends of LabView,

    I use a cRio 9002 controller RT with a chassis of FPGA 9101 and programming for the target FPGA VI.

    Now, I would like to know the following:

    -What format is the free tick counter 40 MHz running? What maximum ist possible to count?

    -What happens if the maximum number is reached? It resets? How long does take?

    -Or it just starts beginning with 0 without any time to reset?

    Thank you

    Marco

    Hello Marco,.

    using the screws of synchronization for FPGA, you can set the size of the counter internal 8-bit, 16-bit or 32-bit. This size value also sets the maximum possible number, which is the maximum value that can be represented by this record.

    There is no setting for this internal counter and he needs no extra time, as noted in LV for 'Number of cycles' help: a free course counter rolls when the counter reaches the maximum value of the internal meter size specified in the configuration dialog box.

    I hope that answers your question.

    Best regards

    Blase

  • How can I configure DAQmx to count on the pin of PFI0 positives

    I'm trying to track on a NI PCI-MIO-16XE-10 analog input lines, while in the same number of times the number of positives from triggering as I get to the pin of PFI0 I use LabView 2011 any help would be appreciated.

    For your device, counter entries are by default as:

    PFI 8 for Counter0

    PFI 3 for Counter1

    Just send it to PFI0 instead, see attachment.

  • How to make a loop simple counter in labview 7.1?

    I'm trying to teach me how to use labview 7.1, but having trouble finding how to use functions properly. I am trying to create a simple loop to count from 1 to 10 with a delay of 1 second between each number. I would be grateful the help!

    Classes resumed?

    The key words are 'loop' (try a loop FOR the palettte of structures), 'delay' (try a wait (ms) of the range of timing). Use a constant instead of diagram for the "1 second" (or 1000 ms). and use a digital display to show the current number (for example by using an indicator connected to a terminal of the loop iteration FOR). Given that [i] starts from 0, first use a primitive of + 1. Wire a constant at the end of the loop to determine the number of iterations. You should be able to determine the correct value, math or by trial and error.

    Now try to gather all, shouldn't be too difficult. Where have you problems? Have you looked at the examples? Did you do tutorials?

    Once you have a project, post it here and we can propose possible improvements.

  • How to get files from my count I don't need

    How to fix my count to run slow and take off I don't need files

    Hello

     
     
    What operating system is installed on your computer?
     
    If you are using Windows 7, I suggest you follow these methods and check.
    Method 1: Use of the disk clean up to free disk space.
    Delete files using disk cleanup
    http://Windows.Microsoft.com/en-us/Windows-Vista/delete-files-using-disk-cleanup

     
     
    Method 2:  After performing a disk cleanup, I suggest you to run a Disk Defragmenter.
    Fragmentation makes your hard drive to do extra work that can slow down your computer. Defragmenter reorganizes data fragmented for your drives and readers can work more efficiently.
    Improve performance by defragmenting your hard drive
    http://Windows.Microsoft.com/en-us/Windows7/improve-performance-by-defragmenting-your-hard-disk
  • How to check spelling and word count in Wordpad?

    I'm a beginner.    as you can see I'm not a good spelling, I'm writing a report in wordpad.  need to know how to check the spelling and do a word count in my report thanks

    WordPad is a very basic word processing, as such, it does not contain these features.

  • How to avoid the stalemate between count with all and several calls from an EP getBackingMapEntry...

    We have a processor input, which initiates a transaction lite by calling getBackingMapEntry on several similar entries.  The same cache distributed these similar entries of accommodation also simultaneously services count with all call and we often a blocking scenario comes from the fact that the count with all call trying to access/key in the same cache block - but in a different sequence - date entry processor accessed (for example, the European Parliament access to similar input 1 then similar input 2 while the count with all attempts to block the same but entries in sequence 2) then the entry 1).  The obvious solution is to change the sequence entry processor accesses these entries to match the sequence used by the count with all operation, but we do not know what sequence consistency applies to operations NamedCache.getAll.  Anyone know?  We believe that we excluded (e.g., consistency does not consider wrt the count with all access sequence) the following:

    • The sequence in an ordered collection of keys such as a list that is passed as an argument to count with all operation
    • The hash code of the key value
    • Any use of Comparable on the keys

    We use 3.7.1 consistency where it varies between 3.7.1 and 12 c.

    Thanks in advance.

    We've thought of it (always happens shortly after the publication on a support site).  If anyone is curious, it seems that the binary class implements Comparable and that consistency sorts instance converted by binary key and access the Scriptures based on this order sorted.  If the entry processor converts the keys to binary instances, sorts and accessed in sorted order, there is no potential blocking (of our observations, at least).  It would be nice if Oracle should document this that people better understand how to write safe concurrent code.

  • How to increment and decrement a counter with a single button

    Is there anyway you can increment and decrement a counter using only one button?

    I want this counter in place so that when I leave the stage and go back to it, the visibility of my button will remain the same because of being linked to the meter number.

    What would be the best way to implement that it doesn't work when I do it this way.

    function show_hide_MC(evt:MouseEvent):void {}

    MC.visible =! MC.visible;

    (Counter = 0) = (counter = 1);

    }

    btn.addEventListener (MouseEvent.CLICK, show_hide_MC);

    Thanks in advance!

    You can use a Boolean value (true/false) rather than a meter to keep track / affecting visibility.  You can use the counter simply to determine if you are starting the file or not.   When you click this button, you set the mc.visible property, and then assign the Boolean value of the visible property of the mc.

    var mcVisible:Boolean;    These two variables need to extend the length off the coast of the timeline
    var int count;

    if(Count == 0) {/ / you just started things so set up}
    mcVisible = mc.visible;
    Count += 1;
    } else {}
    MC.visible = mcVisible; you refer then set the visibility of the mc
    }

    function show_hide_MC(evt:MouseEvent):void {}
    MC.visible =! MC.visible; Toggle visibility
    mcVisible = mc.visible;    Remember how you left it
    }

    You can just use the number of establishments, incrementing every time that you click the button and using the module to determine if it has been clicked on an even number of times compared to an odd number of times, and then have a conditional that tests, which affects visibility... something like...

    var int count;           will start with a default value of 0

    We need to increase the length of the timeline

    If (count %2 == 0) {/ / this is the same value}
    MC. Visible = true;
    } else {/ / this is an odd value}
    MC. Visible = false;

    }

    function show_hide_MC(evt:MouseEvent):void {}
    MC.visible =! MC.visible; Toggle visibility
    Count += 1;

    }

  • How to get the total line count COUNT (*) SELECT and put on a page?

    Hello

    I use JDeveloper 10.1.3.4. I need get the total number of rows in a table and display it on a page and the problem in doing so. At the sqlplus prompt the row count simply would be, for example:
       select count(*) from BILL;
    I wonder if having this simple number must be so complicated and if there is more simple, better ways. Here's how I do it and the problem encountered.

    1. the name of the page to display the number is summary.jspx. It has a grain of support that "summed" as the managed bean name in faces - config.xml, and the name of the bean class is "summary." The component output on the page is:
    <h:outputText value="#{summary.totalStudentsCount}"
                  binding="#{summary.outputText5}" id="outputText5"/>
    2. in summary the bean code is:
        private Number totalStudentsCount;
        public static int NUMBER = Types.NUMERIC;
    
        public void setTotalStudentsCount(Number totalStudentsCount) {
            this.totalStudentsCount = totalStudentsCount;
        }
    
        public Number getTotalStudentsCount() {
            ZBLCModuleImpl zblcam = getZBLCModuleImpl();
            LoggedInStudentImpl studentTable = (LoggedInStudentImpl)zblcam.getLoggedInStudent();
            String sql = "select count(lsap_uid) from BILL";
            studentTable.setQuery(sql);
            return (Number)CallStoredFunction(NUMBER, "get_total_students(?)", new Object[] {});
        }
    
        private ZBLCModuleImpl getZBLCModuleImpl() {
            FacesContext fc = FacesContext.getCurrentInstance();
            ValueBinding vb = fc.getApplication().createValueBinding("#{data}");
            BindingContext bc = (BindingContext)vb.getValue(fc);
            DCDataControl dc = bc.findDataControl("ZBLCModuleDataControl");
            ApplicationModule am = (ApplicationModule)dc.getDataProvider();
            return (ZBLCModuleImpl)am;        
        }
    
        protected Object CallStoredFunction(int sqlReturnType, String stmt, Object[] bindVars) {
            CallableStatement st = null;
            ZBLCModuleImpl zblcam = getZBLCModuleImpl();
            try {
                st = zblcam.getDBTransaction().createCallableStatement("begin ? := " + stmt + "; end", 0);
                st.registerOutParameter(1, sqlReturnType);
                if (bindVars != null) {
                    for (int z = 0; z < bindVars.length; z++) {
                        st.setObject(z + 2, bindVars[z]);
                    }
                }
                st.executeUpdate();
                return st.getObject(1);
            }
            catch (SQLException e) {
                throw new JboException(e);
            }
            finally {
                if (st != null) {
                    try {
                        st.close();
                    }
                    catch (SQLException e) {
                        throw new JboException(e);
                    }
                }
            }
        }
    The idea of calling a stored function usnig as a "helper" method is 25.5.3 in the Developer's guide, which is closest to you in my need. It's for the functions with the one IN argument; but in my case, the function is not any argument IN. That's why, when you call the helper method CallStoredFunction(), I gave an empty as the last argument and amazing array that caused the problem:
    return (Number)CallStoredFunction(NUMBER, "get_total_students(?)", new Object[] {});
    3. the registered function has been tested and works fine at the sqlplus prompt:
    create or replace function get_total_students
       return NUMBER
    AS
       v_student_count NUMBER;
    BEGIN
       select count(ldap_uid)
       into v_student_count
       from bill;
       return v_student_count;
    END;
    4. when the summary.jspx page is run, the browser is full of error messages, the first long line is here (I have split several online for ease of reading):
    javax.faces.el.EvaluationException: 
      javax.faces.el.EvaluationException: 
        Error getting property 'totalStudentsCount' from bean of type 
        zblc.viewcontroller.backing.staff.Summary: oracle.jbo.JboException: 
          JBO-29000: Unexpected exception caught: 
            java.sql.SQLException, msg=Missing IN or OUT parameter at index:: 2
    Thus,.
    (1) what is the problem? What is this parameter IN or OUT of {color: red} index: 2 {color} consult? It has to do with the empty array as the last argument in the call to the helper method?
    (2) this approach is an overdose, and are there more simple and better ways?

    Thank you very much for help!


    Newman

    Hello

    Is there a specific reason why you don't simply create read only object to display with some count (*) as OFCASES from MYTABLE and then just drag and drop the attribute ofcases in page?

    Kind regards

    Branislav

  • Page numbers: how to ignore all other pages count

    I am trying to create a large number of postcards with sequential text following on the back of each postcard, who holds a master's degree 'B '. I want to add a paging option in the master which only has the masters 'B' pages, or side text of postcards. It is a very large document, so it would be nuts to proceed manually to each page.

    I tried everything in the page numbering to the point that I can understand, nothing helps.

    I looked at the list of styles to paragraph numbering option, but this would require the addition of a paragraph on each page. I need to do this at the master, in part because the numbering is integrated in a line of text that has also a section-based numbering and adjust according to the length of the number of grains.

    I know I could do this by creating two separate (one for the image-side) InDesign documents and one for the text to the side, export each PDF and recombine. But due to the large number of pages and other pains in this workaround, it's highly undesirable.

    In addition, this seems to be something really obvious, which I imagine others need before. Yet despite finding a ton, I could not find a solution. Am I missing something obvious?

    Thanks a lot for your help!

    Screen Shot 2014-09-19 at 1.38.05 PM.png

    Try this:

    -title of the folio mp text frame script

    Define slabel for a "a folio.

    Tell application "Adobe InDesign CS6"

    -a meter

    c Set to 1

    -check each page for mp items labeled folio and substitute

    Repeat with x in each page of the active document

    -replace the existing elements of MP

    Try

    delete substitution (point 1 of each element of x page whose label is slabel)

    try to end

    mpfolios the value of the elements of x-master page

    Repeat with i in mpfolios

    If i label is slabel then

    I have replace the destination page x

    end if

    end repeat

    -Add 0 s leader

    the value of nc from characters c (as string)

    If the nc is 1 then

    the value folionum to "00" & c have thong

    Otherwise, if the nc is 2 then

    the value '0' & c folionum have thong

    on the other

    c the folionum value as string

    end if

    -define the content of the folio to the counter string text block

    Try

    the value (point value 1 of each page element of x whose label is slabel) folionum

    set c to c + 1

    try to end

    end repeat

    tell the end

  • I deleted my Recycle Bin on my desktop and I can't find it in 'my computer' or 'control panel', how can I return to my counter top?

    Difficulty in recylcing bin

    http://support.Microsoft.com/kb/810869 MS - MVP - Elephant Boy computers - don't panic!

  • How to add an auto incremented counter on an image?

    Hello

    I need to develop the screens as above...

    I just added 3 images bitmap in Horizontalfield Manager and the Manager has added to the screen, now, my problem is that I must add labelField on the image of the middle... .i can't do

    someone help me pls

    pls reply fast...

    "my problem is that I must add labelField on the Middle image.

    Can you explain what you mean by that.

    I see two possibilities:

    (1) you want to add it immediately above or below the Bitmap image - in which case the display will show

    Bitmap image

    Label
    bitmap image

    Bitmap image

    or

    Bitmap image

    Bitmap image

    Label

    Bitmap image

    This is easily done with a VerticalFieldManager by inserting the LabelField to the right place - see insert method.

    (2) However, I suspect that you want to have the label on top of the Bitmap image, i.e.

    Bitmap image

    Bitmap and label on top

    Bitmap image

    It's a little more complicated.  The best way to do this is to create a BitmapField that will display the text or alternatively, a LabelField that display a bitmap in the background.  These two are possible.

    Another alternative is to use a different layout manager and set the LabelField where the Bitmap image was placed.  I think it's possible, but I never did.

    My personal preference is to create a LabelField, who has a background Bitmap.  When the LabelField is not text, it acts as a BitmapField

    In any case, tell us which of these options, you are actually after and we'll see what we can do to help.

Maybe you are looking for