Any problem of loop sampling frequency

Hello

I am a student who did a thesis on the electric vehicle tracking system in labview. I collection of usb-6009 analog measurement data, transfer it in the daq assistant and state machine inside a while loop to do the follow-up process.

So, I have a State that determines the sampling frequency of the loop cycle, and I was able to modify this rate in the values of 0.1, 1 to 5 Hz, I realized that it with out of time VI Express, which is in a loop, but outside the case of structure for States. I'm going to rate last in time "Target Time" of entry and the Boolean output "Elapsed time" goes to the business structure, passing to the next state when the time runs out. In the next State, it resets the elapsed time and the cycle starts from the beginning.

Thus, everything works fine until I see in my log file (txt file where I save the measured values) it's only 3 or maximum 5 Hz frequency 4 samples per second.

I have a good enough computer with processor i7 and 8 GB of ram.

What could be the problem?

In the picture below it can be seen how I realized that with timer.

Thank you in advance.

Matej

As I mentioned in my previous note, your problem is that you start a new target for the time time vi ONCE your analog playback is completed.  This ADDS essentially no matter what time is taken by Analog playback on top the time you ask vi of time spent waiting.

I modified your vi and I think that should take care of your problem of synchronization.

However, I suggest using "Wait until the next ms Multiple" because unlike the vi express you are using, one I mentioned allows other processes are doing their job in the meantime.

Hope that helps...

-DP

Tags: NI Software

Similar Questions

  • How to write multiple entries with KHz sampling frequency in a file outside the loop?

    Hello

    I am able several entries of string tension using the wizard DAQ (1 sample on request) and it is placed inside a timed loop of frequency 1 KHz.

    This timed loop is placed inside an another while loop.

    Problem is with writing data to a file, although I can see 100 samples of 100 ms in the graphics cable to the out of the way, but the extent of writing to output file stores either only from 19 to 20 samples per second (when he wrote inside the timed loop) or does not store any (if placed outside the timed inner loop).

    I tried to set up producer consumer structure but in the loop of the consumer, I can't write the data in queue to a file saying data type mismatch. I placed the loop starting queue item and consumer out both loops and the element of queue inside the timed loop exit DAQ fed to the queue item.

    Can you please help me solve this problem file writing?

    I haven't looked so writing code from the top of the head, but access to the files is slow, and if you open and close the file, it is quite slow. What do you usually do it write to the file at a slower pace, for example once per second and write all the 1 k samples at a time. Try and also keep Ref file open during the test.

    /Y

  • Change the value to trigger record data for 1 s sampling frequency of 50 KHz

    Hello

    I have a VI with NI9215 and cDAQ-9178 chassis hardware. The function of the VI came out an instruction to RS232 interface and record 1 second of data every time that the set point is changed.

    The procedure is

    (1) modify the policy to the flow regulator

    (2) wait 2 seconds.

    (3) record of 4 channels for one second to the sampling frequency of 50 KHz.

    At present, the problem is for the first edition of this program, two seconds (rather than) data was saved and corn, the error message 200279.

    II. I revised for the second edition of the structure of the producer and the consumer who can increase the speed of the buffer.

    The question is how to configure the trigger to start the backup of data and limit data save for one second whenever the set point value changes.

    (1) which edition is best for my application?

    (2) how to trigger the data record?

    (3) how to record only a second of data?

    I also checked this announcement and the elapsed time seems not to work for this case.

    Any help would be greatly appreciated!

    Melody

    Hello

    you have not used properly the nodes property.

    1. replace the case structure in the first loop, with DAQmx features, with a structure of the event. Change the event fires for a worth of control of the setpoint change.

    Edit: as stated in your first post, use the structure of the event, but put inside the while loop.

    2. DO NOT connect error output from the stop command property node. Replace it with a local variable for the stop button.

    Try these and let me know.

  • Average implement properly sampling frequency

    I am writing a program for the acquisition of data that reads the voltage and data current with a 3 phase generator, IE. There are 3 channels of voltage and data 3 (also represented under tension) current data channels come in my USB-6009.

    The waveform is not yet known but probably roughly sinusoidal until about a power of say 1.5 kHz frequency. I need to work on the (reliable) frequency in real time I know the speed of the generator. I use the 'harmonic distortion Analyzer' VI do basically this deep down it's a FFT on the data. I suspect it's too much an overload of treatment because if I increase to more than 1000 Hz sampling frequency, I'm starting to have problems - and if the data max 1,5 KHz I need to sample and analyze at least 3 kHz, of course.

    Yes - the question is, how can I get the sample to say 3-5 kHz and work on the fundamental frequency of a channel in real time without causing any fall?

    All responses are greatly appreciated.

    Dave

    Dave,

    (1) I prefer to put all of the analyses (as TFF) in a separate loop.  The loop of the acquisition is acquisition.  He acquires the data and puts it into a queue or motor of action to be used elsewhere.  In this way the acquisition schedule is not dependent on the time required for analysis or display or save to file...

    (2) lines are built in features that allow the data to be passed to independent parties to the program efficiently and without risk of conditions of competition inherent in global or local variables.  They also have interesting features like the clusters of the error and wait times.  Motor action are the screws in the form of a while loop with a shift register uninitialized to retain this data.  They contain generally structure case to allow the selection of different actions, such as Initialize, writing and reading, or more complex things like subset of return or average accumulate data.  Research on the Forum for the nugget of Ben and many other messages on the subject.

    (3) convert the data type as a whole.  Obviously, you cannot acquire a fraction of a sample, by using a representation of data that supports the fractions is not necessary.  In this case, it is not a big deal, but constraint points can tell you that LV is doing additional work behind the scenes to change data types, maybe not the way you wanted changed them.

    (4) Yes and no.  The FFT should work even if the signal to noise ratio is reduced.  Think of the component continues as being the 'noise' in this calculation.  If you want zero crossings, so it is essential that the offset be withdrawn.  With the current shift zero crossings will be moved off the middle of the sine wave points or the signal may cross any zero if the oofset is greater than the peak of the periodic component value.

    (5) I suspected something like that.  Multiplying is a bit faster than dividing so it is best if the speed is important.  If it is more convenient for the user or the programmer to get dividers, let the programme calculate the reciprocal multipliers.  Do it once, outside the loop where it does not affect the time.

    (6) I missed that you move data between the loops.  Can't do it with the register shift.  See point 2) on the queues or the drivers of the Action.  Notifier could be used also for the stop.  My opinion: the only place where you need a local variable is if you need to write a value to a control, such that when you set a saved a file configuration.

    A lot to learn.

    Another question: in the original post you said that you needed the determination of the frequency in 'real time '.  It is a slippery term.  You use it for anything other than the number of samples to read?  How fast can change the frequency?  What are the consequences of a delay in obtaining the frequency?  How late can tolerate you before that consequences are unacceptable?

    Lynn

  • DAQmx task Read DAQmx with sampling frequency of 10 Hz produced much too much data

    I have a simple configuration with a strain of channel 4 OR-9237 amp holds a carrier of series C of WLS - 9163 (wired ethernet mode) - Details probably does not matter.

    I used MAX to create a DAQmx task associated with which all four gauges samples.  The calendar setting is "Scan Loads" is continuous sampling, 2 k buffer (read samples) and 10 Hz rate.  I guess that this task would generate 40 data values per second - 10 for each channel.

    I have a simple loop of reading using DAQmx Read.vi that works always (without any stimulation time).  Playback is set to read all available data and then pump it into a table.
    In the attached example, I also added a few words of debugging to stop the loop after N iterations.

    As the loop is programmed with a 0.2 second period, I expect each pass of the loop to read about 8 samples or 2 samples per sensor.  Instead, I get hundreds each passage.  It's like reading has substituted the sampling frequency specified in the task of the unit.  I absolutely need data to be material to the rhythm.

    Where have I lost?

    Thanks Adnan,

    I changed your example I selected 'Strain gage' entry analog and then lowered the minimum and maximum thresholds to +-1-2.  What happens is that each other in the loop, I 2048 samples or zero samples.  The display flashes a whole line and then it clears any other past.

    In response to your second post, I understand that the loop cannot run quite right that I select.  I think that, but at a sampling frequency of 10 Hz, I have to sleep on the software side for nearly a minute before I built 2 K samples.

    I played with the frequency of sampling, assigning to various values from 0.1 to 10000Hz.  The behavior is the same until I approach the high rates where available samples remains to 2048-4096 sometimes, the display becomes continuous.

    Ahhh, Darn.  Yet another search was this link that points to the root of my confusion.  The 9237 can taste arbitrary rates using its internal clock.  Duoh!  I wish that the pilots are smart enough to warn you if there is a discrepancy between the selected sampling rate and capabilities of the device

  • Problem of continuous sampling

    I'm having a problem when showing my rate for samples using Labview with an accelerometer (acquisition mode: continuous). For example: I indicate a rate of 1000 hz that should output 1000 samples per second. However, when I export to excel, the number of samples per second is 2000. It seems that the data is collected twice faster. Also, my reading rate is configured to be the same as my rate. Any advice would be much appreciated. Thank you!

    Now, I see that you use cDAQ. If it's the 9234, sampling frequency minimum as you can see in the specs is 1.652 kech. / s.

  • Cannot set the < 1609 sampling frequency

    Hello

    We have recently upgraded to LV 8.6 and 8.7 DAQmx and then you have problem with the acquisition of data that uses the DAQmx API. For example, we have a module HAVE cDAQ-9172 and 9239. The device can be specified by the user and a typical configuration could be a continuous CQI, one sample at 10 Hz. After the upgrade of the 200279 error "attempt to read samples that are no longer available... crushed" came little after the task was started. It turned out that the property sampleclkrate is not affected by the value that is put in the DAQmx Timing.vi, except if it has been set > 1612,9, if you set 10 100 or 1000 or whatever the sampling frequency will be always 1612,9 when you read in the property of timing.

    If the buffer then of course becomes flew, but the question is why there is a minimum sampling frequency like this? Earlier, it was fine it set a value of arbitray and the acquisition would be at this rate.

    There are a lot of solution to get around this (faster reading, etc.), but it is strange that the behavior of the code can change from one version to the other like that...

    / Henrik

    I see a flaw in your program, you have the hardware timing and calendar in a software loop. The loop is limited by the expectation of the software. (I think it's on purpose for the demonstration).

    I looked at the Manual for the 9239 and page 18 notice that the minimum entry rate is 1613kS/s

    So that is explained, the only problem is that the timing DAQmx VI does not return an error or a warning when you set a too low rate.

    Tone

  • Can I mix up to 32 bits at a higher than 44.1 kHz sampling frequency?

    When I'm using Ableton Live, it allows me to choose 16, 24 or 32-bit, and then I can choose a up to 192000 sample rate.  Is this possible in the hearing?  I've been through all the preferences and all tabs and I can't find this option.  Everything I find is a convert, or the option adjust.  But this isn't what I want.  I want to mix down this way.

    The closest thing is when I go to "Export Audio Mix Down", I found, I can select 32-bit.  Then, there is a box for the sampling rate, with all the different values.  But it doesn't allow me to change of 44100.

    ?

    sleepwalk1000 wrote:

    Thanks for the responses guys.  Hmm, well the reason why I ask this question is because I am preparing a cd to be sent to a mastering studio.  The engineer told me to mix down to 24 bits instead of 16 bit.  I asked him why, because everything happens to 16 bit cd anyway.  He said even if my session has 16 bit files, if I have them running through the beaches with effects bus vst as Altiverb (which I do), it will improve the sound effects in mixdown, if treated according to a higher bitrate.  Would poll better mix so he could work in the mastering session.  I assumed that this meant that a higher sampling frequency would also be beneficial.  Maybe not?  I use a lot of high-quality vst effects, so I want to make sure I get the best possible results.  I mean if you have this option and space disk hard isn't a problem, why wouldn't you use it?

    It is interesting that the export Audio Mix Down allows me to mix a session from 16-bit to 32-bit files, but if doesn't let me change the sampling frequency.  Maybe I'm not understanding these terms exactly.  I always thought that, for two, more the number, the higher sound quality.

    SteveG - tell you it would be a waste of more than 32 bit 44.1 kHz mixing?  What about k of 48 or 96 k?  There is not a noticeable difference?

    The sample rate only affects the highest frequency that can be solved - it has no impact on the quality of all, once the rate is high enough to fix all that humans can hear. You determine the highest frequency that can be resolved in any case of the sample given by half to get the "Nyquist" frequency - so 44.1 k the highest frequency that can be fully resolved is 22.05 kHz. The human ear extends up to 20 kHz, but it's only in young children - by the time you reach your teenage years he began to fall, especially if you listen to a lot of loud music... then 44.1 k is already greater than any human condition to the response at high frequency. This overall been proved? You bet it has!

    To discover the truth about the hype about the sound quality in general and more bits/sample rate are concerned, you should first read this thread of AudioMasters - and the links it contains. It's of high quality academic research, and all attempts to discredit have been completely ransacked.

    Your mastering engineer is correct up to a point, but not really for the right reasons - mixtures of 32 bits are usually more specific, simply because the sums do more accurately and scale of signal is significantly improved. You must keep in mind that the only place where you will hear no appreciable difference with one more high bit depth would be in really quiet parts of reverb tails. The best way to do a mix in Audition is to do all this in 32-bit (which is floating point version of 24-bit anyway) and if he really wants a 24 bit file, you can convert the 32-bit mix after that you have to create a copy of 24-bit integer. As much as the 16-bit CD is concerned, if you (or engineer) procrastinate it properly when you do the master of the 16 bits of the final mix of 32-bit CD, then the effective resolution is higher than 16 - bit anyway - there is also a thread of AudioMasters explaining all this too (it's complicated).

    What all the above implies, is that if you keep your mix 32 bit 44.1 k files as they are, if you remaster at a higher sample rate, all you have to do is up-conversion files in hearing. You don't win a single thing in doing that, but then again, you won't lose anything either - and person don't will be able to make a difference! This is not a case of "why don't use you it?" - this is really a case of ' why would you? "

    Either way, it should be noted that due to some misinformation presented by people who should really have known better long, understanding of most of the people of sampling is completely and totally false. Once more, a search around AudioMasters will give you a better understanding of the present. If I get a chance later, I'll look on all appropriate threads.

  • AI PXI-6255 sampling frequency

    Hello

    We use a simulated PXI-6255 device and with the LabVIEW example, apparently, that we can achieve a sampling rate of 20 kHz to 50 channels without warnings or errors.

    The spec is the number max of 20 kHz channels must be approximately 38 channels (750000 / 20000).








     

    1.25 single channel of MECH. / s
    multi-channel of 750 ksps / s (aggregation)

    The simulation cannot not representative of the unit or the real PXI-6255 does support a higher rate that we expect?

    Hi jharris66,

    It is not a limitation of the driver to the sampling frequency, so a simulated device reports any error in this case.

    In this example, I think that the limit of 750 kHz comes to the multiplexer.  I don't expect to see the same error messages with the real device, but your accuracy will probably not to spec because not allowing enough time settling between the channels.

    The limit of 1.25 MHz is the maximum ADC sampling frequency.  You can probably exceed this number somewhat, but once you go too far beyond 1.25 MHz you will eventually receive a synchronization from the hardware error when the ADC cannot follow.

    Thus, the specification is still technically 750 kHz for channels multiple acquisitions.  You can probably run at a higher rate than this (even on real hardware), but I wouldn't say that it is supported.

    Best regards

  • Xincrement is not agree with sampling frequency

    I use two PXI-5114 scanners that are being synchronized. I am taking 5 seconds worth of data.  I have = 1e3 sample rate and record length = 5e3. I get only about 1.3 seconds worth of data.  I looked at the actual length of the record and the actual sampling frequency outputs and they said the same thing as the façade made. I looked at and then the info out of the Cluster.vi of Fetch NiScope Multi Wfm and he had the same record length, but the value of Xincrement is 262e-6. This fits with what I get.  Any ideas?

    Thanks in advance.

    Hi AT1,.

    Thanks for posting. What you see, this due to the fact that the minimum sampling rate of the PXI-5114 is 3.81 kech. / s. The digitizer will force any value less than 3.81 kech. / s up to this value, so a record of 5000 samples take 1.31 seconds to acquire. If you are looking to acquire 5 seconds worth of data, I recommend to increase the length of record about 19 050 samples, which should be about 5 seconds worth of data. Let me know if this would work for your application.

    Kind regards

    Joe S.

  • ThinkPad T510 problem with the CPU frequency

    Hello
    I was a problem with the CPU frequency - in DC or battery it works 1/2 frequency (1196 MHz), but when my thinkpad plugged and is with battery it works OK (2400 MHz).
    Do you have any suggestions how to solve this problem.

    ThinkPad T510 (4384) intel core i5, 6 GB of Ram.
    Thank you.
    Best regards Nikolay

    What your seeing is actually normal and a result of power management settings. When it is on battery, the reduced CPU clock speed to improve the battery life and only increases in speed if a program requires processing power (games, adobe photoshop, CAD, etc.). If you wish, you can disable this feature by setting the "maximum performance" option in the Lenovo power management program and get into the bios and disable "Intel Speedstep" and similar power options setting. I hope this helps.

    -Brian

  • limited on PCI-6052E sampling frequency

    I'm trying to measure with two channels with a PC containing a NI PCI-6052E card that is capable of 333KS/s on LabView 8.2. With two channels each channel must be able to 333KS/s / 2 = 166.5KS / s. everytime I try to set the sampling frequency above 94339 Hz I the following warning and the vi no longer works.

    WARNING 200012 occurred DAQmx start Task.vi:1
    Possible reasons:
    Clock speed specified is greater than the maximum ADC conversion rate. ADC invaded errors are likely.

    If I place a similar task in the Measument and Automation Explorer and I can easily make two channels measures to 160kHz without error. Above 166kHz I start getting the same caveat (200012). The code that I use calls first DAQmx create Channel.vi, then DAQmx Timing.vi and finally DAQmx start Task.vi. Everything works fine and I did measuements, but I can't rise above 94339 Hz sampling rate even if it should be possible.

    I just looked and I can't understand the issue here.

    Dear Voyn,

    I thank very you much for your message on our forum. If you create a task for a single channel, you can get a higher sampling rate? Are you able to reproduce the same problem with an example from the finder example? Go to hardware to go end tab selected and output-DAQmx online-online-online-online Acq Cont voltage analog measures & chart voltage-Int Clk.vi

    You can select several channels as well. If it shows the same behavior; which driver DAQmx do you use?

    Best regards

  • How to change the DAQmx sampling frequency

    Hello

    I'm trying to: record streaming channels (acceleration 21 and 1 tension) using a DAQmx task, then convert the data to a PDM file. The program files and output to the TDMS file very well. The issue I'm having is that I can't change the sampling frequency. I want to record 500samples/s and I can not get the "real sampling rate" of change of 1651.61samples / s. I am trying to use the clock to do this and I succumbed. I also tried to change the settings of "Timing" in the task without a bit of luck. Here is a screenshot of the .VI I created. I've also attached a copy of the file VI. Any help would be greatly appreciated!

    Thank you

    Tony

    You will need to provide the model of your device. You can also look in the sheet/manual to see what the real supported sampling rates. Some devices have limited rates.

  • effects of sampling frequency on the convolution of waveforms (need feedback from a GURU of signal processing)

    I have included my code as version 8.5 for those who have not yet upgraded to 8.6.  I have also included some screenshots so that you can replicate the results I got.  I hope that some signal processing guru can shed light on what I mention it further.

    This VI convolves the signal of impulse response of a simulated servomotor which is essentially a damped sine the input pulse which is a step function.  The signal resulting convolved should be IDENTICAL to that of the step response of the engine which is RED on the display 1.  As you can see the convolution that results in table 2 shows the same structure of frequency, but its magnitude is INCORRECT.  As you can see in the catches of 2 screen sizes differ by a factor of 2 & done the sampling frequency of the wave.  Why the sampling frequency, impact on the scale is also very strange & disturbing.

    Would appreciate any corrections & explanations so that I trust the convolution of the other wave forms of entry than just the step function.

    OK, I think I have it working now.  Your premise on the effect of sampling on the derivative is not the issue.  Does it affect what the FREQ of levy is the basis of time of convolution.  As the convolution product is not continuous but discrete the length of the array should be taken into account & the sampling frequency must be consistent with this length of array as well as 1 second corresponds to 1 second.  If sampling freq is 2 kHz & the length of the array is 1000 then to get the correct time base by a factor of 2 must be taken into account.  In addition, to take account of the DC, shift of the ZERO gain factor must be added to the convolved signal to get the correct size.

    Thanks for making me think more deeply.

  • PCI-6111 valid sampling frequencies

    We have old card PCI-6111 that we still use. A question was posed regarding the applicable sampling frequency setting.

    According to the manual, this thing must have base clock of 20 MHz and 100 kHz. There also a divisor of 24-bit and (not sure about this) multiplier of 2 bits. I guess that these can be used for the base of appropriate clock frequency scaling.

    What sampling rate can be set on this thing? This is a spec 5 of average size, then that would be the upper limit. Can I put any arbitrary frequency (integer) under this? Or what I need to work explicitly what it's capable of? With a 24-bit divider, this would imply that there is a wide range of frequencies that doesn't "work" on this map.

    What happens when I select a frequency that is "bad"? Round it inflicts, turn down?

    Hello Isaac, it's Paul with engineering Applications to the OR.

    This device offeres 2 at simultaneous sampling of the analog inputs, 5 MS/s per channel - The 2 AI can enjoy up to 5 Mhz per channel each.  You can only have 1 frequency clock for your tasks to HAVE, but this clock frequency can be adjusted from 1 kHz to 5 Mhz, set by you.  Note that most of our maps allow GOT down to 1 HZ, but this ADC is different because it uses a pipeline ADC convereter.  In addition, since this card can taste at the same time, it means that two analog channels will be read at the same exact time (in parallel).  In addition, the value of I is a 12-bit number.

Maybe you are looking for