Feedback using analog input to control digital output

Hi all,
I've got a program that I intended to open and close two valves (and thus actuate two pneumatic cylinders) based on the readings from load cells mounted to each cylinder. The idea was that it would send a digital out to open the valve and extend a cylinder, then close the valve when the load reaches a pre-determined value (with frequency dictated by increasing or decreasing the inlet air pressure and thus the fill time of the cylinder). It would then do so for the other cylinder in a loop. The issue I have is that the response time of the loop actuating the valves was too slow-for a desired force of 1800 N I had to set the limit to 1100 Newtons. It was nice and consistent in this regard but then I started having instances where the valve would stay open long enough to apply a force of 3600+ N. The biggest need in this program is to maintain a consistent load and ensure that the max. load is not being exceeded. I've used local variables and a queue to pass the load values to the valve actuation loop but it did not seem to make a difference. I don't know if part of my problem is the mishmash of data types I'm using in passing the load cell values or if a notifier would be a better bet.
Attached is my code (LV 8.2). Thanks in advance if anyone can offer some guidance.
Attachments:
Controlled_valves.vi ‏192 KB

Here's a version in LV 8.0 and an image of the block diagram, for those running older versions of LabView.
I'd greatly appreciate any help anyone might provide as I'm getting killed here. Thanks!
Attachments:
Controlled_valves.vi ‏207 KB
Block diagram.JPG ‏177 KB

Similar Messages

  • Is there and easy way for Position control using analog input?

    Hi Everyone,
    I would like to set one of the axis with stepper motor using analog feedback to keep the set position which is coming from the analog input.
    In other words I would like the stepper to move when the analog input changes. I need it as a "background service" so the rest of the motion could be easily controlled from the NI-Motion Assistant.
    Is there any easy way to do this? Even complicated is ok but the control should be done by the NI Motion card not the PC processor.
    Thanks,
    Andras

    Hello Andras,
    please use the link below to get the motion example.
    http://zone.ni.com/devzone/cda/epd/p/id/353
    Kind regards,
    Elmar

  • Using mathscript to generate multiple digital outputs for switch control

    Hello 
    I am new to this NI LV and a have kind of a basic question. I would like to use Mathscript to generate an array of bolean numbers which will be used to control the Digital I/O lines. I am using NI 6251 USB device and the Mathscript code runs well. But I have a problem using this array to control the Digital output. So I created a simple test programme where I set the DAQ assitant to generate 4 digital outputs(P0.0 ~ P0.3) and it gives error that  ".. number of channels in the data does not match the number of channels in the task..." (see attachment) . How can I solve this problem thank you.
    Attachments:
    K-9.jpg ‏36 KB

    looks like you did not initialize all 4 of the elements in the bool array....

  • Using LabVIEW to simulatenously control 256 Outputs on FPGA

    Hello,
    I am a first year graduate student classically thrown into learning LabVIEW, so I would much appreciate some help with the code I am trying to work out. To give you an idea I started watching the tutorials on creating loops in February. For reference I am on LabVIEW 2014 and using a CRio-9066 with 8 modules and 256 total digital outputs.
    The goal of the code is to 1) generate on/off times for the state of the outputs on the FPGA VI and 2) to communicate this with the FPGA VI in real time. The reason the code is on a computer VI and not contained on the FPGA is because I need to use a normal distrbution function (which has inputs mean and standard deviation and outputs a value accordingly) to determine the timing. This is easily achieved on the computer, but not so easily achieved on the FPGA interface. It is essential that each output follows it's own unique timing function for my purposes.
    The way the code works is that each output has it's own while loop containing a two-frame timed loop (see attached.) A sub-VI I made (with a sun icon, see attached) outputs a timing value each time it is called, and this value delays the next iteration and during this delay sets the value of the local variable as true or false (on or off.) The state of the local variable is continuously communicated with the FPGA VI using a read/write control elsewhere in the program. The FPGA VI itself is a very simple VI which has boolean switches attached to each desired output.
    This code works very well for 128 outputs. However, when I try to use it for all 256 outputs it does not work. The VI does not report any errors, however about half of the loops are apparently not executing. My suspicion was that there is a limit to the number of processors that can be simultaneously utilized to execute loops in a VI, so I split the VI into two parts, each with 128 outputs communicating with the same FPGA VI. Again, I had the same issue. I am not sure if this is due to processor overuse or UI latency in labview (since the front panel is rather cumbersome.) Any suggestions would be greatly appreciated.
    One thought I had to work around this is to create a VI which generates timing values and stores them in an array. Then I could create a simple VI on the FPGA which reads these values and assigns a true or false state to the output accordingly. However, when I pasted the array into the FPGA VI I was returned the following error: "The FPGA module does not support variable-sized array on the front panel of the top-level VI." Any suggestions for working around this would be greatly appreciated as well.
    Any thoughts, comments or insight would be greatly appreciated. I am new to this so I realize my code is probably inefficient and such, so any tips would be awesome. Thank you.
    Attachments:
    Timing_Loop.PNG ‏15 KB
    FPGA_error.PNG ‏116 KB

    For the array error, check out: http://zone.ni.com/reference/en-XX/help/371599H-01/lvfpgahelp/creating_fixedsize_arrays/  Do you understand why a variable sized array causes problems with FPGA fabric?
    You're right about loops on either the RT side of your cRIO or your computer requiring cores and that cores might have to share threads if you have too many loops.  Loops on the FPGA itself will be routed otherwise.
    When you say computer, are you talking about the PC or the RT side of your cRIO?  Is there a reason you've got locals all over the place instead of shared variables?  Are the values meant to stay with the PC only or shared to the FPGA/RT?

  • Use analog input as sample clock

    Hi,
        I have a PCI 6115 DAQ card. I currently perform an
    analog acquisition on ai0, with an external clock on PFI7. But
    sometimes, my clock signal is not high enough and the acquisition does
    not occur. At some NI show, I heard a trick to solve this problem :
    plug the clock on analog input (say ai1), the clock signal gets
    amplified by the card internal amplifiers, and then route this
    amplified signal to the sampling clock. This seems to be a wonderfull
    solution, but I cannot find out to actually redirect the amplified ao1
    to the sampling clock. Does someone know how to do it ?
    Thanks a lot,
    Jérôme Lodewyck

    I tested the attached example on a simulated device so hopefully it will work on a real one without any kinks.  You didn't specify your programming environment, so I'm assuming you're using LabVIEW.  If not, hopefully you can translate to the appropriate ADE based on the picture of the block diagram. 
    In the example, I'm using an AO task to program the analog trigger as specified.  This has two consequences.  First, you won't be able to perform hardware timed AO while the AI acquisition is running.  If this isn't acceptable, you'll need to try the second approach described in the next paragraph.  Second, you'll have to wire the signal to PFI0 instead of an AI channel.  With this configuration, the signal will be seen with a +/- 10V range and referenced to AI Gnd.  Since the trigger DAC is an 8 bit comparator circuit for this board, you'll have ~80 mV of resolution.  You didn't mention what the amplitude or DC offset (if any) of your signal is, but hopefully this resolution will suffice.  You can use the level and hysteresis properties for the analog trigger to filter out noise in the analog signal or account for DC offset. 
    If the constraints listed above aren't to your liking, you can try to use a second AI channel as a trigger channel.  This has some advantages and disadvantages.  The disadvantages are that this requires you to use a trigger with your AI task and it also requires you to acquire another channel of data.  You mentioned the trigger wasn't a problem so this can probably be taken care of with simple analog start trigger.  The data can easily be thrown away, but depending on your sampling rates, it might require a lot of extra bus bandwidth or processing power when scaling the data.  On the positive side, it doesn't require you to use up your AO channels needlessly and you can apply gain to the input signal in order to effectively increase the resolution of the trigger circuit.  You can also apply a low pass filter and different terminal configuration if desired.  The gain, coupling, terminal configuration, filtering, and coupling applied to the signal is controlled by the values used in the Create Channel VI and the Channel Property node.  To create an example that does this, simply start with one of the shipping examples for an Analog Start trigger, change the trigger source to one of the AI channels instead of a PFI or APFI pin, and change the clock source to the AnalogComparisonEvent as shown in the attached example. 
    That should do it.  Good luck with your application and post back if you have additional troubles.
    Attachments:
    AI - External Clock Using Analog Trigger Circuit.vi ‏81 KB
    AI - External Clock Using Analog Trigger Circuit.JPG ‏60 KB

  • Microseconds delay to control digital outputs in WSN-3202

    Hi,
    I’m using the LabVIEW WSN Module to control the digital outputs of the WSN-3202 node. Is there a way to add a microseconds delay in my flat sequence structure? Because I’m using a pulse driven optical sensor which requires delays intervals in microseconds.
    Thanks,
    Ahmed

    Hi Ahmed,
    The availability of a microsecond resolution for timing depends on the onboard clocks or setup that the system allows. These nodes are often used to control/acquire in a non-continuous way to save battery. Therefore, they are required to wake/sleep in cycles that take a couple of minutes generally. What are you exactly trying to do with the node?

  • Newbie, Would like to use analog input and graph

    I was using the "Real Time Chart.vi" example in Labview 2011 and got it all set up using the random input it comes with. I have a USB-6008 that is set up and I can see the signal in MAX. The big question is how the heck do I get the vi to work with the analog input? If someone could modify the vi and add the AI0 as the input I would really appricate it!!
    Thanks
    Attachments:
    Soil Moisture.vi ‏15 KB

    trimixdiver1 wrote:
    Aside from me adding the gage and bar graph, its the same as the example. Ive added the AI (purple) channel but I guess I need to add some Daqmx stuff to allow it to connect to the strip chart.
    Wheres the analog in channel?  Is this something you haven't posted yet?  Make your changes, then post when you are ready.
    Reese, (former CLAD, future CLD)
    Some people call me the Space Cowboy!
    Some call me the gangster of love.
    Some people call me MoReese!
    ...I'm right here baby, right here, right here, right here at home

  • 2 analog input and 1 digital

    hi,
    i attach the vi..
    in the following vi i have a problem with the analogs..
    when i'm running the vi.. At the results.. olly one of the analog will show me the measuerements..
    at the one time maybe the clock analog will give me the results..
    and the other analog nothing.. and opposites..
    why they don't work together? and and the 2 analog give measurements at the same time..
    andrikos
    Attachments:
    2_analog_and_digital_inputs.vi ‏190 KB

    Hello Andrikoscy,
    For most multi-function DAQ boards what you're trying to do is not possible.  If you want each analog input to run on a different sample clock then you'll need to look into a NI R Series Intelligent Data Acquisition Device.  These DAQ boards have a built in FPGA and allow for more customization than M Series boards, including independent sample clocks.
    To address your questions:
    1.  On a non-intelligent DAQ board all analog input channels must share the same sample clock--if you need two different rates I would suggest sampling both channels at the faster of the two frequencies and then just ignore some of the data points on the slower channel.
    2.  In order to find out the exact time between samples from an external trigger (instead of the constant dt inserted by the waveform acquisition), you will need to take a period or frequency measurement of your signal using a counter on your card.  By taking a buffered period measurement you will get an array of the times between samples and with that you can graph your samples on a precise x-axis.  Normal analog input tasks that use an external clock do not associate any exact timing information with when a trigger was received.
    I hope this helps, and if you'd like more information on the R Series Intelligent Data Acquisition Devices please feel free to contact National Instruments directly at www.ni.com/contact.
    Have a great day!
    Brooks

  • Error -200072 using analog input with 3 PXI 6120 cards on realtime mx system

    I have just upgraded to the mx drivers for the 6120 S series boards.
    I am trying to sample 12 analog inputs at once with a pretrigger. (4 channels per board)
    The error message -200072 comes up.
    One board works fine, when I add the second board's channels the error occurs.
    Each board shows up as A,B,C respectively in MAX and in the Labview browse menu for selecting channels.
    Greg Morningstar
    Takata

    Probably the best way to do this would simply be to use the Route Signal VI to make it to where each of your boards looks at a particular line for the trigger. You can do the same thing for the clock so that they are all sampling at the same time.
    You will also want to make sure that your device is defined in MAX. Once you do that, everything should be pretty easy to implement. You might also want to look at some of the examples that show how to do RTSI. It's almost the same as you would do for a PXI system.
    Otis
    Training and Certification
    Product Support Engineer
    National Instruments

  • Measuring mV using analog input

    I am using an analog input of a Ni-DAQ 6025E card. I can measure a 5V signal. If it is 5V on the voltmeter, then it is 5V on the graph of amplitude Vs time. However a 0.5V signals comes as an oscilating signal of between o and 1.5V. Do I need to calibrate the graph? If so, how do I do that?

    Hi labview1958,
    I would recommend doing what LV_Pro recommended and try using the device in Measurement and Automation Explorer (Start > All Programs > National Instruments > Measurement and Automation Explorer). 
    First test the device there (by using a test panel) and see if you are
    getting the measurements that you are expecting. 
    I would also check out some of the related pages here to see if you can get some information that might help you better develop your system.
    The program that was posted will probably work, but it's not really the best way to do what you are trying to do. 
    If you have LabVIEW 7.0 or higher then you can use DAQmx which is much
    easier to use for new users.  I recommend that you simply use the
    DAQ Assistant Express VI to configure your system.  You can access
    that by going into your Block Diagram on a New VI, right click and go
    to Functions > Input > DAQ Assistant.  You can now
    quickly configure your measurements exactly as you like, test the way
    it functions and then use those signals in your application.
    Best of luck getting this together,
    Otis
    Training and Certification
    Product Support Engineer
    National Instruments

  • No Center/Sub from Audigy using Klipsch Promedia 5.1 (analog) - NOT a CMSS/digital output qu

    <FONT face=Garamond>I am receiving no center/sub output from my Audigy Platinum card. I have had the card installed on the same system (P4 3.0/ASUS P4800 Mobo/Win XP Pro SP2) for a couple of years with no problems. I recently began experiencing intermittent loss of my center/sub channel. Since I have not changed the connections in quite some time, I was able to rule out an improper output connection. Also, I was able to independently test the speakers themselves and the center and sub are both functioning. Additionally, I switched my Klipsch volume/channel output controller to headphone mode and ran the Creative Speaker diagnostic and I hear four channels (FR/FL/RR/RL) in the headphones (as I do with my front and rear speakers) but I <EM>do not</EM> receive any signal for the center channel (i.e., no "center channel" speech signal). Based on all of the above, I am certain that the speakers are functioning correctly (I am of course using them in analogue mode), there is no "switch" on the rear of the subwoofer for 2/2., all of my Creative and windows software are configured for 5. audio. I have uninstalled and reinstalled all of the creative drivers and software (using Driver Cleaner Pro in Windows Safe Mode) and reinstalled from my original Audigy CD and then performed a complete Auto Update from the Soundblaster.com site. <Still no center/sub even in diagnostic test!!!!
    <FONT face=Garamond color=#ff0000 size=4>
    I want to be clear: I am not confused about CMSS 5. gaming/audio issues; I believe this is purely a soundcard output issue. Despite all the grousing I read about the Creative driver series, I have been most happy with the Audigy Plat card. It has performed extremely well with the Klipsch 5. in gaming, DVD, and audio contexts for several years through numerous driver updates. I know how to configure the settings to get true 5. in any context. However, now I am completely stumped. Is there anything I have overlooked or might try so I do not have to conclude that this great card has just "crapped out" and now needs to be replaced?
    Thanks for listening.
    Message Edited by whander on <SPAN class=date_text>0-23-2005 <SPAN class=time_text>06:26 AM
    Message Edited by whander on 0-23-2005 06:30 AM

    <SPAN>Thank you! I had my digital coax connected there with an adapter, but since that can only carry ac-3 and stereo signals im better of using direct 5 chan ( i don?t watch movies on my PC... that?s what the home theater is for) Most games use EAX or some other direct sound, so ill stick with 5. direct analog. who would have thought the digital jack was also for center/sub heh.
    <SPAN>
    <SPAN>Thanks again man!

  • Using user input to control while loop

    Hi! I'd like to use a user specified value to terminate my while loop. For example, acquire for 3 seconds as opposed to acquiring until the user hits the 'stop' button. I've attatchted my code and would appriciate if you could give me some suggestions.
    Thanks,
    Katie
    Attachments:
    Acq_on_3_Channels.vi ‏463 KB

    Replace "Wait Until Next ms Multiple" with Timeout.vi. The example shows how to use this vi.
    Because the duration is given by software, it will not be very accurate. Anyway, it can not be more accurate then the cycle time. If you reduce the cycle time in order to get a better precision, then the CPU usage will increase.
    If you need a higher precision, then it will be necessary to use a hardware timing. This can easily be done be using an additional counter that is configured to generate a pulse on its output. This pulse is then used to gate the 3 other counters. This allows a very high and repetitive precision (period of the internal timebase of the counter)!
    Attachments:
    Example_with_timeout.llb ‏28 KB

  • Encoder edge counter using analog input

    I have using an 9215A USB (4AI).
    2 AI are logging data in to a txt-file and the other 2AI will be used for counting the edges from a quadrature encoder (A and B pulse train).
    Every edge falling or rising I will write a line in the txt-file also show a egde counter in the VI (total edges read).
    I'm a beginner so I need some help to find out how to do.
    BR
    Johan

    the 9215A do 20kSam/s  , that not too much, so .... your encoder should change state 10k/s max.
    first approach: continious read  (with max speed) with two buffers, while one buffer is filled by the DAQ, analyse the data of the other. Three independend loops : first wait for and read buffer-> send data via queue to second analyse loop -> send data via second queue to third loop that does the file handling.
    second approach: create a trigger so the second loop can be avoided. The DAQmx/Hardware does  might not support the trigger on both edges on two channels, but additional hardware like LS7084 o. HCTL2022 can help you to create the trigger signal. These little bugs are designed for incremental encoders and create a pulse for every change in the A B lines
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

  • How to disable SP-DIF (digital) output on Audigy

    Hi, I am using Audigy 2 soundcard connected to Altec Lansing ADA885 speakers. These speakers have built-in Dolby Digital Decoder, and of course SPDIF input for this. Additionally, they have inputs for analog front and rear speakers signal. They can be switched to different operation modes : Dolby Digital decoding, Dolby ProLogic decoding, stereo, and quad modes. I have connected them to my Audigy 2 using analog connections, and also digital output. The problem is, that they process both kind of inputs (analog and digital) all the time in most modes simultaneously. For example, when I set them to "quad" mode (for gaming) they process analog signal that Audigy deli'vers them, but also they attempt to decode the signal from digital input. This produces some kind of phase distortions (basses dissappear and the sound becomes slightly muffled). Possible solutions could be : - disable digital decoding in speakers when using analog output from Audigy - this can't be done, these speakers' decoder is not configurable, - disconnect digital cable when using analog output from Audigy - obvious solution, however not very comfortable - disable "ON-DEMAND" spdif output on Audigy card and enable it when necessary. This would be most satisfying option for me. But.... is it possible at all ? Just something similar to the "Digital output only" setting in soundcard panel, but in my case i'd like to have an option of "Analog outputs only". Thanks in advance for any help Greetings, Martin

    Hi Terry,
    According to your description, my understanding is that you don’t want the yollow bar notification to display when you open Access documents.
    This issue seems to be about the client application. Please compare the followings with the things that you did:
     1.Open the documents
     2.Click File->Options->Trust Center->Trust Center Settings
     3.Click Protected View, unselect ‘Enable Protected View for originating from the Internet’
     4.Click Message Bar, select ‘Never show information about blocked content’
     5.Click Macro Settings, select ‘Disable all macros without notification’
    In addition, as this issue is about Office, I commend you create a new thread in Office forum, more experts will assist you with this issue.
    Office forum:
    http://social.technet.microsoft.com/Forums/en-US/home?category=officeitpro
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • How to use both digital and analog input modules in the same worksheet - MCC USB1208LS

    Dear all,
    Hi, I am Imran. I am using MCC USB1208LS. I have created the worksheet using digital input module as below and able to execute (run).
    But when i add another analog input module in the same worksheet and executes, An error Message pops-up as in the below image
    I have connected temperature sensor sognal to the analog input of USB1208LS. When using analog input alone in the worksheet, it indiates the actual values. 
    is any black box solve? please guide me. I am attaching in images
    We already placed a purchase order for USB1208FS. Will it sort out my issues?.
    Thanking you,
    Imran Mohamed.
    Attachments:
    present worksheet digital input only.JPG ‏67 KB
    with analog input module.JPG ‏81 KB
    error menu.JPG ‏77 KB

    Hello Imran,
    the USB-1208LS is not capable of running concurrent operations such as an analog input scan and ANY digital Ins, Outs, counter reads, or analog outs.  In Dasylab, the 1208LS is scanning, and nothing else from that particular device can be requested of it while that is happening.
    Yes, using the 1208FS will resolve some of these issues.
    Please refer to the ULHELP.CHM file installed on your computer in c:\program files\measurement computing\daq for details on this issue, et al.
    also I recommend you send your MCC/DASYLab requests for support to [email protected] as MCC staff (that includes me) does not normally monitor NI's Developer Zone.

Maybe you are looking for