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.
 

Similar Messages

  • 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

  • Control 2 macs with 1 keyboard and mouse

    I have two iMacs, 27 inch 10.7 and 24 inch with 10.6. Side by side. The two communicate wirelessly using Apple Wi fi.
    I want to use one keyboard and mouse for both.
    I have downloaded "synergy" on both computers, however, attempts to control both have failed.
    I know that Apple screen sharing is an option, but I would prefer to use "synergy" or a similar program.
    (I vaguely recall controlling both computers in the past, but cannot recall how I did it.)
    Help? Control two Macs with one keyboard and mouse. That is my goal.
    Thanks.

    Try the software Teleport from Abyssoft. http://www.abyssoft.com/software/teleport/
    I just installed Teleport on Macbook Air and Macbook Pro and am now working on both with a single wireless keyboard and glidepad simply by dragging mouse from one screen to the other.

  • Solenoid Valve with Labview

    Hey everyone,
    Im brand new to LabView and I am in need of some assitance. Ive attached a picture of my block diagram setup. I need help with making the LabView code in order to help run this setup. I want to use LabView to activate my photoelectric sesnor, which when tripped will activate my solenoid valve immediately. The maximum allowable time between the photoelctric sensor being tripped to the valve opening cannot be greater than 50 milliseconds. I would also like to active my high speed camera 1 second prior to the electric sensor being activated. I have included the parts I am using in a list below. Thanks for all the help in advance.
    Solenoid Valve: SV-282 from Omega
    Photoelectric Sensor: Comet 14101A6517
    Output cDAQ: NI-9472 (powered by external power supply "NI PS-15 24V")
    Input cDAQ: NI-9421
    Camera: Phantom v7.3 (connected through ethernet)
    In summary: with labview, activate camera, activate photo sensor which when tripped will open solenoid valve immediately.
    Shervin Aslani
    Attachments:
    IMG_20130730_142033.jpg ‏2537 KB

    You're at the fun stage of the project!  You can start to write instrument drivers while (at the same time) learning how to program a state machine.
    I LOVE starting projects   I hate the tedium of finishing them... until they're done, then I love it again.
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

  • 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,

  • Controlling flash presentation with voice over and animation

    Hi everyone,
    I have a project coming up where I will have voice over to
    explain some animation that will appear on stage. It is basically a
    explanation of what a company does, services they offer...etc.
    Can anyone point me in the right direction on where to start
    something like this? So that my final project has a prev, next,
    stop, play, pause buttons and all of these affect the animations
    and voice overs. I suggested to make this on video and bring it
    into flash using a video player, but they want it to be into a
    single SWF to put on their website.
    Any help would be great!
    Thank you,
    Rafa.

    kglad,
    That is what I ended up doing after posting. I made a little
    demo for my client showing him how well it was running as an FLV
    and mentioned the possibility of losing sync if we went the other
    way.
    They were not to impress with the default player controls
    that come with flash. Do you know of any good tutorials on building
    custom controls (scrub bar, play/pause, prev, next...etc)?
    thank you,
    Rafa.

  • New to instrument control: attempting control of E5062A with GPIB cable and C program

    Hey everyone!
    I'm lost as where to start controlling an instrument we have in the lab.
    I'll give you my setup:
    It is a VNA, agilent/keysight E5062A.
    Controller is a desktop server running RHEL 5.
    I have a GPIB Cable.
    Program needs to be written into C so that it can be incorporated into the test program we are using.
    I have the programmers manual but it doesn't tell me much on how to start. It does tell me how to set the instrument(E5062A) gpib address. 
    I've also gathered that i will need some sort of I/O library, VISA or SCPI?
    Thank you for taking the time to read this!
    programmers manual link, take a look at chapter two
    http://anlage.umd.edu/Microwave%20Measurements%20for%20Personal%20Web%20Site/E5062A_Programmers_Guid...

    Do you also have a GPIB controller such as NI's USB-GPIB? Acable by itself its worthless. A better choice would probably have been the instrument with a USB or Ethernet connection, but no matter, the communication is the same.
    With the NI controller, you first install the NI-488.2 driver and then NI-VISA. VISA is an api that abstracts the actual physical connection. Code for a GPIB connection will run unmodified of you change to USB or Ethernet. When you install the drivers you are also given the option to install example code that should help you get started.
    An instrument driver for it is available at http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=FE17565E9D861AB5E0340003BA7CCD...
    Read about what an instrument driver is and how to use one at http://www.ni.com/downloads/instrument-drivers/
    Keysight might also have a driver. Check there as well.
    P.S. SCPI is the instrument's programming language. It's built-in as the manual makes clear.

  • Controlling sound file with play, stop and mute button in AS3.0?

    the method for stopping/playing sound in 2.0 don't work for 3.0.  i can stop the sound by going to a different page/frame on the site.  but i want the buttons. 
    1. play button?
    2.stop button?
    3.mute button?
    thanks in advance!

    for pause (example 2) :
    for volume -mute (example 1) :
    package
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.events.*;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    import flash.media.SoundTransform;
    import flash.net.URLRequest;
    import flash.utils.Timer;
    public class SoundTransformExample extends Sprite
      private var url:String = "MySound.mp3";
      private var soundFactory:Sound;
      private var channel:SoundChannel;
      private var positionTimer:Timer;
      public function SoundTransformExample()
       stage.align = StageAlign.TOP_LEFT;
       stage.scaleMode = StageScaleMode.NO_SCALE;
       var request:URLRequest = new URLRequest(url);
       soundFactory = new Sound();
       soundFactory.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
       soundFactory.load(request);
       channel = soundFactory.play();
       stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
      private function ioErrorHandler(event:Event):void
       trace("ioErrorHandler: " + event);
      private function setPan(pan:Number):void
       trace("setPan: " + pan.toFixed(2));
       var transform:SoundTransform = channel.soundTransform;
       transform.pan = pan;
       channel.soundTransform = transform;
      private function setVolume(volume:Number):void
       trace("setVolume: " + volume.toFixed(2));
       var transform:SoundTransform = channel.soundTransform;
       transform.volume = volume;
       channel.soundTransform = transform;
      private function mouseMoveHandler(event:MouseEvent):void
       var halfStage:uint = Math.floor(stage.stageWidth / 2);
       var xPos:uint = event.stageX;
       var yPos:uint = event.stageY;
       var value:Number;
       var pan:Number;
       if (xPos > halfStage)
        value = xPos / halfStage;
        pan = value - 1;
       else if (xPos < halfStage)
        value = (xPos - halfStage) / halfStage;
        pan = value;
       else
        pan = 0;
       var volume:Number = 1 - (yPos / stage.stageHeight);
       setVolume(volume);
       setPan(pan);
     package
    import flash.display.Sprite;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.text.TextField;
    import flash.events.MouseEvent;
    import flash.text.TextFieldAutoSize;
    public class SoundChannel_stopExample extends Sprite
      private var snd:Sound = new Sound();
      private var channel:SoundChannel = new SoundChannel();
      private var button:TextField = new TextField();
      public function SoundChannel_stopExample()
       var req:URLRequest = new URLRequest("MySound.mp3");
       snd.load(req);
       button.x = 10;
       button.y = 10;
       button.text = "PLAY";
       button.border = true;
       button.background = true;
       button.selectable = false;
       button.autoSize = TextFieldAutoSize.CENTER;
       button.addEventListener(MouseEvent.CLICK, clickHandler);
       this.addChild(button);
      private function clickHandler(e:MouseEvent):void
       var pausePosition:int = channel.position;
       if (button.text == "PLAY")
        channel = snd.play(pausePosition);
        button.text = "PAUSE";
       else
        channel.stop();
        button.text = "PLAY";

  • Best configuration for Solenoid Valve control

    Hello everyone,
    I'm really new with everything that concerns Controllers or Relays so any help would be very appreciated.
    I want to control 5 solenoid valves (website) with the following specifications:
    Rated Voltage: 12 or 24 VDC, Allowable Voltage fluctuation:10%, Power consumption (when 24V rated voltage): 1.5W (0.06A)
    I want to use LabView to control them. I saw at a similar post that I would need a digital I/O device a Relay Driver and a 24V generator.
    I was thinking of using these:
    NI 6501
    relay driver (uln2003)
    and a 24V power generator.
    Is this enough to control the valves with LabView or do I need something else?
    Thank you for your help!
    Ilan
    Solved!
    Go to Solution.

    Yes, that combination should be adequate.  The ULN2003 is designed for exactly that type of application and works well.
    Usually in English we refer to power supplies when talking about devices to convert ac power line voltages to lower voltage DC.
    In addition to LabVIEW you will need a DAQ driver for the USB-6501. On Windows it will be DAQmx. On Mac or Linux the dirver is DAQmx Base. The driver is a separate installation from LV, although it may come on the same disks.
    Lynn

  • Controlling solenoid with PID output

    I’m reviewing the possibility of using a PID in conjunction with our cooling setup where a solenoid valve is turned on and off.  I found a VI with a PID that was used with variable pump speeds to regulate pressure and I’m trying to make it easy on by plucking out that portion of the program which is attached here.  Unless I’m completely on the wrong track what I would like to know is how I can use the output or “result” to regulate the valve.
    Attachments:
    PID1.vi ‏48 KB

    Former employee created the PID to vary pump speed based on a pressure set point, so I’m not sure how applicable it is with simply turning a valve on and off.  If the valve were proportional it might be easier to adapt.  I am interested in a length of time function that can be controlled with the PID so the temperature can be adjusted to the set point more and or less aggressively.  I do have a program that allows me to vary the cycling of the valve, but if it included a PID it would be more of a hands-free operation.  As it stands now, I have to make changes to the cycle rate every couple minutes while the temperature transitions into the set point.  As the temperatures moves into equilibrium, the valve is open for a shorter duration of time and or closed for a longer period of time.

  • 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

  • Do I need additional hardware to control solenoids?

    Currently we have an NI MID 7602 motor drive and a SCB-68 connector block connected to an NI PXI-7334 motion controller. I need to control several solenoid valves. I have never dealt with solenoids before, so do I need additional NI hardware to be able to control these solenoid valves? My professor and I assumed that we could use the digital I/O interface (through the SCB-68) to control the solenoids, but I have a feeling a vital component is required.

    And as KC mentioned you will, in most instances, want a diode connected across the each of the DIO driven relay coils. This diode is connected so that it does not conduct when the coil is driven. It is there because the collapsing magnetic field of the coil, when it is de-energized, can induce surpisingly large voltages back into the driving circuit, in the same manner that the spark coil in an automobile ignition system works and the diode effectively shorts this reverse emf.
    P.M.
    Message Edited by LV_Pro on 10-17-2005 03:39 PM
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Pic to solenoid valve

    How can i control a solenoid valve(normally opened) to let it close , using a pic microcontroller. The solenoid valve requires 24v dc and consumes upto 1 Amp of current. I cannot figure out how can i supply 24v dc to the solenoid valve using a microcontroller(PIC16F887).

    Hello,
    We currently only support 4 microcontroller models, and the one you want is not one of them. Try looking into forums and learning websites for microcontrollers as you will not be able to simulate one in Multisim.
    Kind regards,
    Miguel V
    National Instruments

  • Solenoid valve

    how can i let output signal from PIC16F887(5v)  shut off the solenoid valve with 24v? . i dont want to connect the solenoid from another power source. i want the same 5V DC for the PIC to be amplified uo to 24 volts. because when the solenoid is connected to the power,it will shut off as it is normally open type. what is the best component can step up the voltage to 24v?
    example: FET,TRANSISTOR,OUPTOCOUPLER, LINE DRIVER,RELAY,.....

    duplicate post
    Please stop the thread spamming. I have no idea why you are asking about PIC products on the NI boards.

Maybe you are looking for