Error on wait the next sample clock

Hello

I need measure the speed using an encoder for a control application. I installed a sample external clock on CNTR0 (in another vi) and I wired CTR0_OUT to CTR1_GATE. I start the vi, then the measure of the clock vi speed sample and Labview displays the following error. I don't know what is happening, my measure is established for the sample clock and timing type single-point sample clocked by material and the error says that I do not have this? What's funny, is that the same app works if I am using the DAQ Assistant.

Thank you

David

Hey David,

I believe that the document I linked can be a problem, and I'll go ahead and make the necessary changes to be made to this document on my side.

The next issue I can see uses HWTSP on a windows machine. HWTSP is usually reserved for computers running real-time operating systems. These operating systems can ensure deterministic operations. On windows XP, windows may decide to treat another thread / process that can cause you to miss a sample (if you miss a sample that the default behavior is to throw an error).

With HWTSP, you will be difficult to get one without a real-time system faster sampling rate.  Stamped acquisition will also have a large amount of latency for a control application.

Looking at your code, I recommend trying a task of sampling frequency CI On Demand.  Currently, your code is the edges and conversion of frequency/RPM.  In addition, because of the lag phase with your sample clock, your current configuration has an error of ±1 count.  This translates to error ±1KHz (on behalf of 9 to 1 ms it would be 9 kHz, 10 would be 10 kHz, etc.).  Based on mathematics in your example, you introduce ±120 rpm of error.  By a frequency on the task on demand, you can ensure that whenever you call the DAQmx Read, you get the last frequency within a tick of time base error ±1.  Not only it gives a better accuracy, but as long as you keep the rate of fast loop, you will ensure you get the last frequency to the fastest rate possible.

Ensure that your loop rate remains fast is to remove the loop of your acquisition processing and placing him in a parallel while loop.  This is possible through the use of reporters.  Local loop in Windows rates are usually in milliseconds.  To get faster line rates, you might want to consider a real time operating system.

Please let me know what you think of this, and if you have any other questions, I can go into this more in detail.

Tags: NI Hardware

Similar Questions

  • DaqMX wait the next sample causing slow down Clock.vi

    Hello

    I have a question about the proper use of DaqMX wait for next sample clock.

    I read channels analog voltage on a map or pcie-6259.

    I would like to read as soon as possible make your comments between each of these points of single data points.

    I wish I had an error generated if I miss a data point.

    From reading the forums, I've gathered that the best way to do it is using the Timed Single Point material.

    A simplified program that I use to test this is attached.

    If I remove the DaqMX wait for next sample Clock.vi, my program seems to work.

    I added a counter to check the total time is as expected.

    For example, the program seems to work at the speed appropriate for 120.

    However, without that vi, it seems that the program does not generate a warning if I missed a sample.

    So I thought that the next sample clock waiting vi could be used to determine if a single data point has been missed using the output "is late."

    However, when I add inside as shown in the joint, the program seems to slow down considerably.

    At high rates as 120000, I get the error:-209802

    14kHz is the approximate maximum rate before you start to make mistakes.

    My question is: is this the right way to check a missed sample? I don't understand why the wait next sample Clock.vi is originally a slow down. Without this vi, the program does just what I want except that I do not have strict error control.

    My confusion may be based on a lack of understanding of real-time systems. I don't think I do 'real time' as I run on an ordinary pc, so maybe I use some features that I wouldn't.

    Thank you

    Mike

    Mike,

    You should be able to read to return delays errors and warnings by setting the DAQmx real-time-> ReportMissedSamp property.  I think that if you enable this, you will see errors or warnings (according to the DAQmx real-time-> ConvertLateErrorsToWarnings) in the case where you use read-only.  I'm a little surprised that you have measured your application works at 120 kHz without waiting for next sample clock (WFNSC), although I'm not surprised that it would be significantly faster.  I think if you call read-only, you'll read the last sample available regardless of whether you would of missed samples or not.  When you call WFNSC, DAQmx will always wait for the next, if you are late or not sample clock.  In this case, you will wait an additional sample clock that is not the case in read-only.  Once again, I expect that, in both cases, your loop would not go to 120 kHz.

    Features real-time DAQmx (hardware Timed Single Point - HWTSP) are a set of features that are optimized for a one-time operation, but also a mechanism to provide feedback as to if a request is following the acquisition.  There is nothing inherently wrong with using this feature on a non real-time OS.  However, planner of a non real-time OS is not going to be deterministic.  This means that your app 'real time' may be interrupted for a period not confined while the BONE died in the service of other applications or everything he needs to do.  DAQmx will always tell you if your application is to follow, but can do nothing to guarantee that this will happen.  Thus, your request * must * tolerant bet of this type of interruption.

    There are a few things to consider.  If it is important that you perform the action at a given rate, then you should consider using a real-time operating system, or even with an FPGA based approach.  If it is not essential to your system, you might consider using is HWTSP, where you do not declare lack samples (DAQmx simply give you the most recent example), or you could avoid HW timing all together and just use HAVE request to acquire a sample at a time.  What is appropriate depends on the requirements of your application.

    Hope that helps,

    Dan

  • Measurement error of the County of edge by using the external sample clock

    Hello

    I'm trying to measure the number of edges (rising) on a square wave at 5 kHz with a generator function on a device of the NI PCIe-6363. I configured a channel of County of front edge of counter at the entrance of the PFI8 device. I use an external sample clock that is provided by the output of the meter of a NI USB-6211 housing channel. If I acquire for 10secs then ideally I would expect to see a total of 50000 edges measured on the meter inlet channel. However, my reading is anywhere between 49900 and 50000.

    When I use the internal clock of time base to measure the edges, the measure is accurate and almost always exactly 50000. I understand that when you use the external sample clock, the precision of the measurements is subject to noise level of the clock signal. However, I checked the clock signal is stable and not very noisy. Any reason why there is an error of measurement and how tolerance should I expect when using an external sample clock compared to when you use the internal time base clock?

    Also, what is best clock Frequency (with respect to the frequency of the input signal) when using an external clock?

    Thank you

    Noblet

    Hi all

    Thanks for all your sugggestions. I was using an input signal with a function generator which had a range of 8V. It turns out that the reduction of the amplitude to 5V solves the problem. I was able to get accurate numbers with the 6211 external clock.

    Thank you

    Noblet

  • Synchronization of analog and digital output with the external sample clock

    Hello

    First of all sorry for my English, I will try to explain what I want to do.

    I want my PCIe-6321 to send two custom signals (modification sawtooths) on a mirror controller. I would also like to generate output with my card at the beginning of each tooth of saw. Everything must be synchronized with an external k-clock signal of 100 kHz. The idea is that whenever the PCI receives a trigger to external clock, it sends two analog output voltages and when he received 1024 clock ticks it will also send a pic of triggering TTL. What I do is first prepare the map and after that in a loop sending and modifing the output values of the two signals and at the same time send a digital signal Boolean in each arch, so when's done it 1024 iterations of the loop I send an event to the digital port. Attached you can see.

    The problem is that I don't know how to synchronize both. Can I use the sample clock just to the analog output? I can use sample for the two outputs clock, or do I need to use the output of the meter? If don't know how to use it here.

    If I do nothing else bad/wrong, I would be grateful for feedback.

    Thanks in advance,
    Pablo

    I don't know how but I find the solution. I'm generating more than a positive value (as I was triggered maybe very fast the oscilloscope has been absent there). If I put the sample clock of digital output to use the sampling/ao/Dev1 clock that it doesn't, but if I put to use the same source as the OD (terminal where my external clock is connected), but the trigger to start the DO to be Dev1/ao/StartTrigger this works. I don't really know why, but it does.

    Thank you for your patience and your help. I put here the final code.

  • divide the internal sample clock (VCXO)

    Hi all

    I want to divide clock source internal sample of my high-speed 5122 digitizer PXI card.

    5122 PXI, 200 MHz internal clcok source example. I want to taste my data at 10 MHz.

    So I want to divide down the clock of internal sampling by a factor of 20.

    I want to do it programmatically.

    I have found no vi node or property for that (although found the node property for entry divider OR worn... but which has been used only for reference for on-board clock clock)

    Help me as soon as possible...

    Hi Jirav,

    I just wanted to clear some things. The 5122 has a sampling rate 100 MECH's maximum real-time. / s (not 200 MHz as you originally suggested). To obtain a rate of 10 MHz, you would be divided down by a factor of 10. From page 13 of the document specifications NI 5122:

    Just to add to what Henrik suggested, the following help topic describes the specific VI to configure horizontal properties such as the sampling frequency, he mentioned:

    http://zone.NI.com/reference/en-XX/help/370592P-01/scopeviref/niscope_configure_horizontal_timing/

    Most of the expedition OR SCOPE examples use the VI above and there is an entry for "min sampling rate" where you can simply specify the value "10 M" or '10000000' to get the device of sampling at a lower rate.

    Note: because the digitizer allows only sampling frequencies which are an integer divide down the maximum sampling frequency, rate will always be forced to match up to the second tier legal sample. For example, if you specify '9.8435 M', it would automatically force the rate up to 10 MHz. To display the actual value that the scanner is used, you can query the property node "Actual sampling frequency" at any point in your code after the configurations have been committed digitizer. The help manual describes this property on the following page:

    http://zone.NI.com/reference/en-XX/help/370592N-01/scopepropref/pniscope_actualsamplerate/

    Kind regards

  • Looking for USB DAQ for AO using the external sample clock

    Hi all

    I'm looking for a cheap solution for the acquisition of data to select the AO using an external digital signal as sample clock, and I just realized that the USB-6001 is not a good candidate. Please someone remind the cheapest USB version for this task? There no need for high sampling rate. Thank you.

    Define cheap and low sampling rate. You've already been told on the 6211.

  • I get this error message. The next (s) start or start failed to load system: aswSnx.

    Microsoft no longer offers free assistance to XP Pro. I have a reinstallation CD.  Could someone please me directly how to use; fix it witoout loseing all my files?

    Thanks in advance

    You do not specify whether or not this error is preventing your computer from starting.

    If it does not start, try to start in "Safe Mode" by repeatedly pressing the F8 key as your computer starts.

    From what I can tell, 'aswSnx' is a file associated with the program "Avast!" You can try to uninstall Avast! of your system and later re-install.  I found a few articles that explain how to uninstall Mode applications without failure (if that's the only way to boot your system):

    <>http://www.gHacks.NET/2010/07/18/how-to-uninstall-software-in-Windows-safe-mode/ >
      <>http://www.windowsnetworking.com/kbase/WindowsTips/WindowsXP/AdminTips/miscellaneous/UninstallapplicationsinSafeMode.html >

    You can also try to use "msconfig" to turn off Avast! on reboot

    "Hot to troubleshoot configuration errors by using the System Configuration utility in Windows XP"
      <>http://support.Microsoft.com/kb/310560 >

    Another suggestion is to post in the Avast"forum
      <>http://Forum.avast.com/ >

    HTH,
    JW

  • I want to re - sample a signal and for the interpolation values remain the same until the next sample...

    See this image for clarification of what I mean:

    http://www.Google.com/imgres?q=sample+and+hold&hl=en&BIW=1680&BiH=867&TBM=isch&tbnid=Gj4_SyS84aLhaM:...

    You can also check this example https://decibel.ni.com/content/docs/DOC-10182 and http://zone.ni.com/devzone/cda/epd/p/id/5874

  • PCIe-6537 County in ANSI C sample clock

    I want to get the precise times of the edges on 32 digital lines using a card PCIe-6537. The card should have a sample of 50 MHz clock (minimum and 200 MHz/N N is 4). So if I can get a count of the sample clock when the any lines going from low to high, I know the time at a resolution of 20ns. Each line should have a transition from bass up per second. They should all be synchronized, it is possible that more than one line will have an advantage in the same sample clock signal.

    I'm programming in Visual C++ with the DAQmx ANSI C API.

    What I've tried so far, I think I need to put in place two DAQmx tasks: one to count the sample clock and one to detect transitions on the i/o 32 lines. The next problem after that is the task of transition to trigger a capture of a county on the first task.

    But I can't even set up a counter stain. I think I need to call DAQmxCreateCICountEdgesChan() to create a channel for the sample clock. The example code I found (Mult_Counters_Count_Dig_Start_Trig_TIO.c) sets the name of the channel to counter with a constant:

    #define COUNTER_SOURCE1 "Dev2/ctr0.

    My camera is 'Dev1 '. If I try to use ' Dev1/ctr0', I get:

    Measurements: Physical channel specified does not exist on this machine.

    Refer to the documentation for the channels available on this device.
    Device: Dev1
    Name of the physical channel: ctr0

    Task name: Dev1CtrTask

    Status code :-200170

    I tried to call DAQmxGetDevCIPhysicalChans() to get the name of the channel, and I return an empty string. So I tried ' Dev1 / ' and got a similar error, unless of course

    The physical channel name: empty string

    Is it possible to count the sample with the 6537 clock? Or is there a better way to get the values of accurate time for transitions on the i/o lines?

    Frank

    As for performance, I can personally attest that I have listened 12 SMU-6537 at the maximum rate (50 MHz) with 32 lines on the disc.  It seems there a configuration delivers in this case

    OK, well, I don't have not sorted. She is still ongoing at only 40 MHz. But we decided to resolution 25ns is close enough for now (ran out of time for development ). It's another problem of implementation of the task, so I asked a question separate from the maximum of PCIe 6537 ANSI C sample clock

    Since then, with the help of the forum I got my running program, I would like to summarize the thread and the solution to my problem, in case anyone else is the rising later.

    • The problem is exactly the timestamp rising edges on a set of 32 digital inputs. I expect only a couple of edges per second per channel, but I need to know when they occur (in fact the interval between the edges on different lines) as accurately as possible.
    • I thought that the card could detect changes on inputs and pass a count of the sample clock pulses during an edge has occurred.
    • The 6537 has no channel counter, so it will not be a feasible way
    • Definition of the card to read all 32 lines on the forehead amount of sample clock allows me to write a reminder that allows you to see the status of each line on each sample clock. Because I know that the period of the sample clock, I know that the time of each sample. The reminder I have used a few loops on the pad looking for changes.
    • Surprisingly, this set only 30% a single processor and 40% on the other CPU on a 2-core 2.2 GHz PC. Well, that surprised me. I don't think that the PC could handle shoveling bits that fast autour. SCP got fast enough since the last time I built a. Sample clock was 40 MHz.
    • The callback uses DAQmxReadRaw (taskHandle, DAQmx_Val_Auto, 0, SampleArray, SampleArraySize, unread, & numBytesPerSamp, NULL). The documentation for it says unread will be set to the number of bytes read; It should indicate the number of samples. And I should have used DAQmxReadDigitalU32() instead in any case.

    Thanks to all those who helped with my lights

    Frank

  • Requested sample clock source is invalid wls-9163

    My goal is to use two accelerometers that using the NI 9234 entry of the modules and wireless wls-9163 chassis.

    My program is attached. Here is a photo in case you do not want to download the attachment: http://www.imagebam.com/image/577a4a195651371.

    The slave device is not able to use the sample clock that came out of the master on PFI1.
    I looked through the wireless DAQ resource kit and watched the following video:

    http://www.YouTube.com/watch?v=g_8jiKuKeDI

    and ive read this: http://zone.ni.com/devzone/cda/epd/p/id/6124

    I am aware that

    I also tried to synchronize two cDAQ-9178 using the same methods. I always get the error "required sample clock source is not valid.

    The manual says it should be able to do this

    http://www.NI.com/PDF/manuals/372488c.PDF

    Any help would be greatly appreciated.

    Vexis,

    Unfortunately, at the moment, you cannot synchronize the modules that use adelta-sigma converter (such as the NI 9234) in several cDAQ chassis. This is because these modules use a clock of sampling, which is very high; the PFI lines are unable to return to the required sample clock. You can share the start triggers, but the clocks of individual modules will drift over time.

    The reason that the error message says that "requested the sample clock source is not valid" is because these modules require the use of a sample of clock that comes inside a time base clock oversampling.

    Sorry for the bad news!

    Katie

  • The cancellation of the 'file' dialog box and handle errors caused by the empty path that makes the DB connection

    Hi guys.

    I developed a VI that connects to the database reads the names of tables, columns of the selected table, etc. It works well as I want to.

    However, I have problem with identifying the UDL file with function of dialog 'file' use in a structure of the event that is triggered when the button 'Open' value is changed. It also works well, when I choose the UDL file, but the problem is when I cancel it and I get the error 43.

    I tried to deal with this problem with a "error handler" function to clear the error 43 but the next errors that are associated with the database conncetion appeared. The reason is, when file dialog is cancelled, an empty path passes by reference of connection and I can't start the while loop where are the key codes. I also used a box Structure connected to "Cancelled" with 'DB connection tool' in case of real and connection the reference connection for the while loop, but I get the same result.

    I want to apply for work as: start to push the button "Open" and select the file UDL, the loop run to establish the connections database, if not with the cancellation of the file dialog box, the application waits by pushing the button open and select the UDL file again.

    Thanks a lot for your help in advance.

    Hi lman,.

    start to push the button "Open" and select the file UDL, the loop run to establish the connections database, if not with the cancellation of the file dialog box, the application waits by pushing the button open and select the UDL file again.

    Some pseudocode, easy to implement:

    WHILE
    
      onevent(OPEN button)
        FileDialog
    
      IF file selected THEN
        open database
        do calculations
      ELSE
        do nothing
      ENDIF
    
    WEND
    

    What is your problem with the help of loops and structures of the case?

  • An external sample clock between sharing arrangements

    I need to acquire samples of 2 separated Renault M series (PCI-6254).  My master device receives a sample of 8 on PFI0 KHz clock.  Is it possible at the root of this clock of the master to the slave via a RTSI cable device?

    I looked through the forum and the sample programs, but have only seen examples in which the master clock on board the aircraft happened to the slave.

    It is possibe to synchornize device slave the master clock to external sampling of the device?

    Thank you

    ANT1

    ANT1,

    Fortunately, most of the time something that can be done in DAQmx in LabVIEW can be done in ANSI C using the appropriate function calls.  I have listed the following steps of the program example LabVIEW and retouched to remove anything that it is not suitable for the DAQmx configuration.  I'm sure it should work for you.

    Steps to follow:
    1 create a channel of analog input voltage for the master and the slave.
    2 set the synchronization parameters.  For the master, select the source of the external sample clock.  Set the source AI/SampleClock of the master for the slave device.   (Note: sample of the master clock is automatically routed through the cable RTSI.)
    3. for the slave, set the Source of the trigger to the AI/StartTrigger of the master device.  This will ensure that both devices start sampling at the same time.  (Note: the trigger is automatically redirected via the RTSI cable.)
    4. call the start task to start the acquisition.  (Note: start slave task before the master task.)
    6. read all waveform data.
    7. call the clear task to stop the acquisition and clear the task.

    So, essentially, the value of the task of the slave to the top in the same way as you would for the synchronization of clocks on board, but configure the task to master as you would for an external clock.  This will automatically share the external clock and trigger on the line of the RTSI.

  • Maximum sample clock of PCIe 6537 ANSI C

    I'm programming a card PCIe-6537 with ANSI C. The application uses sampling continuously, with a reminder to analyze the samples.

    The maximum sampling frequency should be 50 000 000 samples/s. The internal sample clock is assumed to be 200 MHz/N where N > = 4.

    I can run to 40.000.000 samples/s (N = 5), but if I put the sample clock to 50,000,000 samples/s (N = 4), the callback is never called.

    I created the task with the following calls.

    DAQmxCreateTask (TaskName.c_str (), & m_TaskHandle);

    I calculate $thisline = ' Dev1/portX/BEHLULI for X = Y = 0.7 and 0.3 and I call for each

    DAQmxCreateDIChan (m_TaskHandle, ThisLine.c_str (), "", DAQmx_Val_ChanPerLine);

    Then I put in place of the sample clock.  It works:

    DAQmxCfgSampClkTiming (m_TaskHandle, NULL,
    40000000, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 16000000
    );

    It's not:

    DAQmxCfgSampClkTiming (m_TaskHandle, NULL,
    50000000, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 16000000
    );

    I save the callback so:

    () DAQmxRegisterEveryNSamplesEvent
    m_TaskHandle,
    DAQmx_Val_Acquired_Into_Buffer,
    4000000,
    0,
    NI6537_EveryNSamplesCallback,
    This
    ) ;

    The callback increments an integer that came out when I end the program by pressing ESC.

    Y at - there a trick to getting the sample clock to work at the rate increase? Or it is limited by the PC somehow, so that the callback just won't happen to 50Ms/s?

    Frank

    Frank,

    You can check and make sure that the BIOS of your PC has been updated to the latest revision.  This can have an effect on the maximum transfer speed on PCI Express.

    There are some cases (depending on the maximum packet size allowed by the chipset of your computer) where a PCIe-6537 cannot acquire 32 channels of data at 50 MHz.  It's strictly a limitation of the PC.  If your BIOS is up to date and it still does not work, you can try your code with the PCIe-6537 on a newer computer?

    Keith Shapiro

    National Instruments R & D

  • Validation of a field has content before allowing the user to move to the next field

    I posted the discussion for the completion of the validation before printing and that I thought more last night, I need to change because I need to allow for our stores print the blanks of the form in certain situations.

    Before continuing the validation before printing, I tried to display an error message if a required field is empty before you move to the next field.  I tried the following scripts:

    #1

    {if (!) Event.Target.valueAsString)}

    app.alert ("this field must be complete. (Please enter the name of the customer', 3);

    }

    This script worked as I used it with "The blur", but after displaying the error message, it went to the next field.  You try to save the field name, threw up the error message for the next field (I have several fields in a line that are needed).

    #2

    f = getField (Event.Target.Name)

    if(f.Value.Length==0)

    {

    f.setFocus)

    app.alert ("this field must be complete. Please enter the name of the customer')

    }

    I used this with "On Blur" too, but I was getting into a loop in which the error message go away, and I have to kill the application.

    #3

    if(Event.Value.Length<2)
    {
    Example of Message

    App.Alert ("this field must contain 9 digits.")
    Event.RC = false;
    }

    I tried this script with the validation feature.  It will not work with any value lower than 2.

    As I mentioned previously, I'm new to scripting, so any help would be greatly appreciated.

    Do you mean that you want to run if the user in a field empty then tablets out of it?

    For this, you can use something like this that the OnBlur event (of course, set the name of the field according to your):

    If ((this.getField("customerName").) Value == "")
    {
    App.Alert ("this field must be complete. Please enter the name of the customer');
    this.getField("CustomerName").setFocus ();
    }

  • I can implement using the NOR-6221 SPI? When I try to generate using ctr0 make an error indicating 'Sample clock' is not a supported option.

    I'm trying to use a NOR-USB-6221 to implement SPI in a C++ application.  When I try to configure a digital output task that uses ctr0 as the clock, I get an error stating that 'Sample clock' is not supported and use instead "on demand".  I would be able to use the NOR-6221 and if so how to do this?  Thank you.

    Hi IntAndTest,

    Maybe silly question: are you sure that you have a USB-6221 and not a USB-6212? The USB-6221 supports clocked DIO, but the USB-6212 is not working.

    A problem with your code: when you specify a terminal DAQmx name, it must be is compared to the device (such as 'Ctr0InternalOutput', "AI/SampleClock" or "PFI0") or contains a slash before the device name (like "/ Dev1/Ctr0InternalOutput", "/ Dev1/AI/SampleClock ', or ' Dev1 / / PFI0"). This does not apply to the names of physical channel (like ' Dev1/port0' or "Dev1/ctr0").

    The error is returned from code that you have not displayed? Your says error message DAQmxCreateDIChan failed, but the code you posted does not call this function. In addition, I don't see a call to DAQmxStartTask or DAQmxWriteDigitalU8, U16, U32, whatever.

    Also, what NOR-DAQmx version are you using?

    Brad

Maybe you are looking for