Total number of samples per channel

Hello

I was wondering if you can call a function that returns the total number of samples per channel read. I try to get a precise timestamp.

I use DAQmx ANSI C developer environment.

According to NOR:

Option #1:

Try and do exactly what the driver is doing.  This will require you to do exactly what you do in the displayed example.  Call time current system immediately before calling the DAQmx Read and subtract dt * x where x is the number of samples already acquired.  It will take you to know exactly how many samples were acquired.  It can be found by calling the Total property of the samples by chain acquired immediately before the DAQmx Read.  This is to introduce some points for innaccuracy.  For example, you're time system is already innaccurate to a certain amount.  In addition, it takes some time between the system times call, calling the total number of samples acquired and calling the DAQmx reading.  If 2 samples are acquired between the call to the time system and the total number of samples acquired, you could be shifted a few samples.  For the slower clock rates, you will have more precision.

I try to attempet to program this solution, but cannot find the total number of samples per channel acquired property. If anyone can help me, your help will be very appreciated.

Thank you for your help,

Vladimir

Hi Vladimir,.

Here is the property you are looking for (as the C reference help):

You will be able to get accurate relative timestamps, since we know that our acquisition is based on a sample with a certain dt clock.  The value of initial time must still come from the OS.

Best regards

John

Tags: NI Hardware

Similar Questions

  • samples per channel and the number of samples per channel

    in my DAQ mode samples finished program, there are two screws: timing and read.vi DAQmx DAQmx.

    I have to set the parameter to "samples per channel" DAQmx timing.vi and 'number of samples per channel' on DAQmx read.vi... Is there a relationship between these two?

    My laser runs at 1 K Hz. I want to go to the wavelength, wait for a number of shooting lasers, read the data and move on to the next page...

    Thank you

    Lei

    In your case, the VI will acquire the lesser of either:

    The "samples per channel" that you have defined on the timing DAQmx VI

    -OR-

    The number of iterations of your for loop (N) times the 'number of samples per channel"that you have defined on the DAQmx read VI

    The "samples per Channel" VI DAQmx of timing for a finite acquisition dictates how many samples the DAQ hardware should acquire in it's onboard buffer before indicating that the acquisition is complete.  "The number of samples per Channel" on the read DAQmx VI dictates how many samples the DAQmx driver must return buffer on board the aircraft to your application.

    Let's say the "samples per channel" on the calendar DAQmx VI is set to 50.  Thus, the card will acquire 50 samples and place them in the edge of the buffer, then stops.  Suppose we have the 'number of samples per Channel"on the DAQmx reading VI the value 3 and what we call the VI in a loop For which runs 10 times.  Thus, every time the DAQmx lu VI is called, it will wait until there are at least 3 samples in the buffer, and then return these three.  We call the VI a total of 10 times, then we will answer 30 total samples.  Thus, the last 20 samples acquired the card remains in the buffer and are destroyed when the task is disabled.

    Now let's say that we increase the "number of samples per Channel" on our DAQmx Read VI at 10.  VI Read will wait until 10 or more samples are in the buffer, and then return these 10. Thus, we will be back all 50 samples map acquired by the 5th iteration of the loop For.  The 6th time we call him VI DAQmx Read it expires, because there will never be another 10 samples in the buffer, and the VI returns a warning.

    This clarifies things?

    The purpose of this behavior is to allow you to both set the total number of samples that the DAQ hardware will acquire and also control how much of these samples is returned whenever you call the DAQmx Read VI.

    Kind regards

  • How to abort Continuous Acquisition (which is set to acquire a constant number of samples per channel each iteration)?

    Hi all

    I would like to continuously acquire an input channel analog and, if necessary, be able to stop the acquisition as quickly as possible.

    I use a card NI USB-6289. I implemented a DAQmx (voltage) analog input task, set the clock sampling DAQmx 'continuous samples' and the rate required (IE 1000, which is 1 kHz). For the acquisition, I used a while loop with inside the DAQmx Read with Terminal 'number of samples per channel', wired (IE 1000). The while loop waits until 1000 samples are acquired and therefore continuously reads the channel in uniform batches of 1000 samples every second ticking. The while loop can be easily interrupted when the DAQmx has completed the acquisition of the lot being 1000 samples, but it takes the DAQmx finish their current task.

    My problem is how to stop the loop while the DAQmx Read lies in the middle to get 1000 samples WITHOUT delay all 1000 samples are received? Is it possible to interrupt the DAQmx Read?

    I could reduce "the number of samples per second", increasing the responsiveness of the while loop, but this is not the solution I prefer. I tried to destroy the task (outside the while loop), but that does not stop immediately the acquisition, Read DAQmx still finish acquire 1000 samples. I've included an example Subvi. When I was using a PCI card, I used a timed while loop with inside the DAQmx Read with Terminal 'number of samples per channel' wired-1 (= which means ' read everything in the buffer "). In this case, it was easy to stop the acquisition at any time: the timed, while the loop is abandoned and the acquisition has ceased immediately. But it does not work with an NI USB-6289 map (see thread http://forums.ni.com/ni/board/message?board.id=170&message.id=386509&query.id=438879#M386509) because of the different way the data are transferred to the PC.

    Thank you very much for your help!

    Have a great day,

    LucaQ

    Hi LucaQ,

    Your solutions are decrease of the number of samples, or record the time you want to stop and remove samples that have been acquired beyond this time. There is no other way to stop the actual reading out of the hardware store.

    Flash

  • What is the relationship with the sampling frequency and number of samples per channel?

    In my world, if I wanted to taste 10 seconds 10 Hz (100 s/ch), specify a rate of 10 and a number of samples of 100.  This would take 10 seconds to return data.  The task does not appear to behave this way.  No matter what rate and the number of samples, I chose, I spammed with data at 1 Hz or more.

    What I am doing wrong?

    This problem is resolved by making a request for telephone assistance.  It turns out that the minimum sampling frequency of the NI 9239 is 14xx s/s.  I don't know why there is a minimum sampling frequency, but now I have to go to the next question discussed at this link:

    http://forums.NI.com/T5/Multifunction-DAQ/how-can-I-read-gt-10x-samples-at-a-sample-rate-of-X/TD-p/2...

  • sample per channel and read sample

    Hello everyone

    I'm new in LABVIEW and I have some difficulties with something.

    I put t know exactly what is the difference between the sample by channel and the sample to read. According to me, knowing that the sample by channel is the size of the buffer that is larger than the sampling frequency, but I put t know what is the sample to read.

    I ve tested with different sample per channel and read. Sometimes I get an error and sometimes know and I would like to know why. If you have examples because I understand better, it will be great.

    I really need to understand this part of my project

    Thanks for your help

    Tony GIBERT

    Hi Roro,

    As you mentioned, when the size of the buffer absorbing continuous samples, you can specify the sample by placing a value to the entry "samples per channel" on schedule vi. The entry of 'number of samples per channel' on reading vi which automatically names a control / constant with 'samples to read' specifies the number of samples you want to remove from the buffer in an appointment during playback of several samples (N). This link may provide a little more detail. I am also attaching a good example of the finder OR example that you may find useful to explore. I assume you are using the DAQmx driver put then please let me know if this isn't the case, but the same principles should apply in any event.

    This means accordingly for sampling at a given rate, you must make sure you're pulling data in large enough 'chunks' so that the buffer overflows (which may well be the cause of error that you see). On the other hand if your sampling rate is slow and your reading vi is having to wait the number of samples to read you have specified to be available, he can lift a time-out error. You can avoid this by increase your sampling rate, reduce your samples to play or increase the time-out specified read vi entry (-1 means it will wait indefinitely).

    Let me know if this helps and how you will.

    All the best.

  • Is there a way to get the total number of samples to a TDMS file?

    I'm looking at the documentation for the function of properties Get TDMS and I see that it has a property: wf_samples which "represents the number of samples in the first data segment. Is it possible to get the number of samples in, say, the second segment of data? My goal is to get the number of samples in all segments of data for a single channel.

    To retrieve the total number of samples, I use the properties of 'NI_ChannelLength' to be linked to the function of TDMS properties get.

    The I64 outbut gives you the total number of samples of the selected channel.

    See attachment so useful

    Marco

  • I need to improve the performance of a Web site and I want to track the total number of requests per second...

    I need to improve the performance of a Web site and I want to track the total number of requests per second... we are currently hitting...

    Please I need to hit the current with 1200 queries/second application, please help in this regard.

    Hi Nivask,

    If you created the Web site, the question would be better suited in the MSDN Forums. I would recommend posting your query in the MSDN Forums for assistance:

    Internet Explorer Web development

  • How to calculate the rate of data transfer if I know that the total number of samples/s?

    I'm looking to set a PXI system for measurement of County at high speed, routes, while that controlled remotely via MXI - 4.  How can I be sure that the controller is capable of rapid data transfer quite seen the number of channels and frequencies of sampling provided?

    I think I figured this out, but maybe someone can save me.  For the task at hand, I will have a PXI-4496 and four PXI - 6143 s all 32768 samples/s sampling.  4496 is 24-bit, and 6143 is 16-bit.  Thus,.

    bits of samples/s/channel x 24 16 channels x 32768/8 = 1 048 576 bytes / s

    +

    32 x 32768 samples/s/channel x 16 bits/8 channels = 2,097152 bytes/sec

    =

    3 145 728 bytes/s, or exactly 3 MB/s.

  • 6602 synchronized with a different number of pulses per channel pulse generation

    Hello

    I try to use counters NI 6602 to generate 4 pulse trains that begin together but then proceed with each counter producing its own number of pulses (over mode) with its own frequency.

    It seems that each of the 4 channels of wiring at the same special teams each channel to produce the same number of pulses based, apparently, on which channel was recently with the specified NumPulses value so that it is the (implicit) VI DAQMx Timing.

    I tried to use separate tasks for each channel, but it seems that the there is much more uncertainty in the initial start of the train of impulses on each channel: unique task ~ 13us (coherent) delay between channels, a task for each channel (variable)... Although I'm not entirely confident in these temporal measures (estimates of the oscilloscope) +-15us. So it seems I'm sacrificing some synchronization to produce a different number of impulses for each channel?

    Is it true, or is there another way to match the beginning of the independent pulse trains.

    Vadim

    You should be able to synchronize the start of 4 separate meter output tasks by having all the

    looking for a common startup trigger signal.  You can easily do yourself the trigger signal on

    (for example) PFI_0 using a digital task rocking DIO_0.

    -Kevin P

  • How can I limit the total number of hours per day, that my child may be on the computer?

    Summary of the issue
    Other issues of Windows Live family safety

    What version of Windows Live Family Safety do you use?
    Version 2011 (15.4.3538.513)
    Choose your operating system version:
    Windows 7

    Additional details
    How can I limit the total time per day my kind that can be on the computer? I see only menu in which I can determine which hours of the day, they are allowed to access. Concerning the lower self, for example him limit total daily in any hours 1 hour.

    Hello

    The feature of time safely of the family has changed recently. For more information, please see this sticky post:

    How to work the allocation of time and curfew? 

    You can also consult this thread. It has information on how parental control has changed and how to put in place.

    Thank you!

  • Impossible to get a sufficient number of samples per second

    Hi I worked on a big project for a few months now. The program will read 16 analog inputs and 7 digital inputs of a cRIO-9012 one. TPC-2512 touchscreen will serve as an interface with the cRIO. As soon as the program starts, it records 1 taste a second of each input and each in a separate table. When a user specified threshold is crossed by one of the entries, it takes the previous table and adds each a different picture. Now I need to collect at least 100 samples/s but I get only about 30. The program became large enough, and the processor on the touch screen cannot manage to gather all these data that fast. I'm trying to make the program more effective in running things only when they are needed but this is not enough. I was wondering if I took all the separate tables and 1 table 2D did it all would be faster.


  • Sample quantity sample DAQmx channel property Node substitute in LabVIEW when = 1

    [cross posted from LAVA] 

    Problem:
    LabVIEW seems to be the substitution of a value of 1 to a value of 2 for the node property DAQmx Sample Quantity.Sample per channel for a continuous acquisition mode.

    Information:
    I have a task created in MAX (version 4.4.0f1).
    When I updated To Read samples 1 the task runs successfully in MAX.
    When I read the task in LabVIEW (8.5), the property node Sample Quantity.Sample per channel (i.e. the samples to read) is converted to a value of 2.
    If the value is greater or equal to 2 to the MAX, then the Sample Quantity.Sample by channel in LabVIEW property node returns the correct value.

    I get the same problem with a real or simulated device.

    Question:
    Is this desired behavior?

    Side note:
    If N samples (acquisition of buffer finish) is selected samples To Read cannot be 1 because it causes an error 200077 - must greater than or equal to 2.
    But no error will occur when the task is saved as a continuous (continuous buffer acquisition). I don't know if this is related. The error generated is:
    Error-200077 occurred to the DAQ Assistant
    Possible reasons:
    Measurements: Requested value is not supported for this property value.
    Property: SampQuant.SampPerChan
    You asked: 1
    Valid values begin with: 2
    Valid values ending with: 8589934590

    Shouldn't

    Hi JG,.

    Remember that the number of samples (one associated with DAQmx sync settings) is not relevant for continuous acquisition.  To read a sample at the same time, you simply specify this in your DAQmx playback function.  When you configure MAX to read an excerpt, it makes this same functionality automatically.

    You will not be able to get the value of another property node as the value is converted as soon as the channel is created (the value non-sous the constraint is not stored anywhere by the driver).  It should not be a need to this value in your code, if you want to read a sample to a schedule the DAQmx read simple example of function.  The amount of samples by reading is not part of the task itself, but is defined when running as an input to the function read DAQmx.

    You get the error message indicates that your device supports should not single-point HW timed - I would have probably asking which device you were using.

  • NEITHER 9212 - issues with sampling frequency, number of samples and size of buffer or slowness comes together with thermocouple module

    To begin with, I am very new to labview and unfortunately on that my first task is to build something rather complicated for a project that my company works. Fortunately it is especially followed rather than control critical processes.

    Currently, I have a cDAQ with modules, DI, AO, and TC.

    cDAQ-9133

    NEITHER 9472

    NEITHER 9421

    NEITHER 9263

    NEITHER 9205

    NEITHER 9212

    I'm currently running read-write for all 5 of these modules in parallel while loops and analog and digital inputs/outputs modules that all work as expected. Each loop requires 1 sample per channel through the wizard DAQmx etc for each module and I got can interact with all the asyncronosly inputs and outputs which at the moment is the goal. I can switch power switch for each module save memory, or if the need arrives later.

    My problem is that the module TC (NI 9212) when tilt on which allows the acquisition of sample 1 loop seems to take much, much longer to collect samples. I have played with different acquisition parameters and can seem to get a continuous flow of data when you use streaming samples, or even when specifying N-samples but I come in questions where the "application cannot catch up with the hardware.

    I tried to find an optimal number of samples/sampling, rate, etc I can get an update of temperature more than every 1 to 2 seconds, but if I set the number of samples that are high enough to apparently get a constant flow, what ends up happening waveform graphs seem to lag behind the actual data, and that's where I get errors. I only want 1 sample per channel per cycle anyway. Yet once, all the other modules in the cycle with less than 100ms delay between acquisitions but the module thermocouple ends up being 1-2 seconds. It's okay because in our application temperature should not rise/drop very quickly but its boring nonetheless.

    I have the acquisition set up for the same (NI 9212) thermocouple module was like my modules of analog and digital inputs (NI 9205 and NI 9421) take 1 sample every time the task is called so I'm having a hard time understand why do the same for the TC module introduced such a delay. Max sampling rate is supposed to be 95 samples/s/ch, so I guess that the delay must come from call the task over and over again in a loop.

    Synchronization and how you have configured the 9212?

    In the case of high resolution, it can reach 1.8 samples/s. see page 7 of the plug technique here for rates for the supported modes:

    http://www.NI.com/PDF/manuals/374389a.PDF

    -AK2DM

  • How to calculate pay many times a total number of hours

    Hi people,

    I'm using the last update of the numbers.

    I'm trying to find a way to calculate a sum.

    I got the total number of hours per week, but I want the formula to calculate the total number of hours per week by people price / hour?

    How can I do this?

    Any suggestions?

    I recommend having a look at the model of timetable for the employee to File > New.

    SG

  • Sampling 2 channels at a frequency of 400 kHz

    I'm trying to taste 2 channels to 400 Khz using 6251 NI USB DAQ and I want to acquire the data for about 20 minutes, for which I use the continuous sampling mode. But I get buffer on stream errors. To solve this problem, I used the buffer.vi of entry so I can manually declare the size of the buffer, I put samples of 100 M, but I always get an error. If I set the memory size greater than 100 M samples buffer I get another error that says the requested memory cannot be attributed (error-50352 occurred at DAQmx start Task.vi:1).

    My first question is, how is the buffer size allocated, it is in the acquisition of data or the memory of the computer and what is the maximum? My second question is in regards to recording data to a file, no of samples per channel determines how many samples is stored in each file, if not how can I determine this? Finally, what should the value should I use for no.. samples per channel (samples for each file)? I'm new to labview so I would be really grateful of any information or suggestion. I have also attached my vi.

    Thank you

    You may find it useful to update DAQmx 9.0 for this development.  A new feature in DAQmx 9.0 will record all the data to a PDM for you.  Not to mention that the main advantage of the speed, this function will also produce a file of 1/4 size only in writing, given to bracts.  It is really easy to use this feature (compared with other options) and it can save you a lot of time.  If you install DAQmx 9.0, an example can be found in the finder example under input/output hardware > DAQmx > Analog measures > power > TDMS Streaming-... (there are 5 examples here).

Maybe you are looking for

  • application of RAID a6750t

    Hello I get a new a6750t.  I know that there are 6 SATA channels and 2 bays for HARD drives and 2 bays of DVD.  I think the configuration of the system, w / additional spare parts, can you please share your insight on whether it is possible to do?  I

  • Label chart in the report generator axis

    Hello can someone help me with my problem? I need to add labels of the graph axis I've done by the Builder of Labview. Is it possible to do? I thank very you much. Patrik :-)

  • Can I switch from XP 32 bit to 64 bit XP?

    First of all here is my computer: http://tinyurl.com/6sz34dz I was wondering if it is possible to upgrade my current 32-bit to a 64-bit. 'AVG PC tune up,' said my computer was able to be 64-bit, but I don't know how to do. Please keep in mind that I

  • I do not use office, how to avoid updates of this programming?

    The only part of the desktop that I use is, MS Photo Editor, so I can create images in layers, office software is useless for me, and I'd rather not end up having the updates for this program. Is it possible for me to not to receive this type of upda

  • problems with VOIP on WRP400

    Hey all. I bought this router for a friend of mine. mainly for the side of voip as their old one kept freezing. long story short, I was able to get all this work, phone calls and talk to all work except for a small problem, called cutting after about