Controlling Solenoid Valves for a water level application with LabVIEW:

Hello,
I am trying to control the water level in a tank using solenoid valves with LabVIEW.
I have an ultrasonic sensor that is going to measure the water level in the tank, I have the working VI (attached) for how the sensor measures the water level, I have made the vi so that it measures the distance the water level is away from the sensor (the sensor is attached to the top of the bucket). The vi which is attached also calculates the volume as more water is added into the bucket (the bucket is frustum shaped). 
What works: VI interacts with ultrasonic sensor. VI measures the distance the water level is away from the sensor, VI calculates the volume in the bucket as more water is added. 
What I am trying to do now: I want to have another bucket (filled with water) sitting above my bucket with the sensor on it, and with a solenoid valve attached to that bucket, and another bucket sitting below my bucket with the sensor on it (not filled with water). I want to interface these solenoid valves with LabVIEW in a way, that the user can enter in say "70%" as the desired percentage of water in the bucket with the sensor, and LabVIEW controls the the valve on the bucket to fill up the bucket with the sensor up to 70% and if there is any overshoot, there will be another valve attached to the bucket with the sensor that will let water out to go into the empty bucket).
Basically, turn on and off the valves based on how much more water needs to be added into the bucket and what the desired percentage is. 
The equipment that I have is:
Ultrasonic sensor: http://www.amazon.com/Ultrasonic-Module-HC-SR04-Distance-Arduino/dp/B004U8TOE6
Solenoid Valves: http://www.ebay.com/itm/ws/eBayISAPI.dll?ViewItem&item=290763981675&ssPageName=ADME:LU:US:3160
3 buckets.
I need some ideas on how I can complete the rest of this project. Thank you in advance! Please see the attached vi.
Attachments:
Sensor.vi ‏28 KB

Thinking off the top of my head, if it were me, I'd start with the master-slave design pattern.
In the master loop, put your vi for reading the level.
In the slave loop, put very simple logic that looks at the value coming from the notifier and takes one of three actions each time a notification is received:
If the level is greater than the setpoint (+some "empirically determined" hysteresis value, say 1-2%) open the valve to let water out of the middle bucket.
If the level is equal to the setpoint (+- the same hysteresis value) make sure both valves are closed.
If the level is less than the setpoint (-the same hysteresis value) open the valve to let water into the middle bucket.
Repeat until you're done.
You will probibly want to figure out a better way to stop things than what is shown in the design pattern template - using an error to stop works, but in the long run limits your options.
Oh yes, when shutting down, there is one thing that you will need to be sure that you do - to prevent wet feet. But I'll leave that for you to figure out as well.
Mike...
PS: This is homework right?
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Similar Messages

  • Control solenoid valves

    Hello All,
    I need to control 3 solenoid valves (MHP1-M1H-3/2o-M3-PI), using labview. The activation protocol is like this:
    valve1 On for 2 seconds, and then Off for 1 sencond, this should start with pressing a bottom and stop after specific number of on-off cycles (for example after 100 times on-off), again with bottom.
    valve 2 and 3 have the same protocol, but they should start after a 'delay=1 second' respectively after eachother. 
    Since I am a new user to Labview, could you please help me how I can programm these tasks.
     I have attached the task description.
    Thank you very much.

    Matin88 wrote:
    I need to control 3 solenoid valves (MHP1-M1H-3/2o-M3-PI), using labview. The activation protocol is like this:
    valve1 On for 2 seconds, and then Off for 1 sencond, this should start with pressing a bottom and stop after specific number of on-off cycles (for example after 100 times on-off), again with bottom
    valve 2 and 3 have the same protocol, but they should start after a 'delay=1 second' respectively after eachother. 
    Since I am a new user to Labview, could you please help me how I can programm these tasks.
     I have attached the task description.
    Thank you very much.
    You've forgot to attach the description. And why don;t you try something or atleast come up with a flowchart.
    You for trials, you can possibly use LED's on the front (representing the valves) as shown below.
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • Control solenoid valve

    I am a labview beginner. I try to use labview to control our gas permeation system. Firstly, labview acquire pressure data from PR4000 readout . When pressure is down to certain value then the data goes through NI 6501 I/O device then universal relay card to switch solenoid valve. Then labview coninue acquire pressure data from transducer .
    I hope somebody can give me some advice for writing this program. Or what kind of existing VI programe can I use to modify it?
    Thanks

    Howdy MYLONG!
    One of the best resources to find LabVIEW example programs is in the LabVIEW Example Finder.  You can access it in LabVIEW by going to Help>>Find Examples...
    For examples on outputting data to the NI 6501 I would recommend looking in the Hardware Input and Output>>DAQmx>>Digital Generation folder.
    If you are using serial communication to talk with your PR4000 then look in the Hardware Input and Output>>Serial folder for examples.
    Regards,

  • VI to control solenoid valves with NI 9472 and 9171

    Hello,
    I am working on a prototype composite manufacturing project wherein I am trying to connect four 24 VDC solenoid valves to a NI digital module 9472 with a USB DAQ Chassis 9171. The solenoids will be used to control several pneumatic air pistons. I have so far used NI Max and an NI example code "Digital - SW-Timed Output" to turn one valve on.
    Now I am looking for some help to build a VI accomplish following things:
    1. How do modify the existing VI to make it turn off the solenoid too. As the way I have it now is when I execude the code, the solenoid is continously on.
    2. If I connect 4 such solenoids, and want to turn them on in a pattern such as "TFFF,FTFF,FFTF,FFFT"?
    3. I would want to put a delay time between the 4 operations say 30 s, as a user input in the front panel.
    4. I want this whole operation to repeart "n" times, as another user input. 
    5. Last thing, any changes I make to the VI, and save it form File -> Save/Save as, it reverts back to the original version. I am working from the default NI system folder where all the examples for "Digital Output" are saved. Also whenever I try to copy it to another location, it wont run as it keeps on searching for the other accessory VIs. I have tried to save it as a project, but even that doesnot help. 
    I have enclosed screen grabs of the VI which works for one solenoid, and the original VI (it wont let me save the modified VI properly).
    I am very new to coding with NI, so any help/guidance will be greatly appreciated. Thanks.
    Vikram
     

    Hi vdey
    I hope you are doing great. Regarding your questions about the  digital outputs generation, I did my research using the same example of Digital -SW Ouput VI.
    I did not change anything of the code except for some few changes.
    Ok, first question
    Using this VI example I am able to control the outputs and when I used one of the booleans controls I am able to turn on and off the different outputs of the modules.
    Second question
    If you want to create an automatic pattern with the outputs of the module, I think you can use a array with Booleans premade it by you combined with a state machine.
    Third question.
    Again, with a state machine you can use a delay function and instead of using a constant for the input you can create a control for it.
    Fourth Question
    Maybe you can try with a  Foor loop with a control attached to the N terminal to control the times you want to do this action.
    Fifth Question
    Try to copy the folder where are located these examples and save this new folder in a new location and try to work over this new copy.
    I am attaching somes links that could be useful to you;
    Sintax of multiple channels
    http://digital.ni.com/public.nsf/allkb/9A2AF5E10E0C893386256FE8006807DF?OpenDocument
    Tutorial States Machines
    http://www.ni.com/tutorial/7595/en/
    Warm Regards.
     

  • Looking for software driver for HP 6655A Power Supply with Labview 5.1

    Hi, trying to control an HP 6655a Power Supply but the version of Labview in the PC is the old Labview 5.1.
    I don't want to upgrade it for fear that the program will no longer function. Does anyone have the driver for the HP6655a that will work with labview 5.1?

    Hi demo,
    Try the drivers directly from Agilent.
    Here is a couple of links:
    http://we.home.agilent.com/cgi-bin/bvpub/agilent/editorial/cp_MiscEditorial.jsp?OID=536913992&NAV_ID=-536891584.536882066.03&LANGUAGE_CODE=eng&COUNTRY_CODE=ZZ
    Click on> Driver: 665xA Series Instrument Drivers
    Maybe this one is better... it's older...
    http://we.home.agilent.com/cgi-bin/bvpub/agilent/editorial/cp_MiscEditorial.jsp?OID=536917365&NAV_ID=-536891585.536880265.03&LANGUAGE_CODE=eng&COUNTRY_CODE=ZZ
    Click On > Driver: DC Power Supply Instrument Driver (1.13 MB)
    You may have to import the instrument driver after you install the libraries. This is done by selecting from the pull down menu:
    Tools > Instrumentation > Import CVI Instrument Driver
    JLV

  • Cannot build application with labview 7.0

    I had built application previously using labview 6.X while some of the V.I. are without block diagrams, but I couldn't do that any more with labview 7.0 as a error will be prompted, why is this happening & are there difference in application builder between labview 7.0 and previous version? Must I load those V.I. without block diagrams dynamically now ?

    Unfortunately it is impossible to build application with newer version with VIs without block diagrams, which saved in oldest version.
    from ni web site:
    "National Instruments does not recommend saving VIs without block diagrams because LabVIEW needs the block diagram to recompile the VI after an upgrade. When you upgrade LabVIEW, you must find a version of the VI that includes its block diagram to recompile it. Such a version did exist before the block diagram was removed because it is impossible to create a new VI without a block diagram."
    "Based on that information, it should be clear that once a VI is saved without diagrams:
    You cannot open or run the VI on any other version of LabVIEW, older or newer."
    More information:
    http://digit
    al.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/00a6bacda1c01a0786256b60006163e7?OpenDocument
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/28c4cb0cf83e1a1d862566e2007a2a9c?OpenDocument
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/fee732f4b1541b9586256bf0006a78ca?OpenDocument
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/0649a3350de20aa186256d91007b3d61?OpenDocument

  • Can i build an application with Labview 2009 for Windows 7?

    Hello
    i use Labview 2009 SP1 and the application builder 2009 SP1. If i install the application on win7 this message is display:
    Labview Run Time Engine depends on pruduct with upgrade code (...) version 9.0.301, language {} which is not in distribution.
    Solved!
    Go to Solution.

    Is this an issue with Windows 7 having both installation folders for 32 bit (C:\Program Files (x86)) and 64 bit (C:\Program Files)?
    I had an application built on an XP machine and installed on a Windows 7 machine which was looking for files in C:\Program Files when they were actually installed in C:\Program Files (x86) - because it was 32-bit application.  After installation I had to move the files from 1 location to the other to make it work.

  • PC SERAIL INTERFACE FOR IV CURVE TRECER APPLICATION WITH MICROCONTROLLER

    DEAR
           I AM TRYING TO BUILD   IV CURVE TARACING APPLICATION USING MICROCONTROLLER CONNECTED WITH PC SERAIL PORT I HAVE STUDIED BASIC PC SERAIL PORT INTERFACING BUT HAVE NO IDEA ABOUT HOW TO DISPLAY AND LOG THESE DATA ON GRAPH AND SAVE ON  A FILE ON SPECIFIED FILE PATH ON PC AND HOW TO EXPORT THESE GRAPH TO BIT MAP OR ANY OTHER PICTURE FILE FORMAT AND WICH TYPE OF FILE FORMAT WOULD BE USED TO SEND TO PC FROM MICROCONTROLLER TO DATA DISPLAY

    First of all, please stop SHOUTING.
    It seems like there is a lot of stuff you are unsure about.  If you don't even know how to display data on a graph, then I think you need to take a step back and go through some of the basic LabVIEW tutorials located here.
    Perhaps these tutorials will help you get started:
    Graphs & Charts
    Serial Communication General Concepts

  • Developing web enabled applications with Labview 6.0

    can someone point me to some document or a good resource to learn to develop web enabled applications. Suppose I am controlling some hardware in my lab thru Labview. Can I make some application that would allow me to control it from web so that I dont have to be in the lab.
    Thanks,

    Search through examples under "Networking". There you will find all you need to get yourself started on internet applications.
    Also, search the NI website for internet applications, remote VI server, datasocket, and similar keywords. There will be application notes, articles, support documents and other resources on the website. There should also be similar documentation within LabVIEW help.
    Also, there should be some books out there that cove the topic.

  • How to control 8 current sources in the same time with labview?

    Hi,
    I'm a French student who have to create a program which is able to control 8 current sources in the same time.the aim is to plug the currents sources in the input of a laser.
    If someone has an idea, it would be very nice to inform me !!!
    Thanks in advance.
    Nico31dcu

    Is it really Tektronik or is it Tektronix. Tektronix is a major test equipment manufacturer. I can't find any reference to that model number on their site, though.
    There are several resources for learning instrument control. One good place to start is http://zone.ni.com/devzone/cda/tut/p/id/4357.
    Assuming that you have a NI GPIB controller for the pc, you will be using the Instrument I/O Assistant or the VISA commands to send/recieve data from the current sources. Without having access to the programming manual, I can't give specifics on what commands you need to send. Your topic mentions controlling them at the same time. Truly simultaneous control is possible in only a few situations. If you have a couple current sources in the same mainframe, you may be able to send a single command to set them all. It will really depend on the commands that the vendor has implemented. With separate mainframes, you will send commands first to one, and then another, etc. Again, depending on what the vendor has implemented, it may be possible to sequentially program all sources to a ready state and then trigger all simultaneously.

  • Multithreaded application with labview IMAQ & WinXP on Dual Core Processor

    Hi all,
    I am working on a multi-threaded vision application on a
    PC with the latest Core 2 Duo processor.  I have image data coming over
    two TCP sockets, and image processing using the IMAQ Vision libraries.
    I have managed to parallelize the image processing, TCP communication, and display functions.
    I
    have 2 Image processing loops, 2 TCP loops (one for each socket), a UI
    loop, and a display loop.  Inter-loop communication  is via 2 Q's and a
    few notifiers.
    The image processing and TCP VI's are all re-entrant.  The TCP and Image processing VI's are on different threads.
    I tried playing around with changing priorities on the VI's but it made things a bit worse.
    My questions are:
    1  Are dll calls to the IMAQ dll's re-entrant?  (probably not?)
    2  Can these dll calls be made re-entrant?  Would it make a difference?
    3  Any way to set two different instances of the same
    re-entrant VI on the diagram on DIFFERENT threads?
    3  Any other ways I can improve performance?
    Thanks for any insights!
    Neville.

    Hi Neville,
    If you doing image processing, then you are probably using VIs that call the NIVision DLL.  These calls are actually reentrant by default (calls made to the IMAQ DLL are also reentrant).  Having said that, remember that the image processing VIs, along with most VIs in the vi.lib folder, are not reentrant, making the DLL calls effectively non reentrant as well.  The reason for this is that, unless a VI takes a considerable amout of time to execute, running it as reentrant will often slow down performance due to the overhead involved in managing parallel execution.  I'm not sure if you have already tried this, but you may find that your program will run faster if you set your image processing VIs to be non reentrant.  I do not know of a way to run multiple instances of the same reentrant VI on different threads, but I will look into it, and I will let you know if I find something.  Another option would be to create copies of the VIs so that the functionality of each one is identical, but you are actually calling different .vi files.
    In general, it seems like the architecture of your program is very optimized with the parallel loops, queues, and notifiers that you are using.  I would recommend trying out non reentrant VIs to see if this speeds things up.  Please let me know if this is helpful.
    Chris
    Applicatoins Engineer
    National Instruments

  • How open an application with labview

    I need to open an application to use a camera and store data before using tis data in labview but i don't now how to call an app in a VI

    Look for "System Exec", it's in the Communications palette.
    LabVIEW Champion . Do more with less code and in less time .

  • Stand-Alone application with LabView 7.0 getting error can't find DAQmx clear task.vi

    I have attempted to create a stand alone vi with the Build Application or Shared Library(dll) in LabVeiw 7.0
    When I put it on another PC to test it I get the error "can't find DAQmx clear task.vi"
    the other PC has Labview 7.0 and DAQmx 8.1 also.
    I believe my problem is in the source tab where you are supposed to add support and dynamic vi's I have search the forums and Ni's data base and have not found a solution.
    Solved!
    Go to Solution.

    Hi LabTech09,
    When you run the executable on the other computer is when you get this error?  Do you have the exact same versions of LabVIEW and DAQmx on both computers?  Does the dialog allow you to navigate to the DAQmx clear task.vi?  If so, you can find these VIs in C:\Program Files\National Instruments\LabVIEW 7.0\vi.lib\DAQmx\configure\task.llb.  Does the executable work on the development machine (the machine it was compiled on)?
    Regards,
    Jim Schwartz

  • Can the M Series PCI 6221 control 24 VDC solenoid valves like the NI 9477?

    Hi,
    I am working on a project where three solenoid valves requiring 24 VDC and 8 Watts must be controlled by a PCI 6221 multifunction DAQ.
    I read on the NI website that an external power supply and the NI 9477 can be used together to actuate solenoid valves.  Since I already have the PCI 6221,
    I was wondering if an external power supply would allow the PCI 6221 to power the valves.
    Sincerely,
    Tristram Jordan

    Hey,
    Is there any way to control solenoid valves using the PCI 6221 DAQ card? Is it possible for the DAQ card to control a driver circuit for the valves?
    If there isn't an alternate way to control the valves, which DAQ do you recommend purchasing to control 3 solenoid valves and a pressure transducer?
    I am not familiar with the compactDAQ. Does the digital output module need to connect to a DAQ card within the computer? If not, how does it communicate with the computer?
    Sincerely,
    Tristram Jordan

  • "SSO" for non-sap web application using SAPGUI to browse?

    I have a web application (non SAP) and the user base are also SAP users in an ABAP system.
    To strengthen the authentication in the web app, I wanted to implement SSO 
    authentication as we pity the users for having to remember so many strong pw's and I
    dont like LDAP based pw sync or other technology I dont understand, because then we are
    just yet another application with the same pw...
    We are having technical problems implementing SSO on the web app side, and are anyway a
    bit sceptical about the user admin / role admin assignment if we get it to work.
    So I have created a transaction in SAP which browses the web app and the intention is to
    send the SAP sy-uname as the web app user. We can control this using s_tcode, and
    an own auth object on the WAS side and a check on the session type before the connection is
    established. In this sense we are dependent on the SAP concept implemented, but even so:
    The role assignment is controlled in the web app itself -> so assume that I am not overly
    worried about unauthorized access to the web application, as they would not have any
    system role for it as their sy-uname does not exist. (Infact we can monitor this)
    The browser on the front end is the SAPGUI with html controls on the SAP side.
    I would be interested in knowing whether anyone else has experience with this approach, and
    whether there are any areas to be carefull of?
    I would also like to know whether this is a strategic error?
    Kind regards,
    Julius

    Hi Julius,
    well, if that web application would run on the same ABAP backend system then the solution described in <a href="http://service.sap.com/~iron/fm/011000358700000431401997E/0612670">SAP Note 612670</a> would be applicable:
    a so-called "Re-entrance ticket" (based on the "SAP logon ticket" SSO proceedings) is issued, transported via the SAPGUI connection and back to the system via the invoked HTML control.
    But for non-SAP web applications that does not help.
    In that case only X.509 client certificates can be used for SSO. Actually, the web application could then also be invoked directly (independent from the SAPGUI session). The user is authenticated based on the X.509 client certificate - and not based on the ABAP userID (of the SAPGUI session).
    Well, if you don't mind the effort you could also use the "SAP Logon Ticket evaluation library" (sapssoext, see <a href="http://service.sap.com/~iron/fm/011000358700000431401997E/0304450">SAP Note 304450</a>) to evalute the SAP logon ticket externally. You'll then need to have a "stub application" at the ABAP side that triggers the http redirect to your external web application. Not a nice solution but a possible one.
    In the future SAML browser artifacts would be an option (preferable to integrate non-SAP applications). But currently that's not available (for NWAS ABAP).
    Cheers, Wolfgang

Maybe you are looking for

  • Just loading Windows XP Pro Sp2 on Sata Raid 0 for first time. Stuck at F6

    Hi Guys: Read Sake's guide and subsequent postings. A bit stuck here, created the diskette with Hyperion64 drivers but not sure if this applys to regular Windows XP Pro or just to Windows XP64. A little confused. I also just copied the TXTWETUP.OEM f

  • InDesign CS5.5 Style sheets not working properly

    Hello, I'm checking out a trial version of InDesign CS5.5 and am creating some paragraph style sheets that don't seem to be working. When assigning the latest style I've created to a paragraph, it changes the color I've spec'd, but not the typeface.

  • Need help regarding SELECT statement

    Hello, first time here but need help badly. I been using SQL syntax with another SQL server by the following statement doesnt seem to work in Oracle database. SELECT firstname+" "+lastname AS fullname FROM customers basicially, I just want to display

  • QM Usage Decision Error : Deficit Batch restricted

    I am unable to reject two batches..it shows 'no inventory exsists for this material' Usage Decision TCode gives me the following error: Deficit Batch restricted Can you please tell me, what might be the probable reason? Thanks

  • Can you send slideshows as an email attachment?

    can you send slideshows as an email attachment? Please provide the steps if it is possible, thank you