DAQmx feedback loop

Hello

I write a VI in which an output voltage signal is sent initial (for example 10 cycles of a wave of fishing) in an electronic device. At the same time, another channel reads the voltage. In the next iteration of a loop, I want the voltage signal recorded to read to write to the output of the initial channel, such as entry becomes output and so on.

Here's my vi at the present time, it works in the most generous sense, but I got some errors that I can't fix.

Initially, the first iteration is registered without problem, but then, in the reading part, I get error-200279, then 200462 of error in the passage of Scripture. These are related to overwrite data in the input buffer and an empty output buffer, respectively.

My .vi is attached. All the words of advice or encouragement?

Thank you very much!

OK thanks Kira T and Ye Yongqing for helping me through this, and I think I found a solution that I wanted to put in case it helps other people with their projects.

Kira, I took your vi and, as suggested, exchanged the data record for a manual recording of data in the .tdms and that solved the 2525 error problem. However, when I have read the data (see data1.jpg), there are 2 immediate problems:

The beginning of the initial wave of sin was being cut. I attributed this to the fact that the first task of writing Daq starts before reading inside the loop, so the first bits of the wave of fishing through the system until the task of reading can begin. I fixed that by placing the start task for writing vi inside the while loop, in a case statement that would run only on the initial iteration. Now reading and writing tasks have been synchronized.

The second problem is quite strange - it seems that only a part of the 'i' iteration data is returned in the task of writing for iteration i + 1, and so the signal becomes gradually slowed down or expanded with each iteration since the writing task writes a progressively smaller chunck of the initial wave of fishing. By trial and error, I found that, in re-introducing the calendar than VI on the task of reading, this problem has been resolved.

In the feedback v1_3. The desired effect is achieved: the signal is sent on itself, the noise level increases regularly with each iteration, and it doesn't seem to be cutting or the shortening of the wave of fishing.

Thanks again to you both for your help!

-gim

Tags: NI Hardware

Similar Questions

  • Anyway to save the data in a loop without using shift register or feedback loop

    Hi all

    I've been thinking, is it possible to save data in a loop to the next iteration without the use of a shift register or a feedback loop?

    I need the possibility to reload the data within a loop from a file of lvm, but I want to use the same data until I have load some new.

    The reason why I don't want use the node registry or feedback shift is due to speed, although I don't know if the registry change

    in fact moves all the data of one register to another, or if it is stopped until a change data occur.

    I want to reuse data medium and large (6 measure of strength, pressure 2, 1 flow channels) of about 10 s data in each file with samplingsrate of 2 kHz...

    In my testing program, I have several CPU demanding computations and 3D graphics, so I want just to minimize the CPU loading as much as I can for each part of the

    software...

    I am enclosing a small VI to explain what I mean.

    I have now, I shouldn't use the express VI and I'll change that as well - it's just a proof of concept!

    Hope you guys can help me better understand this shift register...

    Thank you!

    -Tommy

    If the speed is the name of the game, go with the flow (data) and stick to a shift of registers or feedback node.  No data is moved, their job is to do pretty much exactly what you describe.  Any other solution, control/locals/globals will imply a copy of the data, and then you will have problems with speed.

  • feedback loop on the impact force

    Hello

    I use labview 8.5 and a card Ni USB-6221 to control the power output of an actuator and monitor the output signal of a load cell.  The actuator allows strength 50 Hz which is measured by the sensor.

    The signal from the load cell is basically a very narrow peak occurring at a 50 Hz.  I want to measure the height of each peak, average figure (maximum strength varies from 2 or 3%) and then use this data to provide a feedback loop to keep the constant force applied.

    [img] http://farm4.static.flickr.com/3067/3077344302_4b7bb5f2a3.jpg [line]

    I tried to use 'amplitude and levels' vi 'peak', for an average to exit mode.  However, this seems to give a result fluctuate widly which is useless for feedback purposes. I tried to increase the sample of this vi period with no luck.

    Anyopne there any suggestions on how to do this? I could do this using the detection of peaks of waveform?

    Any help or advice would be greatly appreciated.

    Thank you very much.

    Hi John,.

    Thanks for your post and I hope that your well.

    To create a circular buffer in LabVIEW, you can use a shift register. However, for large number of data points with a large displacement to register on the side of the loop are stupid and impractical. This is why you must use a table, in which you update the value of the old with the new value, and you set the size of the table for the number of points you want to have in the buffer.

    I have created an example of a buffer in LabVIEW 8.5 - Please see attached VI.

    Also, if you do any static anylsis so perhaps consider using the functions of point by point, which no longer require the updated value to calculate the most recent average (for example). This saves because of the calculation table in its entirety every time.

    Hope this helps,

  • Feedback loops for the algorithm of peak power of solar cell

    Hello. I have some experience with Labview but I am struggling with the structures and feedback. I have an instrument that defines a load power voltage and measures. It will be connected to a solar cell that has a peak power (see the trace on the photo). I need a simple program that will make the instrument to oscillate around the point of maximum power. He must set the voltage, power, add a voltage increase, measure power, then add or subtract the voltage according to the question of whether the power has increased or decreased from previous measure. I am attaching a schema. Start V and delta V will be given and fixed. I don't know how to implement with Labview code. Thanks for any help!

    Hello

    Search here for a simulated a simple peak loop

    It allows to store the previous registry data at offset

    e time delay without the processor and also to simulate the transfer of communication with instrument

    concerning

    Tinnitus

  • "Ground feedback loop."

    I searched a lot of places to find the answer to this question, so I hope I can get help here.

    I first noticed this problem a few weeks ago.  I lived a few white lines rolling on one of my monitors (I use 2, normally).  So, I contacted the manufacturer of my video card, and they proceeded to solve several problems.  I consider myself a fairly technical person, so when they offered a possible culprit, I would try several things to fix.  Now, I liquidated their inconvenience when I realized that (stupid on my part) my computer was sitting on top of a speaker.  Move the speaker removed the lines... temporarily.  They returned a few hours later.  This made me think that it wasn't a physical problem with my hardware, but a sort of interference of the devices plugged into my computer.

    I found that by unplugging my audio device, interference went.  So, I tried "Routing" my audio through my DVR (by plugging my audio device on my PC in the entrance and exit of the DVR) but the rows returned.  Naturally, this made me think, it's the receiver (Pioneer Surround) I always used as my PC audio device, so I tried to connect my computer to my TV (LCD Sharp), but it produces the same result (even with nothing else plugged in).  Eager to solve the problem, I tried hang my PC up to my DVR (unplug the TV and receiver) and persistent interference.

    So, it seems that no matter WHAT, I plugged my sound card created this interference, but I use an INTEGRATED sound card, so if that was the problem, I was in big trouble.  As a last ditch effort, I found a pair of old speakers bureau with an AC adapter.  The adapter has only two pins, so I guess that means no basis (not exactly).  They worked.  No interference present on each monitor, cementing my theory, that it was a "ground loop", but...

    My question is, how can I fix it with other devices?

    Also, I have all the Tech Info. If this is necessary, but I don't know what information is needed in view of the issue.

    Edit: I have test points of sale that everything is attached and that they are properly grounded, there must be something I forgot.

    So, after some additional testing, I discovered that this problem is caused by a problem with my cable emitting interference. The cable line itself is originally a kind of interference and any equipment to which it transfers this interference. (TV, DVR box) It is including any device connected to these devices. Disconnect the cable from the cable box solved the problem, if this good obviously a problem with my cable provider.

    Sorry to bother someone.

  • Issue of feedback loop

    SEE ATTACHMENT BELOW *.

    I created a program that creates a constantly updated intensity image, but I would like the user to be able to adjust the 'exposure' command when using the camera. Currently, the unit is set and continuously takes pictures on a single exposure setting. I don't know how to integrate the exposure time in the loop, without compromising the structure of the program.

    There are 2 approaches (well, there is more, but I'll describe 2 of them )

    (1) use the 2 loops. The inner loop (the one you have) ends when the user changes the exposure. The outer loop just updates the exhibition and then again the inner loop.

    (2) put the VI exhibition in your acquisition loop, but only called when the user changes it (use a shift register to check if the value has changed. Place the VI so the exhibition is changed so that no data is acquired (for example between data and begins to take a new picture).

    I hope this helps.

  • Cannot insert (video loop while VI)

    Hi all

    I'm building a VI to count the fringes of an interferometer using a video camera of Thorlabs 1645C (with the VI UC480). The intention of VI is to count time passing a certain pixel fringe and to do this, I need a counter threshold. As can be seen in the screenshot, video array is first reduced to a single pixel (using a slider) to get a 256-bit integer that indicates the levels of gray. This gray scale should trigger an account each time it passes a certain value, but the threshold detector resets whenever the grayscale value dips below the threshold. I tried to use while loops (and other loops of types), but in these cases the video play not at all, making it useless VI. When you use the other fixtures, however, as one set, the count will be just continue to rise as long as the grayscale value is greater than the given threshold, or it is not at all.

    After a week and a half of trying, I am ideas. Could someone please help?

    Next time, I have a question, I'll post an excerpt, but since this VI needs a specific camera, run, I was thinking that showing the complete VI would not be useful.

    I think I found the solution well! (It seems to work because as far as I know)

    It turns out that I needed a bigger? block instead, in which the feedback loop has a high value for an iteration unique 'loop' (which is strange, because I have used almost the exact same set-up, but instead of the threshold detector VI, I used a Boolean value, which has been without success).

    I added a screenshot because it seems more convenient than adding a VI (due in part to compatibility etc.)

    Thanks for all the comments

  • The sum of several waveforms, created inside the loop for

    Hello

    I am currently viewing the Gibbs phenomenon by adding several sine waves. The issue I'm having is that I can't understand how to add sine waves created in the loop. I have attached a picture of the basic structure for my project below. I tried to use simply "add" with a feedback loop, but it seems that my programming skills apply here. Any suggestion is appreciated. Thank you!

    0

    Something like that?

    1. make sure that you "reset" the generation of signals with each iteration

    2. with the waveforms, please make sure that the sample rate is the same.  This may be a problem with the first iteration.  Then add in a check to use only the first waveform on the first iteration.

  • Cannot compile control & Simulation loop

    Hi, I am trying to compile a simulation, and the problem is a feedback loop

    which is not accepted.

    I want to write a program that removes the signal of its DC component and controls the amplitude of the remaining AC signal

    Thanks to a feedbackloop. The PI-regulator controls the gain of an amplifier.

    Hello laskar01,

    Instead of the feedback, use VI memory node. Your problem should be solved.

  • Feedback created by stupid mistake of anchorage

    Hi - I recorded a call using FaceTime and an audio capture for Mac program, I would rather not name. The stupid mistake is that I don't cut off the flow and so I had this slight feedback loop along the:

    comments-audio-recording - sample.mp3 - Google Drive

    I ran across my very short playbook of the effect and strategies of EQ, and I think that there is no solution here.

    It's for a podcast so audio doesn't have to be perfect - but not boring. As it is.

    If there is an obvious tool I'm missing, please report to me! Thank you.

    I'm afraid that you won't be able to get rid of that at all - even a reverb-option will not move, because it's an identical signal in the form of an echo you have - there is nothing to differentiate it from the one you want. Not only that, but it is at the same level, so you can it is no more.

    I'm sorry, but I think you're stuck with this one.

  • Sampling point frequent

    I have a 6008, accessible by DAQmx.

    I produce a custom feedback loop. As the analogue output has a sampling rate of 150 Hz, this is the maximum rate of the feedback loop.

    I'm trying to figure out how to make my analog readings.

    I have excluded finite samples (if I let up, I pass the same values and more; if I reset, it's far too slow)

    With continuous samples, if I take a unique data point, I'm not synchronized - I don't want to read the end of the buffer, I want the most recent.

    So I try sample N read, with-1 as the number of samples to be taken, that help said is the way to capture the whole buffer.

    I get an error-200279, who says I'm trying to read data that no longer exist because it crashed. But that seems like it should be a nonsense - I just say, give me what you got. Why bother crush if you are never just refuse to put her out in any more data and call a mistake, because you started to crush? It is frustrating especially since I really don't care for the newest item (or recent average for all purposes)

    There are a lot of topics around this error (-200279).

    Have a look here and try to understand exactly why you get this error. You too can share your code so that you can have a careful review and understand what causes the error, specifically in your code.

  • Time to update buffer PCI-6713

    Hello guys,.

    We use PCI-6317for 50 Hz generation of waveform of 3 phases for a quite a while using the library OR-DAQ traditional.

    We could not get a reliable update of a waveform with a single call to the WFM_DB_Transfer function and need to call double.
    Otherwise, we could sometimes get a signal consisting of the buffer past and present.

    For now, that's a good solution, but now we have different requirements.

    We went to NOR-DAQmx and surprisingly managed to update the PCI-6713 buffer with a single call to DAQmxWriteAnalogF64. But it seems that we can update the buffer only once per period of output signal.
    For our 50 Hz signal is 20mS. Function until the next blocks.

    That is the first question.
    Can we call DAQmxWriteAnalogF64 wave update more often than 50 times per second for the output 50 Hz signal?

    If the answer is positive, how can it be done?

    I have attached a LabWindows CVI 7.0 source code for an example of test (for 1 channel only) program we wrote specifically for this post.
    The waveform generation is started by calling ConfigureTask and StartTask reminders in this list.

    Could someone kindly tell me what changes to the code have to do to update the asynchronous output with output buffer?

    And another question.
    PCI6317 can generate signals with different frequencies (channel 1 said generates 50 Hz signal, channel 2-60 Hz, etc.)?

    Thank you very much for all supplied glue!

    Andriy

    The answer to this question is no.  It is not possible to dynamically change the environment buffer output.  You must wait until the buffer is exhausted, and then change the stamp on the next set of data.

    The only thing to do with your current hardware is to reduce the size of form of wave/buffer.  You must call the function write significantly more often, but you can change it to any of these points.

    Also, get a reliable 3ms response in your software feedback loop will be entirely dependent on the speed of your computer.  If Windows decides it must allocate resources elsewhere (automatic update check, MS Word being opened, Media Player, play music), then the program CVI can certainly lag.  That's why he could miss the update of buffer, which is probably the reason why you get the error 200290. The code cannot run fast enough for all process before the depleats buffer.

    The absolute best thing to use to control is one of the FPGA modules.  With them integrate you actually in the material you want your control algorithm to be.  This means that the control algorithm is all timed material, producing the best possible response times.

    What rate are you inputing to the sampling frequency?  In addition, in the code you sent that you send "fFrequency * SAMPS_PER_GRID_CHANNEL" to the DAQmxCfgClkTiming function.  I wonder why you're multiplying your frequency of SAMPS_PER_GRID_CHANNEL.  The rate input parameter must be just the frequency in Hz you want items to be generated at.

  • Mac Book Pro is not too hot.  It is time to replace the battery?  Can I replace the battery?

    MacBookPro is not too hot.  It's time to change the battery?  Can I do it myself?

    The Mac runs his fans in a feedback loop, based of the internal temperature measured.

    If the temperature goes up and the fans are not speed up to compensate, you probably have a hardware problem.

    If the Mac becomes too hot, it will make an uncontrolled emergency power off.

    EDIT: Replacing the battery is a completely separable question not related to temperature. Is the Samsung phone batteries that catch fire, not Mac.

  • Airport Express does not work

    I need help. I have an Apple Airport Extreme and extend it with an Apple Airport Express. One day I needed to my extreme, which I did, forward port (which was for the xbox, and I followed this: Xbox NAT open (Apple routers)) I then updated my Airport Extreme. Subsequently, my Express glows green but it does not actually give a signal, I stay connected to the extreme, so I tried to use ethernet with the Express, and who won't let me connect to the Internet. So, I need help.

    If the Express was created to connect to the AirPort Extreme using a Wi - Fi connection, and you later connected to an Ethernet cable to the Express... that creates a huge feedback loop that actually blocks the network provided by the Express.

    You will need to restart and reset the Express back to default settings, then set up again.

    If you want the Express to connect permanently at any time to the extreme by using an Ethernet cable, then you must establish this connection before you implement the Express again. The Ethernet cable can never be disconnected.

    If you want to Express to extend the wireless network, then you use an Ethernet cable to the installation.

    If you need more tips, post back to let us know what operating system your Mac is running or you use a PC or an iPhone / iPad to configure things.

  • Two express AirPort and time capsule connectivity challenge

    Dear readers,

    I have a Time Capsule 802.11 ac connected to my ISP router and this is the router that provides DHCP addresses, etc. In our living room, I have an airport express (2nd generation) connected via radio and it works very well also. Now I got as a second AE (2nd generation) and want to put it on the floor of the attic to get a stronger signal via Ethernet to my TC. When I connect to a LAN of the TC port to the EI LAN port, the AE salon disconnects. When I add the Ethernet of AE cable in the WAN port both t he AE to the attic and TC disconnected. Currently, it is also connected via radio and it works, but will of course loose flow because it must still go through the different floors through the air compared to a stronger signal via Ethernet.

    Question I have, can I connect an AE with an Ethernet cable (and how to set up the AE or TC as a result) and an adverse event via wireless (IE editing exsisting which works, but let me know if you have to configure changes too)?

    Your help is very appreciated.

    Can question I have, I connect an adverse event with an Ethernet cable (and how to set up the AE or TC as a result)

    Yes, but you will need to restart and reset back to default settings AE. Then connect the Ethernet cable between a LAN <>- on the TC port to the "O" of EI before WAN port you are trying to configure EI.

    The problem that you are experiencing now is probably caused by connecting an Ethernet cable to an adverse event that has already been configured to "extend a wireless network. When EI is configured this way, is expected to Wireless ... not Ethernet. Ethernet is applied, it creates a feedback loop huge on the network which can cause all sorts of issues.

    Wizard Installation from Apple because most of the work for you. Just click the WiFi icon at the top of the screen of the Mac and then click on AirPort Express under the title of the new AirPort base station.

    When you click on AirPort Express, which will start the configuration "Wizard". It will take a few seconds to analyze the network, and then present a screen that looks like this:

    Type a device name you want to call the AE, and then click Next.  Monitor the screen following very closely... See the illustration below to confirm that the AE is set up "extend using Ethernet.  Who will confirm that the wizard picked the Ethernet between the TC and AE and apply the correct settings to EI.

    When you see the message Setup is complete, click done and you're done.

    If the 'other' AE is already set up to extend, then no further changes will be necessary on this device.

Maybe you are looking for