Sample per channel and sample to read

Hello everybody
I am new in LABVIEW and I have some difficulties with something.
I don t know exactly what is the difference between the sample per channel et the sample to read. I believe knowing that the sample per channel is the size of the buffer which is more big than the sample rate but I don t know what is the sample to read.
I ve tested with different sample per channel and sample to read. Sometimes I have an error and sometimes know and I would like to know why. If you have any example for I understand better, it will be great.
I really need to understand this part for my project
Thank for your help
Romaric GIBERT
Solved!
Go to Solution.

Hi Roro,
As you mentioned, when acquiring continuous samples you can specify the sample buffer size by placing a value at the input "samples per channel" on the timing vi. The "number of samples per channel" input on the read vi which automatically names a control/constant with "samples to read" specifies the number of samples you wish to pull out of the buffer in one go when reading multiple (N) samples. This link may provide a bit more clarification. I have also attached a good example from the NI example finder which you may find useful to explore. I'm assuming you are using the DAQmx driver set so please let me know if this is not the case, but the same principles should apply either way.  
This therefore means when sampling at a given rate, you need to ensure you are pulling data out in big enough 'chunks' to prevent the buffer from overflowing (which may well be causing the error you are seeing). Conversely if your sampling rate is slow and your read vi is having to wait for the number of samples to read you specified to be available, it may throw a timeout error. You can avoid this by either increasing your sampling rate, reducing your samples to read or increasing the timeout specified at the read vi input (-1 means it will wait indefinitely).
Let me know if this helps and how you get on.
All the best.
Paul
http://www.paulharris.engineering
Attachments:
Cont Acq&Graph Voltage-Int Clk.vi ‏27 KB

Similar Messages

  • How to use ni-6008 and build a four channel data acquisition at a rate of 250 samples per channel and display all the data in a waveform chart

    how to use ni-6008 and build a four channel data acquisition at a rate of 250 samples per channel and display all the data in a waveform chart 

    Hi kdm,
    please stick in one thread for the same topic!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Multiple channels acquisition and Number of samples per channel

    Hi,
    I'm a new labview user and I need some help in trasposing an old traditional NI-DAQ acquisition software in a NI-DAQ-mx one.
    I followed the tutorial (#4342) but I found a problem with Analogue 2D DBL Multiple Channels Multiple Samples DAQmx Read Vi.
    I'm trying to acquire 8 voltage signals from a NI-USB-6341 device. When the Number Of Samples Per Channel I set is below the number of channels (8), the software acquires only a number of channels equal to the number of samples per channel I set.
    Is that a normal behaviour?
    Thank you
    Daniele

    This is my code. The problem is the same with or without the code for the scan backlog indexing.
    Tomorrow I will try with the code from the example.
    Thank you
    Daniele
    Attachments:
    acq code.jpg ‏119 KB

  • Buffer size and samples per channel

    I have a question regarding the allocation of the output buffer. I have
    a digital I/O card PCI-6534 and I use the driver NI-DAQmx 7.4.0f0. I
    would like to generate a digital output using different clock rates.
    For example, I need to write 500 samples at 1000 samples per second and
    other 500 samples at a rate of 10000 samples per second. the simplest
    solution is to prepare two different waveforms, write the first one on
    the buffer and generate the output. Then I can load the second waveform
    on the buffer and generate the second output. In order to minimize the
    delay between the two output sequences, I would like instead to write
    the buffer once. I tried to set the buffer size to 1000, and the number
    of samples per second to 500, but it doesn't work. There is a way to
    set independently the buffer dimension and the number of samples which
    have to be generated?

    I can post the whole thing but I'll talk a little about it. It's a producer consumer loop with a continuous analog input sample from external clock program in the producer loop. Right now the consumer loop has a simple write to spreadsheet VI in it but eventually I want to average each revolution (well, two since it's a four stroke but that's neither here nor there) of pressure traces and spit out a single curve.
    The wiring is simple. I have a voltage supply feeding the encoder and the quadrature A input on PFI 8 of the 6212 DAQ. I also have the Z index plugged in but nothing else to it. The analog input is a BNC right to AI 0. I can make a diagram if you want one. I've scoped the rotary encoder output and it looks great, very square with small relative rise times.
    Attachments:
    Yanmar Program V2.vi ‏46 KB

  • Sample clock vs sample per channel per second

    Referring to this link http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/dbe7ac32661bcf9b86256ac000682154?OpenDocument
    What's the difference between sample clock and sample per channel per second? Looks the same to me.

    The sample clock is the clock that sets the timebase for channel operations on the board.  The samples per channel per second is the actual rate at which data can be transferred on a particular channel.
    Alex A.
    Applications Engineer

  • Samples Per Channel Matter when Taking Continous Samples?

    So noob question of the day. I have been playing around with the lightbulb feature. Anyways, I notice my array size is greater than my samples per channel input. Does the DAQmx sample clock even look at the samples per channel input when set to continous?

    Did you check the help file for the DAQmx sample clock function?
    "samples per channel specifies the number of samples to acquire or generate for each channel in the task if sample mode is Finite Samples. If sample mode is Continuous Samples, NI-DAQmx uses this value to determine the buffer size."

  • How to Extract the Freq List, Cycles per Freq and Samples per Cycles of sweep waveform

    How to Extract the Freq List, Cycles per Freq and Samples per Cycles of sweep waveform
    I want to extract the freqency distribution, cycles per freqency, and samples per cylce of swept waveform, in order to output the same of swept waveform with I have acquired by NI DAQ card, tks!
    owen wan
    Attachments:
    Untitled 1.vi ‏2333 KB

    Look inside the palette called Signal Processing - Waveform measurements.  There are a lot of functions here that you can use to get the information you desire.  For instance, the Extract Tones function will output an array of clusters, with each cluster element giving the frequency, amplitude, and phase of the signal component.  Go through the entire arry to see each frequency component of the complex waveform.
    Also, in the Waveforms palette there is the Get Waveform Components function that will give you t0, dt, and Y components of the waveform.  1/dt should give you the sample rate.  See attached VI.
    - tbob
    Inventor of the WORM Global
    Attachments:
    WfmInfo.vi ‏4658 KB

  • Fehler nach "Samples per Channel"

    Hallo,
    Ich verwende das cRIO System NI 9074 mit AD-Wandlermodul NI9239. Hier sollen Daten kontinuierlich gewandelt und anschließend gespeichert werden. Allerdings gehen hierbei immer nach einer Sampleanzahl von „Samples pro Channel“ Daten verloren. Dies wird auch im in LabVIEW angezeigten Graphen sichtbar. Bei einem Sinussignal am Eingang ist dann ein Sprung erkennbar.
    Der Speicher des FIFOs ist großgenug, zumindest wird mit kein Überlauf angezeigt. Kann mir irgendjemand weiterhelfen? 
    jukr
    P.S. Ich verwende LabVIEW 2010
    Attachments:
    FPGA.vi ‏77 KB
    PC.vi ‏365 KB

    Hi Jukr,
    it is useful to write forum posts in english; you will get many more replies :-)
    I don't expect the error to be caused by the measurement. Maybe there are some parts in the network streaming that are not stable enough?
    Just have a look at the following example and compare it to your network connections. You might find it useful!
    Reference Example for Streaming Data from FPGA to cRIO to Windows
    If the example won't help you finding the error, please attach your project.
    Have a nice day,
    Stefan Egeler
    NI Germany

  • 1channel 1 sample & 1 channel multi samples?

    Hi all
    Here I have a problem, hope get your help.
    In my task, there are two signals to be acquired, one is  analog voltage signal, the other is a counter for encoder pusles. My task is gathering the two signals together. When I set the DAQmx analog to 1chan 1samp, the output  may be just 1000 samples, then there is no output anymore, so I change DAQmx 1chan Nsamp, but no output comes out anymore.
     What is wrong?

    Thanks for your reply
    Here is my diagram. I didn't count whether it is 1000 samples, but according to its executing time, I guess it should be.
    Attachments:
    nsamples.doc ‏636 KB

  • Set variable samples per chanel from counter

    Hi, all. I have to set variable samples per chanel for sample clock. I want to take that samples from counter input with different number of edges for every second (different speed of metal plate). What can i do for that task? Is there a god example for this problem?
    Thanks.

    Hi, GerdW. Thanks for reply. I want Sample Rate and Samples per Chanel to come from couter. CI is a metal plate with 52 tooth. The speed of metal plate is 500 cycles/min but it is not constant ( may be 490-520). For example rate of cycles is 500/60=8.33 cycles/sec. Rate of edges (tooth) is 8.33*52=433 edges/sec, but when speed goes over or under 500 the rate is different. How to put that variable samples in sample clock on AI?
    P.S. Matlab script is to calculate max samples per chanel for mean function in while loop. In the picture control "Speed cycles/min" is that 500 cycles/min speed. I have to put in that control the variable rate of edges. Other solution is to set 1 sample per edge, but i have problem here to .  

  • Make Draw Procedure and Sampling Procedure Quantities Match?

    I need to set up an inspection plan where one item is taken from each container and combined into 1 pooled sample. The items in the containers are in eaches and the number may vary from container to container. Think 5 buckets filled with pebbles. I want to end up with a pooled sample that is a total quantity of 5, total containers to sample is 5 and sample size per container is 1.
    On my inspection plan, my Sampling Procedure is set for a fixed sample size of 1.
    The number of buckets may vary from shipment to shipment, so my Draw Procedure is set to have the number of primary samples be P2. However, when I set the number of pooled samples to 1, I end up with sampling instructions that say to take 0.2 pebbles from each of 5 buckets.
    I can set up the Draw Procedure to only have Primary Samples and my sampling instructions will show 5 primary samples but it will not indicate that they should be taken 1 per container.
    Setting my fixed sample size to 5 solves this particular problem but as my material may arrive in 6 containers next time, it is not a long term solution.
    It seems to me that I need to be able to set my sample size to also vary based on the number of containers. I can't do that using a pebble to bucket conversion, as this is not a constant number. Ideally I would like a Sampling Procedure with a sample size of P2.
    Is there a way to create a Sampling Procedure that varies based on the number of containers received? Or is there another option?
    Thanks,
    Deb

    You can achieve this by using Sampling Determination "300-Sample schema" If require modify Function Module "QDRS_SAMPLING_PLAN_SAMPLE"
    Thanx!!

  • Sampling waveform values and writing corresponding time values

    I am sampling the frequency of a generator set using a 1126 module. The frequency values I am getting are approximately 60 Hz.
    I am sampling at 150 samples per second and using the Index Waveform Array function to peel off the frequency waveform. Then I am running that waveform wire (brown) through a Get Waveform components function to seperate the t0, dt, and y components. I am taking the oranage wire from the Y portion to write those values to a spreadsheet file. Then I want to build an array of the frequency values and the time values and write that to file (transposing the array if need be).
    I want one column to be the frequency values and the second column to be the correspond
    ing time values for each of those data points. For example, starting at t=0:
    Frequency (Hz) Time (s)
    60.0 0
    60.1 0.0066666
    59.9 0.0133333
    60.2 0.0200000
    60.1 0.0266666
    |
    |
    | end of first second
    |
    V
    60.5 0.9866666
    60.1 0.9933333
    60.0 1.0000000
    59.7 1.0066666
    The time interval increments by 1/150 of a second each time a sample is taken (150 times per second).
    I tried to use the Get Waveform Time Array function, but that returned a 10 digit number that did not appear to be related to the time in seconds.
    Can someone please advise me on how I can get the corresponding time values in seconds for waveform data points in the situation described above? Thanks!

    Since you are aquiring at a constant sample time, you could try using the ramp pattern to generate the time column.
    I attach a sample VI in which I generate the ramp starting from waveform characteristics and then create the 2d array to save to disk with Write to Spreadsheet File.vi.
    Hope this helps
    Roberto
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?
    Attachments:
    waveform_to_spreadsheet.vi ‏20 KB

  • How can I tell if a tiff was saved with "interleaved" or "per channel" for pixel order?

    My PLATFORM:Macintosh
    SCRIPTING LANGUAGE:I only know Applescript
    Photoshop version: CS5
    I need to look at a large amount of tiffs and determine if any of them were saved with the option in the second dialog box that comes up where it asks if you want to save the pixel order as interleaved or by channel.
    I need all of them to be interleaved and some are not.
    I would rather not open every image and resave. If I could run a script that would identify the culprits by changing their label to red for instance then I could deal with just those files.
    If there was a way I could look at them without opening in photoshop that would be better but even opening in photoshop I get  I don't seem to see the pixel order info anywhere.
    My PLATFORM is
    Macintosh
    SCRIPTING LANGUAGE
    I only know Applescript
    Photoshop version CS5

    This exiftool command line
    exiftool -p '$filename $planarconfiguration' -f -q *.tif
    will print out the name of the file plus 'Planar' for per channel and 'Chunky' for interleaved.

  • Common distribution channel and devision

    hi  expert
    i have one sales organization-0001 three Distribution channel- 01,common distribution channel,02-distribution channel,03-distribution channel and 4 divisions. Hz-common divisions.,Oz,AZ,CZ. so my clients requirement is he wants to create customer master and material master record will be created sales organization 0001. distribution channel --01,02,03 and common division 00 and material master should be sales organization 0001, distribution channel  00 ( common distribution channel) and  all division and sales order should be sales organization 0001 and all distribution channel and all division. plz giv me the solution as soon as possible.
    Edited by: rajeshm on Mar 30, 2010 11:44 AM

    hi thanks for your my i have one sales organization 1000 and distribution channel00 for common and D1 d7 totally 7 distribution channel and 8 division so how can i maintained in vor1 my clients requirement is customer master should be prepared in all (00--- d7 ) distribution channel and material master was prepared in only 00 distribution channel and sales order should be maintain all distribution channel and all division.

  • Which is the best way to edit this program and make it read 1 sample from each channel?

    The original program was made with Traditional NI-DAQ. I have edit it to DAQmx the best that i could. The program it's already applying the voltages that are generate in the code(Daqmx Write.vi). But i'm having problems with acquiring voltages it's giving me rare readings(Daqmx Read.vi)  i don't know if i have to make a (Daqmx Start Task.vi) for each channel in the program or if i can make it work with a single one. Notice i have not make many significant changes because this program is already running in another lab and they give to us the program so we didn't have so much problems but instead of getting the BNC-2090 they got the BNC-2090A that uses DAQmx instead of Traditional. So anyone can help?
    Solved!
    Go to Solution.
    Attachments:
    2 Lock-In, 2 V Amp, Vd Amp - 090702(MTP).vi ‏100 KB
    2 Lock-In, 2 V Amp, Vd Amp - 090702(MTP)new.vi ‏107 KB

    A BNC-2090 is just a connector block.  It has no effect on whether you need to use DAQmx or traditional DAQ.  That is determined by the DAQ card you are connecting the terminal block too.
    You might be referring to this document Differences Between the BNC-2090 and BNC-2090A Connector Blocks, but that is just saying to the change in the labels of the terminal block to accurately reflect the newer DAQ cards.
    What problems are you having with the new VI you just posted?  Are you getting an erro rmessage?  I don't know what "rare readings" mean.
    You really shoud look at some DAQmx examples in the example finder.  Some problems you are having is that your DAQ blocks are all sort of disconnected.  Generally, you should be connecting the purple wire from your create task function, throught the start, read or write, and on to the close task.  Many of your DAQ functions are just sitting out there on little islands right now.  You should also be connecting up your error wires.
    With DAQmx, you should be combining all of your analog channels in a single task.  It should look something like Dev0/AI0..AI7.  Then use an N channel 1 sample DAQmx read to get an array of the readings, which you can then use index array to break apart.
    Other things you should do is replace the stacked sequence structures with flat sequence structures.  Turn on AutoGrow for some of your structures such as the loops.  In the end, you might find you can eliminate some sequence structures.

Maybe you are looking for

  • WICD can't get IP using cable?

    Hi, When running the default "network" i can lease a dhcp address. when following the wiki: INTERFACES=(!eth0) DAEMONS=(syslog-ng dbus !network !dhcdbd !networkmanager wicd ...) I still cant get any ip using cable...wifi works... error message in mes

  • [P67-A] DVD Drive not showing up?

    Hi all, I have a P67A i5 board and I'm baffled as to why the DVD drive isn't detected. It has worked in the past but doesn't now. I have 2 SATA HDD's connected to port 1 & 2 (the 6Gb/s ports) and I have a SATA DVD drive connected to port 8 but it doe

  • Merging Cells in Report Designer

    Hi, according to SAP Documentation http://help.sap.com/saphelp_nw2004s/helpdata/en/d7/6b9b41aa6ca309e10000000a155106/frameset.htm it shall be possible to merge cells within Report Designer. However I have tried it on several ways but was never able t

  • Slightly OT: methods used in first step of design process

    In my first couple of weeks of class, when faced with a new assignment, I would sit down at the computer, book in hand, and start typing. I spent alot of time doing that and ended up re-writing my code several times over. Then it came time for our fi

  • Install CS6 on both stationary and laptop

    I have purchased CS6 and have it installed on my stationary PC. I was told I can also install this on my laptop (Mac). But when I put the CD in I have no option to install it. How to do this?