Real-time PID control and continuous buffered acquisition. Does it work together?

I use the "real-time PID control.vi" that acquires single AI point and generate single AO point in every "while loop" iteration to control a piezo actuator motion. Simultaneously I need to do (in another loop) a continuous buffered acquisition of another two AI channels (in the same rate as first AI channel).
It does not work together.
Does anybody know how to fix it?
Platform: LabVIEW 6.1
Board: PCI-6024E

Hi,
I would try to avoid the idea of using a separate loop since the PID
loop is a continuous acquisition and will require un-interrupted access
to the Analog DAQ system of the board. The last thing it needs is for
you to attempt to start other AI functions at the same time.
Configure your AI in the PID loop to read in multiple channels (Just add
some more channels to the Input Channels Control. Separate the data as
it comes out of the AI single Scan function using Index Array or other
Array functions into that needed for the PID and that needed for your
other data (the example is already doing this to make sure it only gets
1 channel of data into the PID). If you don't need to sample all your
channels of data all the time you can throw some data away as
required.
Obviously your other channels are now arriving one sample at a time so
if you might need to build an array, insert into an array or use Auto
Index on the loop if you are data logging.
Regards,
Dave R.
varmih wrote:
> I use the "real-time PID control.vi" that acquires single AI point and
> generate single AO point in every "while loop" iteration to control a
> piezo actuator motion. Simultaneously I need to do (in another loop) a
> continuous buffered acquisition of another two AI channels (in the
> same rate as first AI channel).
> It does not work together.
> Does anybody know how to fix it?
>
> Platform: LabVIEW 6.1
> Board: PCI-6024E

Similar Messages

  • Real-time pid control

    Hi,
    I found a real-time PID control in LabView examples, for E Series boards. I used one of this boards a time ago and used this control. It works very well.
    Now, I have a M series board (PCI-6221, LabView 7.0) and I would like to use a similar program. I tried to use the DAQmx assistant and look at the examples, but I did not find anything similar.
    Could you please take a look in this example (attached) and help me in configuring the PCI-6221 to work in similar way?
    I really apreciate your support.
    Thanks,
    Jeferson
    Attachments:
    Real-Time PID Control2.vi ‏131 KB
    simple PID.vi ‏53 KB

    Jeferson,
    I no longer have LabVIEW 7.0 on my machine, but I know that in LabVIEW 7.1, DAQmx installs an example called "PID Control-Single Channel.vi." This should be exactly what you are looking for. It can be found in the LabVIEW Example Finder (Help->Find Examples) by searching for "PID."
    Basically, this VI uses hardware timing (the rate will depend on your computer specifications) to acquire a single point, calculate the PID output, then output that value on the next sample clock.  Please let us know if you have any additional questions!
    Hope this helps,
    Ryan Verret
    Product Marketing Engineer
    Signal Generators
    National Instruments

  • I have a big delay in my real time pid control

    hi ,
    since i don't have a digital input module i tried to use the serial port RS232 on my Crio to read the data from an absolute encoder in order to perform PID control for  a dc motor, but the problem is that the data took too match time to be read; there is a big delay between the first read position and the next one,and when i change the slide controller the indicator took time to change, although it should be instantinouse, here is
    a snapshot of my vi. 
    please i need help.

    Hi Moho,
    Looking at your code I see a couple of things that might be causing the issue. How long is the delay that you are experiencing? You are trying to transfer 2000 bytes every loop which will cause some delay. You also have a lot of mathematical operations that can take time between loop iterations. Also what is the VI that you have manipulating your waveform? Have you looked into the PID VIs?
    Scott B.
    AE NI

  • What is the difference between buffered acquisition and non buffered acquisition?

    What is the difference between buffered acquisition and non buffered acquisition? How will I decide whether I want buffered acquisition or non buffered acquisition?

    I will also add that with non buffered acquisition you have to use software timing. Windows is not a real time OS, so the the timing is not accurate. But if you use buffered acquisition the timing will be controlled with an accurate internal clock on the Daq unit. I think non buffered acquisition should be avoided in most cases.
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Shared Variables for Real-TIme Robot Control

    I'm really stuck in my efforts to use LV real-time in my hardware control application. I have a 6-axis industrial robot arm that I must control programmatically from my PC. To do this I've developed a dynamic link library of functions for various robot control commands that I can call using Code Interface Nodes in LV (using 8.5). This has worked great, that is, until I tried to port parts of the application to a real-time controller. As it turns out, because the robot control dll is linked with and relies so heavily upon several Windows libraries, it is not compatible with use on a RT target, as verified by the the "DLL Checker" application I downloaded from the NI site. When the robot is not actually executing movements, I am constantly reading/writing analog and digital I/O from various sensors, etc.....
    This seemed to suggest that I should simply segregate my robot commands from the I/O activities, using my host PC for the former, and my deterministic RT loop on the target machine for the latter. I set up a Robot Controller Server (RCS) vi running on my host PC that is continuously looking for (in a timed loop) a flag (a boolean) to initiate a robot movement command. Because several parameters are used to specify the robot movement, I created a custom control cluster (which includes the boolean variable) that I then used to make a Network Shared Variable that can be updated by either the RT target or the host PC running the RCS. I chose NOT to use buffering, and FIFO is not available with shared variables based on custom controls.
    Here's sequence of events I'd like to accomplish:
    1) on my host PC I deploy the RCS, which continuously pools a boolean variable in the control cluster that would indicate the robot should move. The shared variable cluster is initialized in the RBS and the timed loop begins.
    2) I deploy the RT vi, which should set the boolean flag in the control cluster, then update the shared variable cluster.
    3) an instance of the control cluster node in the RCS should update, thereby initiating a sequence of events in a case structure. (this happens on some occassions, but very few)
    4) robot movement commands are executed, after which the boolean in the control cluster is set back to its original value.
    5) the RT vi (which is polling in a loop) should see this latest change in the boolean as a loop stop condition and continue with the RT vi execution.
    With the robot controller running in a timed loop, it occassionally "sees" and responds to a change of value in members of the shared variable cluster, but most times it does not. Furthermore, when the robot controller vi tries to trigger that the movement has completed by changing a boolean in the control cluster, the RT vi never sees it and does not respond.
    1) Bad or inappropriate use of network shared variables?
    2) a racing issue?
    3) slow network?
    4) should I buffer the control cluster?
    5) a limitation of a custom control?
    6) too many readers/writers?
    7) should I change some control cluster nodes to relative, rather than absolute?
    8) why can't I "compile" my RT vi into an executable?
    Any help would be greatly appreciated. Unfortunately, I'm writing this from home and cannot attach vi files or pictures, but would be happy to do so at work tomorrow. I'm counting on the collective genius in the universe of LV users and veterans to save my bacon.....
    David

    Hi David,
    I'm curious why you decided to build a CIN instead of developing the code in
    LabVIEW.  Is there some functionality that that LabVIEW couldn't
    provide?  Can you provide some more information about the LabVIEW
    Real-Time target you're using?  What type of IO are you using?
    It is impossible to get LabVIEW Real-Time performance on a desktop PC running
    an OS other than LabVIEW Real-Time.  Even running a timed loop in LabVIEW
    for Windows won't guarantee a jitter free application.  Also, no TCP based
    network communication can be deterministic.  This means Network Shared
    Variables are also not deterministic (they use a TCP for data transport) and I
    advise against using them as a means to send time critical control data between
    a Windows host and a LabVIEW Real-Time application.
    In general, I would architect most LabVIEW-based control applications as
    follows:
    - Write all control logic and IO operations in LabVIEW Real-Time.  The
    LabVIEW Real-Time application would accept set points and/or commands from the
    'host' (desktop PC).  The Real-Time controller should be capable of
    running independently or automatically shutting down safely if communication to
    the PC is lost.
    - Write a front-end user interface in LabVIEW that runs on the desktop
    PC.  Use Shared Variables with the RT-FIFO option enabled to send new set
    points and/or commands to the LabVIEW Real-Time target.
    Shared variable buffering and RT-FIFOs can be a little confusing.  Granted
    not all control applications are the same, but I generally recommend against
    using buffering in control applications and in LabVIEW Real-Time applications
    recommend using the RT-FIFO option.  Here's why:  Imagine you have a
    Real-Time application with two timed loops.  Time-loop 'A' calculates the
    time critical control parameters that get written to hardware output in
    timed-loop 'B'.  Loop 'A' writes the outputs to a RT-FIFO enabled variable
    with a RT-FIFO length of 50.  Loop 'B' reads the outputs from the shared
    variable, but for some reason, if loop 'B' gets behind then the shared variable
    RT-FIFO will now contain several extra elements.  Unless loop 'b' runs
    extra fast to empty the RT-FIFO, loop 'B' will now start outputting values that
    it should have output on previous cycles.  The actual desired behavior is
    that loop 'B' should output the most recent control settings, which means you
    should turn off buffering and set the RT-FIFO length to 1.
    There is also a clear distinction between buffering and the RT-FIFO
    option.  The RT-FIFO option is used to add a non-blocking layer between
    network communication and time-critical code in LabVIEW Real-Time
    applications.  It also provides a safe mechanism to share data between two
    loops running in a Real-Time application without introducing unnecessary
    jitter.  Network buffering is a feature that allows a client to receive
    data change updates from the server even if the client is reading the variable
    slower than the server is writing to it.  In the example I presented above
    you don't need to enable networking because the shared variable is used
    entirely within the Real-Time application.  However, it would be
    appropriate to send control set points from a Windows PC to the Real-Time
    application using network published shared variables with the RT-FIFO option
    enabled.  If it is critical that the Real-Time application executed all
    commands in the sequence they were sent then you could enable an appropriate
    buffer.  If the control application only needs the latest set point
    setting from the Windows host then you can safely disable network buffering
    (but you should still enable the RT-FIFO option with a length of 1 element.)
    Network buffering is especially good if the writer is 'bursty' and the reading
    rate is relatively constant. In the robot application I can imagine buffering
    would be useful if you wanted to send a sequence of timed movements to the
    Real-Time controller using a cluster of timestamp and set point.  In this
    case, you may write the sequence values to the variable very quickly, but the
    Real-Time controller would read the set points out as it proceeded through the movements.
    The following document presents a good overview of shared variable
    options:  http://zone.ni.com/devzone/cda/tut/p/id/4679
    -Nick
    LabVIEW R&D
    ~~

  • Real-Time Sequencer Feedback and Questions

    Post your questions and feedback to the Real-Time Sequencer Architecture and Real-Time Sequencer Architecture Example here.
    Brian K.

    I just purchased the USB 6341 DAQ card. I am using Dev1/.Port1 to control 4 driver transistors. The transistors fire 4 SSR. I am trying to create a sequence for the 4 transistors. Sometimes a test unit that is driven by a SSR will fail. So I have to change the sequence for the failed DUT.
    Basically each SSR will be ON for 6 seconds. There will be a delay of about 5.75 seconds for the next valve to fire. The delay is used to balance the pressure testing. The second valve will need to start at 5.75 seconds later. Basically the two valves must cross at the 50 % turn OFF. How can I perform this task. There are at least 7 different test sequences??
    Thanks,
    Philip 

  • I want to be able to tweak the graphic equalizer in real time while recording - and have this have the audible effect written to the recording.   At the moment i have to go into post-production and manually set the graph equalizer at various time points .

    i want to be able to tweak the graphic equalizer in real time while recording - and have this have the audible effect written to the recording.
    At the moment i have to go into post-production and manually set the graph equalizer at various time points ...

    This won't be real-time as you record, but you could tweak the EQ in real-time after the recording thus:
    Record what you want to tweak into GB with no effects.
    Solo the track and output it into something like Audacity.
    Start Audacity recording, then play your track in GB as you make those tweaks. That's what Audacity will record.
    Get that file from Audacity and put it into GB, then you'll have that effect.
    Sorry if it's complicated, but that's what came to mind. Hope it works.

  • Any real time complex validations and assignments

    Hi frds,
    Any one can share few real time complex validations and Assignments on product object?
    Thanks in advance
    Regards.

    Rajeev,
    I do not have real time validation exaples. There are couple of blogs on SDN
    search for
    MDM Expression Engine
    (the document name is MDM Express Engine: Validations,Assignments and More)
    Parsing and Validating Numbers
    (used for check digits but gives more insight on writing validations.)
    I hope this helps
    Regards
    Bala Pochareddy

  • I'm having problems with 8.1 and Continuity / Handoff. It will work fine for web pages, etc. but in email when I try to do it between by iPhone 5s running 8.1 and my Macbook Pro running Yosemite I consistently get an error.

    I'm having problems with 8.1 and Continuity / Handoff. It will work fine for web pages, etc. but in email when I try to do it between by iPhone 5s running 8.1 and my Macbook Pro running Yosemite I consistently get an error. "Failed to Continue Activity" Cocoa Error 4609.  Handoff is working for phone calls and text messages. By email just crashes each time. It was also doing it under 8.0.2.  My iPhone and iPad handle this fine. It's only the MacBook to the iPhone that fails, and only on email.

    Handoff Continuity Troubleshooting

  • HT1414 my ipad with retina eye updated to IOs 7 not able to boot ....the normal way of pressing the sleep/wake button and the  home button does'nt work....any ideas i think that IOs 7 is a crap cos form the time i loaded it it was shaky...now my ipad is d

    my ipad with retina eye updated to IOs 7 not able to boot ....the normal way of pressing the sleep/wake button and the  home button does'nt work....any ideas i think that IOs 7 is a crap cos form the time i loaded it it was shaky...now my ipad is dead

    If it is one year old minus one day it is still under warranty. If it is more than a year since you purchased it then yes, the warranty has expired.
    Millions of iPads have been sold. Most continue to function long after their warranty has expired. Check the many requests about updating the iOS on the original iPad on these forums and you'll see that there are many iPads still working after three years. My iPad 2, which I had for over two years is still working well for my son in law who took it over from me when I bought a new one.
    Given that there will always be a few iPads that fail early. Most of those will be covered under warranty. But some will fail after the warranty has expired and before the owner expected it to. I'm sorry to hear that you are in this category. Take your iPad to an Apple store and have it looked at. They will provide you with alternatives, one of which is to purchase a like model to the one that failed at a discount. You can then know your options and make the best choice for you.

  • I have a mac book pro i7 2.00Ghz and 4Gb RAM. I want to run at the same time Omnisphere,Trilian and BFD 2. Will it work fine? Anybody that has some experience? Thanks

    I have a mac book pro i7 2.00Ghz and 4Gb RAM. I want to run at the same time Omnisphere,Trilian and BFD 2. Will it work fine? Anybody that has some experience? Thanks

    Well this is not a problem I have already bought one, my great worry is the processor and the memory..

  • Why does Adobe sendnow work and the newest and greatest Adobe Send does not work?

    Why does Adobe sendnow work and the newest and greatest Adobe Send does not work? I wasted about 8 hours on trying to get Adobe Send to upload 269 files that amounted to 469MB. When it did not work I made a zip file and after a lot of wasted run time that did not work. The first situation gives little indication of when a file is loaded compared to Adobe SendNow. In both cases with Send it failed with a message like only the first 50 can be loaded. When I went and looked none of them had been loaded. With the zip file (I wanted to hide the individual files so they would not be counted) it appeared to work but very slowly and finally said it was done and I went and looked and it had done anything for oever 2 hours except a false "I'm runninng" indication.
    Thus, I took a chance with Adobe SendNow and it works great. It never gave me a limit on the amount of files nor on the size of the complete job. It shows me one file at a time when it has finished with the file uploading it. SendNow has never given me any problems.
    Why woiuld you want to change the program from SendNow to Send without the newest program being the best, fastest, user friendly program of the two? It just doesn't make sense to me. I suggest that Adobe keep SendNow working until Send is fixed. I would also suggest that SendNow and how it looks be kept, called Send, then modify Send one thing at a time until you get it to the point you need it to be for Acrobat. I have heard nothing good and now I have experienced it that Send is a piece of junk. I wasted most of my work day on giving Adobe the benefit of the doubt to find out I made a very bad decision to trust Adobe to make good decisions on the transfer of a function to another place .... both Adobe's responsibility.without making it painless for your customers that totally rely on you. Don't throw away customer confidence as it is very hard to get it back.

    Funny how you answer to "troll". (What's your handle on AT&T forums?)
    Yep! Verizon living up to it's contractual obligations by not releasing updates. Caveat emptor!
    I think there are some reasonable expectations here to keep customer's happy. When one carrier offers upgrades there is an expectation the same will happen across all the carriers. We have seen that except Big Red.
    Verizon could have said the update is in MS court months ago and stilled the voice of the disgruntled, or at least redirected it, but instead chose to be silent. Not for market share but for partial blame I think.
    We will have to agree to disagree since you only see Terms & Conditions and I, see customer satisfaction.

  • I have the iphone 5 and my lock button does not work. Can apple fix it or give me a new one. Can they still give me a new one even if I didn't buy my iphone 5 from them I bought it from verizon

    I have the iphone 5 and my lock button does not work. Can apple fix it or give me a new one. Can they still give me a new one even if I didn't buy my iphone 5 from them I bought it from verizon

    Alread asked and answered in your previous post - please do not post the same thing multiple times in multiple forums.
    https://discussions.apple.com/thread/5164919

  • When I open firefox before connecting (via 56k modem) or if I leave a previous section open, disconnect and then reconnect, firfox does not work, it remains offline, even though internet is connected. I have to close firefox and reopen

    When I open firefox before connecting (via 56k modem) or if I leave a previous section open, disconnect and then reconnect, firfox does not work, it remains offline, even though internet is connected. I have to close firefox and reopen

    Thanks for the reply. I never get the option to "Restore Previous History" from History. I don't even have the box checked that asks to delete the history when Firefox closes. I don't know what's wrong, no matter what, I always lose everything. I have the box marked "Show my windows and tabs from last time" for when I open Firefox, but it never shows that, just my homepage. Also, when I check my History, it only shows the pages that I opened since I started Firefox, nothing from before. Even if I were to open up 10 pages now, close Firefox, and open it, the history would only show the homepage that opened this time, not any of the 10 pages that I opened 5 minutes ago.

  • HT204135 I update my Mac to version 10.9.2 and now my printer does not work anymore. I did all the software updates and I do not understand why my mac does not recognize the printer anymore?

    I update my Mac to version 10.9.2 and now my printer does not work anymore. I did all the software updates and I do not understand why my mac does not recognize the printer anymore?

    Go to the website of the manufacturer of your printer and check to see if they have released an updated driver for your particular model.

Maybe you are looking for

  • One usb port does not work

    one of my usb ports is fine the other will charge but not transfer any data.

  • IPhone isn't showing up in My Devices on "Find my iPhone" page

    I recently lost my iPhone 4 at an airport (or on the plane). When I first got the phone, I installed the Find my Phone app connected through MobileMe, though I don't think it was installed at the time of losing it. Fast forward to now... I've logged

  • MB.ACT light OFF --- after Solaris 9 recommended patch cluster applied

    After applying the recommended patch cluster to several SunFire V210s/V240s the "system ready" or "activity" light on the front panel no longer illuminates. The systems come up fine and are fully functional, just no light. While this has absolutely n

  • File Uploading in JSF

    I am facing problem with File Uploding. :(( Could you please provide me some pointers for this. If possible detailed example is good for me as I am new to JSF I know how to use Jakartas File Upload Component. Can you provide me some pointers regardin

  • I wrote this code and it doen't work.

    public void deletePersonMethod(String pAction, String pPoHeaderId) 42--> Row row[] = pervo.getAllRowsInRange(); for(int i=0; i<row.length ; i++) SantoshVORowImpl rowi =(SantoshVORowImpl)row; if(rowi.getPoHeaderId().toString().equals(pPoHeaderId)) row