Generate intervals of reactivation of precision using PCI-6602 software?

I use NEITHER-DAQmx in Visual Studio 2005 C++ under Windows XP.

I'm NOT using LabView.

I make an executable with high process priority and wish to have a real-time thread to wake up at time intervals of precision.

Currently, the time interval is 0.1 s (10 Hz).

I'd like the alarm clock to have low jitter, a few dozen microseconds or better.

Currently, I use a hack of previous work, generating a pulse with a period of 0.1 sec on a counter and wiring it in another counter to measure.

I use the DAQmxReadCounterU32() function with a value of 2 seconds of pause timeout and then reactivate my phone once the measurement is complete.

This "works" but the jitter is terrible: up to as much as 15 milliseconds for a freshly booted PC and 2 milliseconds after I enabled the features of multimedia timer.

What I want is just DAQmx function returns control to my request immediately after a break timer with optional output wiring of this impulse to timer.

So, how can I do this?

I came across a good solution.

I created a task to count the 10 Hz amounting to inheriting from the ctr edges 4.

This 10 Hz pulse is generated by another task on ctr 6 and is connected to the door of the ctr of 4.

But then, the trick is to synchronize the clock of installation using this same edge sampling:

RV = DAQmxCreateTask("",&taskHandle1);
RV = DAQmxCreateCICountEdgesChan (taskHandle1, "Dev2/ctr4","", DAQmx_Val_Rising, 0, DAQmx_Val_CountUp "");
RV = DAQmxSetCICountEdgesTerm (taskHandle1, "Dev2/ctr4","/ Dev2/PFI22" ');
RV = DAQmxCfgSampClkTiming (taskHandle1, "" / Dev2/Ctr6InternalOutput ", 100.0,")

DAQmx_Val_Rising, DAQmx_Val_HWTimedSinglePoint, 1);
RV = DAQmxStartTask (taskHandle1);

The thread at the time read real and simple loop indefinitely around the following statement which has a 2 second timeout:

RV = DAQmxReadCounterScalarU32 (taskHandle1, 2.0, data, NULL);

This reading will return immediately after a new rising occurs and then I have another task that switches to a digital output line that allows me to determine latency between the front and my code is activated.

I recorded and plotted a few minutes delay data and see my latency time varies between 50 and 110 microseconds, which I think is as good I'll get here.

See attachment data field.

The other good news about this method is that is uses less than 1% of the time processor.

Tags: NI Hardware

Similar Questions

  • Can PCI 6602:How I use digital lines of the Board of Directors and at the same time to generate trains of pulses by using a meter?

    Hello!

    My problem appeared when I tried to update my traditional NOR-DAQ legacy code to DAQmx.

    I use 2 meter (meter 5 and 7 meter) on PCI-6602, to generate trains of pulses, as well as the lines of e/s digital port 0 (the form lines from 0 to 7). What I do in my request, it's that I'm starting to generate the pulse train on the output of 2 meters and after that I play with the State of digital lines.

    Traditional, it was no problem to use the meters and digital lines at the same time, everything went perfectly, but in DAQmx, is not possible.

    What's happening: I start generating train of pulses on the output of counters, no errors, but when I try to change the State of a line of digital port the generation of the pulse train is stopped. What happens when I start the task associated with the digital way.

    My question is: is it possible to create a channel on digital lines without changing the channels created for meters?

    Another thing that I managed to do with the panels 'Measurement and Automation Explorer' and Test for PCI-6602, is basically the same thing, I generate trains of pulses on the output of the 7 meter and try to start a job on the digital line, but I get an error:

    "Error-200022 occurred in test Panel.
    Possible reasons:
    Measurements: Resource requested by this task has already been reserved by another task.
    Device: Dev4
    "Terminal: PFI8.

    On the contrary if I use the counter 0 or a counter 1 to generate trains of pulses I encounter the same problem.

    What resources are used by 2 to 7 of the PCI-6602 card counters and the counters to 0 and 1 do not use?

    Thanks in advance for any answer!

    Ciprian

    After doing some real tests on this device, I found that it is a normal behavior for the jury of 6602.  This is because when you start a task digital all 32 lines are configured for digital i/o, so it replaces your meter operation.  The article below the link explains a little more on this subject.  You must start the digital task before the task of counter to use the features of both in your program.

    2 meter and above will not work correctly when you perform digital i/o on NI 6601 or 6602

    http://digital.NI.com/public.nsf/allkb/43F71527765EEC3886256E93006CD00C?OpenDocument

  • Photon counting using Photon unique cash Module and PCI-6602

    Hi all

    I am currently working on program couting of photons using a single (Excelitas) and PCI-6602 photon counting module connected to the BNC-2121.

    I took a glance at other positions, but I still couldn't solve my problem (or, again, I'm not sure if yes or no, the problem is the specification of the material).

    In the program, I'm generates a trigger to 1 MHz pulse using a trigger in a separate loop.

    Other than that, I have loops of the producer-consumer model to get data and do a simple subtraction to calculate the number of photons in 1 microsecond.

    According to the values connected to 'Input.BufSize' of buffer DAQmx and "Samples per channel" DAQmx calendar, I could change the loop number that the program has done its job correctly.

    With the values, the program acquires photon 1 MHz with signls for 139 times.

    After that, the program stops and the loopback number increases very quickly.

    When I forcifully took stop the program, while the loop number increases very quickly, the program appears "error-200141".»

    The error that says "data has been replaced before it can be read by the system." Mechanism of data transfer is interrupted, try to use DMA or USB in bulk. Otherwise, divide the input signal before taking the action. "even if the meter explicitly works in DMA mode by using the sample clock.

    I wonder there is nothing that can solve my problem or even the only solution will buy a better Board of counters/timers.

    Thank you all for reading this.

    I will be very happy with any index

    Kind regards

    Myeongsu

    Yes, the same thing happens on my system.

    It does not happen with PCIe-6612.

    I found more strange things:

    When I start to reduce the frequency at a time given (800kHz) can fill the buffer, it will not start since the beginning of the buffer. He can go to the beginning of the buffer only at 100 kHz for my PC.

    Options to fix:

    (1) PCIe-6612. Seems to work. I tried streaming at 10 MHz, 5 min - fine.

    (2) reduce the frequency of the pulse. If your laser supports 100 kHz, you're fine.

    (3) put in place additional synchronous counter at 100 kHz. Basically, it's material average number of photons by 10 pulses.

    (4) read 2 adjacent pulses each 1/50 kHz - then your data transfer will be 100 kHz and you will get the number of photons of this impulse of the 20 - th.

    Programming issues:

    (1) remove the display of the received picture, make only the processing of data and show results if you really need it.

    (2) clock.vi sample sets the buffer size, if you specify the size of the buffer, do this after this vi.

    (3) I deleted unnecessary "loop generation." He is running on the hardware and stops when you stop it - after reading the loop ends.

  • About precision for PCI-6229

    We use PCI-6229 and make the following wiring: released AO1 is connected to the entrance of the AI6, AO0 output is connected to the AI7, Both AI6 AI7 are configured and wired in incremental ways. I have checked the wiring, grounding, plug on the accuracy, the calculator of accuracy on the web site OR.

    We have a small application that writes some values to the AO channels, which, in turn, go directly to the channels to HAVE it.

    The application writes the values of every 1000 msec, playback is every 50 milliseconds.

    That is the problem. For the first pair (AO1-> AI6) values are very close, but the second pair on the same terminal (AO0-> AI7) are very different. And the tension of surplied at AO, the greater the difference.

    I read that the accuracy gets worse when the voltage becomes smaller, but why accuracy is so different for channels on the same card?

    Here are a few values.

    AO1                AI6                   AO0                AI7

    0.011477 0,011719 0.006868 0,007812
    0.011464 0,011719 0.006855 0,007812
    0.011503 0,011719 0.006855 0,007812
    0.011509 0,011719 0.006797 0,007812
    0.011490 0,011719 0.006823 0,007812
    0.011477 0,011719 0.006907 0,007812
    0.011516 0,011719 0.006823 0,007812
    0.011522 0,011719 0.006810 0,007812
    0,015625 0.012691 0.008088 0,011719
    0,015625 0.015488 0.010854 0,011719
    0,015625 0.015566 0.010919 0,011719
    0,015625 0.015514 0.010834 0,011719
    0,015625 0.015521 0.010867 0,011719
    0,015625 0.015527 0.010873 0,011719
    0,015625 0.015482 0.010854 0,011719
    0,015625 0.015508 0.010880 0,011719
    0,015625 0.015495 0.010899 0,011719
    0,015625 0.015514 0.010860 0,011719
    0,015625 0.015462 0.010821 0,011719
    0,015625 0.015514 0.010821 0,011719
    0,015625 0.015547 0.010828 0,011719

    Thanks in advance.

    Hello vera,.

    Our maps of the M series have a digital-to-analog converter, separate for each channel of the AO.  Thus, each channel AO will have slightly different properties and inaccuracies, but they will all conform to specifications.

    Kind regards

  • Can I use PCI-MIO-16-4 with windows 7

    I'm still on windows XP, but will be upgrading to windows 7. Can I still use PCI-MIO-16-4.

    I guess not.  I don't see where he works with DAQmx and the NOR-DAQ (now called traditional DAQ) is not compatible with Windows 7.

  • Continuous output of digital waveforms on PCI-6602

    I use 6602 PCI to get a continuous 1 MHz square wave output of DIO1 ~ 32 sequentially controlled by LabVIEW. I Ctr0 to generate a clock 2 MHz and used Ctr0InternalOutput as a source of sample for DIO1 clock ~ 32. I have attached the code and the texture as follows.

    The code works fine on PCIe-6251 and digital waveforms of 1 MHz is very stable.

    But when I run on PCI-6602 I got an error-200077 (you asked for: sample clock; you can request: on-demand).

    6602 PCI does support material timing? I found no information about this its specifications. If she can't, how can I avoid this problem and get what I want? Thank you!

    Yi

    Version: LabVIEW 8.2

    hardware: PCI-6602

    Hello

    Have you looked at the specification for the 6602?

    http://sine.NI.com/NIPs/CDs/view/p/lang/en/NID/1123

    Click on "specifications".  Scroll down to "digital i/o".  Watch "Timing".  It clearly says "software".

    The DIO lines on this Board are not timed by the hardware.  They are clocked by the software.  The data sheet that explains very clearly.  That's why you see the error clock sample - that the Council can't stand DIO clocked by the hardware.

    The 6251 supports clocked by DIO material, so why your code works very well with this Council.  You can do the generation of signals with a 6602.

    Hope says.

    d

  • Synchronization of the signal with PCI-6602

    Hello

    I need to generate three signals that must be synchronized.

    To do this, I use a PCI-6602.

    The first signal is used to trigger a device, the second signal is used to simulate the noise.

    The third signal should wear the noise so that it starts before the trigger signal and stops shortly after the trigger signal.

    The signals are then combined with an external logic circuit.

    (To see what I mean, see the first PDF).

    I use a fourth timer to synchronize all other clocks, but the three signals are beginning to run before starting the timer task. I have this evaluated using not to no and a oscilloscope.

    The trigger and gate (first and last signal) are below 100 Hz, the noise signal is about 200 kHz.

    At least the trigger and the door must be started synchronously, otherwise the waveform is not what we want. The noise signal didn't need to be synchronized.

    I am sure I am missing just a little detail here, maybe you can show me what I missed.

    Please check my screenshot of LabView to see what I've done here.

    If you want more information about the VI, I can take apart a little and send it, too.

    Try using start to the outputs of the 3 meter (see attached VI)

  • Support for triggers in PCI-6602 for counter input / output meter opearions


    I'm sorry, it took a lot of time to test my application in a real NI PCI-6602 map. I am now convinced that put off against channels support start trigger, arms and relaxing break start trigger. But the input meter channels use pause trigger and trigger start of arms only.

    I designed the app so that counter 0 is used as a channel of the meter and meter 1 serves as an output of the meter channel. The two channels are configured to use triggers to start of arms. Arms start triggers should come from a line of the RTSI. Using the terminal line 0 RTSI route connect API to arm the trigger for the start of the two channels. So when a pulse comes to line 0 in the RTSI two counter starts counting.

    One last thing, I'd like to know, is how RTSI signals are generated? I know that RTSI is used for synchronization of several cards of NOR.

    If there is only Board can we use the signal of the RTSI?

    Can the hardware PCI 6602 itself generates all signals to the RTSI lines?

    Thanks in advance.

    Johnson

  • Pulse width depends on the number of pulses (pci-6602)

    Hello

    I'm trying to generate samples done with pci-6602.

    I use CO Pulse ticks + implicit options

    External impulses is 1ms 1PPS pulse from the trimble GPS receiver

    If I set the number of pulses = 1, then I had to pulse length (high ticks - 1) =

    If I set the number of pulses > = 2 and low ticks > = 3, then I got pulse length = (high ticks)

    If I set the number of pulses > = 2 and low ticks = 2, then I got last puls width = (high ticks - 1) and all other vegetables dry with length = (high ticks)

    With a single generation pulse width pulse is (high ticks - 1)

    Is there an option to configure the same pulse width for any number of pulses for a train over (N pulse)

    screens to fix


  • Response time of PCI-6602

    Dear users of the forum,

    I use a Counter/Timer OR PCI - 6602 for send TTL signals to another device in our laboratory. I send the signal every ~ 1-5 ms, but this time is not fixed (it depends on some other process that I do in my program of LabVIEW), so I can't use a continuous waveform.

    So, I wrote a short test program to familiarize yourself with the PCI-6602 (see attachment).

    If I send a pulse, it seems I can do this just about every 14 ms (at least this is calculated with the tick counts lag which is not very accurate; but to count the pulses with a meter gives almost as much time). So, it seems that the PCI-6602 has too long a response time for my application!

    Can someone tell me if he made the same comment? Either I use the bad vi/treat the PCI-6602 in the bad sense? If Yes, what should I do to make my small test program and finally my main program faster?

    I would be recognizing all the help and the comment!

    partial81,

    I have another idea for you to try.  Starting the 6602 being the operation that takes the most time I wrote an example which uses a trigger to start to generate the impulse and puts in place the meter to retriggered.  Basically whenever you issue a start trigger, the meter will generate a pulse.  I then use a digital line on the 6602 to generate this trigger to start (I use PFI0 and Port0/$line0 which is actually the same line in the material).  For the reenclenchee generation, wait until what is not useful, so I replaced it with a 1 ms wait.

    Can you try this and see if it works better for you?

    Dan

  • count digital events on a counter with pci-6602 with reminder on the CVI

    Hello

    I use a card PCI-6602 with CVI 8.5 and I need trig on the event.

    On each pulse, I received, I need to do some actions like increasing a counter, send a message to Rs232 etc... I want to do no loop by checking that the value of the counter has changed. I would use a reminder to run this code only on the value of edge or a counter event.

    My problem is that I don't know what function for this. Is it possible to get an event on a pci-6602?

    Thank you

    James

    It's true. If a earlier without change detection and it works.

    Thanks for your help.

  • Pre-installed ASUS didn't work very well and two weeks ago he report is not using genuine Microsoft software

    I have a MS Windows 7 genuine, running in my ASUS which was preinstalled.  It worked fine up until about 2 weeks ago and now all the few hours I get a message that I don't use MS genuine software.  I did the reactivation with a technician from MS but still get this message.  What is the problem and how can I stop this annoying pop up message appear?  Here are the diagnostic report:

    Diagnostic report (1.9.0027.0):

    -----------------------------------------

    Validation of Windows data-->

    Validation code: 0x8004FE22

    Code of Validation caching online: 0x0

    Windows product key: *-* - PKK9J - 2FM2X-M97DF

    The Windows Product Key hash: x1d8Rq5TUMieRnUmO0j7FMoZP4g =

    Windows product ID: 00359-OEM-9808494-92422

    Windows product ID type: 8

    Windows license type: COA SLP

    The Windows OS version: 6.1.7601.2.00010300.1.0.003

    ID: {1B41B3D4-4A6F-4BE0-8451-FC25F13DAEAD} (3)

    Admin: Yes

    TestCab: 0x0

    LegitcheckControl ActiveX: N/a, hr = 0 x 80070002

    Signed by: n/a, hr = 0 x 80070002

    Product name: Windows 7 Home Premium

    Architecture: 0 x 00000009

    Build lab: 7601.win7sp1_gdr.120830 - 0333

    TTS error:

    Validation of diagnosis:

    Resolution state: n/a

    Given Vista WgaER-->

    ThreatID (s): n/a, hr = 0 x 80070002

    Version: N/a, hr = 0 x 80070002

    Windows XP Notifications data-->

    Cached result: n/a, hr = 0 x 80070002

    File: No.

    Version: N/a, hr = 0 x 80070002

    WgaTray.exe signed by: n/a, hr = 0 x 80070002

    WgaLogon.dll signed by: n/a, hr = 0 x 80070002

    OGA Notifications data-->

    Cached result: n/a, hr = 0 x 80070002

    Version: N/a, hr = 0 x 80070002

    OGAExec.exe signed by: n/a, hr = 0 x 80070002

    OGAAddin.dll signed by: n/a, hr = 0 x 80070002

    OGA data-->

    Office status: 100 authentic

    Microsoft Office FrontPage 2003-100 authentic

    OGA Version: N/a, 0 x 80070002

    Signed by: n/a, hr = 0 x 80070002

    Office Diagnostics: 025D1FF3-364-80041010_025D1FF3-229-80041010_025D1FF3-230-1_025D1FF3-517-80040154_025D1FF3-237-80040154_025D1FF3-238-2_025D1FF3-244-80070002_025D1FF3-258-3

    Data browser-->

    Proxy settings: N/A

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Win32)

    Default browser: C:\Program Files (x 86) \Mozilla Firefox\firefox.exe

    Download signed ActiveX controls: fast

    Download unsigned ActiveX controls: disabled

    Run ActiveX controls and plug-ins: allowed

    Initialize and script ActiveX controls not marked as safe: disabled

    Allow the Internet Explorer Webbrowser control scripts: disabled

    Active scripting: allowed

    Recognized ActiveX controls safe for scripting: allowed

    Analysis of file data-->

    Other data-->

    Office details: {1B41B3D4-4A6F-4BE0-8451-FC25F13DAEAD}1.9.0027.06.1.7601.2.00010300.1.0.003x 64*-*-*-*-M97DF00359-OEM-9808494-924228S-1-5-21-4252262282-12887819-1350643119ASUSTeK Computer Inc. CM5675 American Megatrends Inc.. 0501 20100610000000.000000 + 000FC 2911350701840004090409Central Standard Time(GMT-06:00)03_ASUS_portable100100Microsoft Office FrontPage 200311OvNI8jHHbKmCVMkSOIP8TI7dmy0 =72079-640-1873547-5517614 26B0544495CBD00

    Content Spsys.log: 0 x 80070002

    License data-->

    You have a corrupted file.

    it WILL NOT activate or validate up to which is fixed.

    Run a full scan of CHKDSK and SFC...

    Click Start > all programs > Accessories

    Right-click on the entry of the command line

    Select run as administrator and accept the UAC - elevated command prompt window prompt should appear.

    At the command prompt, type

    CHKDSK C: /R

    and press the Enter key.

    We'll tell you that the disc is locked,

    and the CHKDSK runs the next time he started - press Y and restart.

    The CHKDSK command will take a few hours depending on the size of the disk, so be patient!

    Once executed, the command CHKDSK Windows should start normally (possibly after a second auto).

    Then, run the SFC.

    SFC - SFC System - Instructions

    Click Start > all programs > Accessories

    Right-click on the entry of the command line

    Select run as administrator and accept the UAC - elevated command prompt window prompt should appear.

    At the command prompt, type

    SFC/SCANNOW

    and press the Enter key

    Wait for that analysis at the end - make a note of any error messages - and then restart.

    Copy the CBS.log file created on your desktop (you can not manipulate directly) can compress the copy and transfer it to your SkyDrive (http://skydrive.live.com ) and post a link to it so that I can take a look.

    Post a new MGADiag report with details of any error messages encountered.

  • How to block a sender by using e-mail software?

    How to block a sender by using e-mail software?

    You actually use OS Tiger as shown in your profile? You ask about MacBook as shown in your profile or you use a MacBook Pro, which is the subject of this community?

    Here are the instructions on using mail rules in El Capitan Mail (El Capitan): use rules to manage your Inbox. If you are using a different operating system let us know.

  • RunState.Sequence.Main vs RunState.SequenceFile? When you use the deployed software?

    RunState.Sequence.Main vs RunState.SequenceFile?  When you use the deployed software?

    Can someone explain to me why when I use something like->

    RunState.SequenceFile.Data.Seq ["Test Seq"]. Hand ["Test not"]. Result.Status

    the status will never be updated if I am set up for LabVIEW Run - Time Engine (but will work for the development of the system).

    Also why->

    RunState.Sequence.Main ["step Test"]. Result.Status

    Update for LabVIEW Run - Time Engine and development?

    I solved my problem with RunState.Sequence.Main ["step Test"]. Result.Status but I'm still curious why the reverse does not work?  Can someone give me please a validation test?

    Thank you very much!

    RunState.SequenceFile.Data.Seq contains the copy of time change sequences. These copies are not at all when running. At run time, a separate copy is made (and is accessible from RunState.Sequence) and only this copy of runtime is updated. These runtime copies are made for several reasons such as the following:

    (1) to ensure that changes to the sequence the runtime, do not affect the original version of the time edit of the file (you don't want to change the status to be an editing tool in the right sequence file?).

    (2) to support recursion, recursive calls in the same sequence have their own copy of the sequence so that State for a call is not crushed by one recursively calls the same sequence.

    There are probably other reasons as well, but these are probably the biggest.

    -Doug

  • How can I dob in a company using cracked MS software?

    How can I dob in a company using cracked MS software?

    See you soon!

    If you want people to report or company who use Microsoft Software crack, you might start:

    https://www.Microsoft.com/en-us/howtotell/CFR/report.aspx

    http://www.BSA.org/

Maybe you are looking for