Creating a control sequence of digital outputs with timing

I'm trying to create a controls system for a cleaning process. I am controlling a pump, heater, and several solenoid valves using relays that I am opening and closing with the +5V from my USB 6008 and each relay goes to one of the digital I/O lines, where I provide a sink to switch the relay. 
I am using the front panel as the user interface for the machine, so the user can specify three different processes, so I'm using an event structure to call each process. An example of the steps in the process are as follows:
1. Open relay #1 (solenoid valve)
2. Open relay #4 (heater)
3. Wait 30 seconds (while relays #1 and #4 are still open)
4. Close relay #4
5. Close relay #1
6. Open relay #2 (solenoid valve)
7. Wait 5 seconds (while relay #2 is still open)
8. Close relay #2
I am trying to use a framed sequence structure within the event cases, with the DAQ Assistant saying which lines are sinks and which are also outputting +5V (no delta, keeps relays closed), but I don't think this is working and will bog down the system if it did. I think inverting the lines will make it so the lines nominally output the +5V so I just need to send it a sink when I want to close the relays, and make sure it keeps doing that while it waits so the process can be completed. 
What is the best way to do this? I've used Labview before, but I'm hardly a pro, so any help would be greatly appreciated.

As nijams mentioned a state machine architecture is a good place to start.  In case you are unfamiliar in how to implement this in LabVIEW there is a blank state machine template available in LabVIEW.  When you create a new VI select From Template->Frameworks->state machine.  In addition I've included a link to a simple example posted on our NI Community.
State Machine Example.zip: https://decibel.ni.com/content/docs/DOC-15515
Regards
Regards,
Isaac S.
Applications Engineer
National Instruments

Similar Messages

  • Controllin​g digital outputs with timing

    Hello,
    I am having trouble controlling my digital outputs based on using a timer to control them. My problem with this code is that when running case #2 the output comes on both the indicator and the h/w channel as expected but when the timer elaspes the indicator goes off the the digital output channel stays on. Maybe there is a better way or more common practise of controlling logic based on using timers? Any suggestions would be appreciated.
    Regards,
    John
    Attachments:
    Sign & Pool_Aug_26_.vi ‏66 KB

    Here is an example of what I think you are trying to do. Ask any questions you need to ask and I will explain what I did. There are better ways to do some of the things but I wanted to show you an example of what I thank you are trying to accomplish.
    Tim
    Johnson Controls
    Holland Michigan
    Attachments:
    Example.zip ‏54 KB

  • Digital Output With Timer (Simulation)

    Hello everyone, I just learned how to make LabVIEW program a week ago. I try to make a simulation of Digital Output by LabVIEW (my attachment). In this simulation I have a slider as an input (0-10 V), two numeric control (upper limit and bottom limit), a waveform chart that plot those 3 value, and two boolean LED (P0.0 and P0.1) as an indicator. In this simulation you can fill any number (between 0-10) in the numeric control as a limit for your slider input. If the input from a slider exceed those upper and bottom limit then the boolean LED will turn on, P0.0 if exceed upper limit and P0.1 if exceed bottom limit. The problem is I don't know how to make timer for those boolean LED. As example:
    1) Make an input from slider,
    2) If input (1) exceed the upper limit,P0.0 will turn on for 5 second,then turn of for 10 second,
    3) If in that 10 second you change the input back to normal (between upper and bottom limit) then P0.0 will stay turn of until the input from slider exceed the upper limit again,
    4)If in that 10 second you didn't change the input (stay exceed the upper limit) then P0.0 will repeat the process (2) until you the input from slider back to normal.
    (Same process for input that exceed the bottom limit).
    Can you help me to make this timer? Thank You (I'm sorry I made a double post):newbie
    Regards
    Juventom
    Attachments:
    Digital Output With Timer.vi ‏16 KB

    Hello Juventom,
    As I understand it you want to be continuously checking the value of the sliding bar and comparing that to the upper and lower limit controls whilest also chaning the LED booleans to true for 5 seconds then false for 10 seconds if the sliding bar value is outside of the limits.
    To do this you would probably be best using a parallel loop design, where you have 3 while loops in place of the one you have currently. Each one of these while loops would be responsible for a part of your program (e.g. the top one would display your values on the graph and the second one who check the sliding bar value against the upper limit and then turn on the LED, etc)
    I've found this tutorial about multiple loop programs and I think you should look at the section entitled "Parallel Execution"
    http://zone.ni.com/devzone/cda/tut/p/id/3749
    This way you can use normal delay VIs but when they run they only pause that loop rather than the whole program.
    Please let me know how you get on with this, and ask me if you need further help.
    James W
    Controls Systems Engineer
    STFC

  • PID Control - analog input, digital outputs

    Hello everyone,
    I am trying to use the PID toolkit to convert my existing feedback control system to one using PID or just PI whatever works best. Problem is that the tutorials out there discuss in detail about obtaining Analog inputs and using the PID output to control an analog output. Are there any tutorials that show how I can control my process variable which is an analog input by using the PID output to generate digital outputs?
    Basically, what I am doing is controlling the incline of my device with two digital outputs that control two solenoid valves. The angle is calculated from a calibration curve that plots distance sensor voltage with Angle. Any help would be immensely apprecitated. I want to try this out on my own before I post some vi's. Thanks!
    V
    I may not be perfect, but I'm all I got!

    That is exactly what I am doing currently. I have error bands specified around the target to make sure that it doesn't oscillate. But, under load conditions such as pulsed load conditions, the device goes out of bounds and the values trigger to correct for it. But, what I need is seemless or atleast seemless correction. Currently what I see is sudden adjustments to the incline. Please find attached what I am currently using. I am trying to get a more finer solution if at all possible.
    Note: Within 5% of the target = NO action
              Between 5% and 15% = Pulsed ACtion ( DO On for Pulse width time)
              Greater than 15% = continuous action until it reaches Pulse band
    I may not be perfect, but I'm all I got!
    Attachments:
    TDML_subElevationControl.vi ‏41 KB
    TDML_subPulsedValveFuntion.vi ‏16 KB

  • Create playback controls for Timeline in sync with audio?

    Hi All,
    Technically, I've combined two questions into one. Firstly, can someone offer some insight on how to create playback controls for an Edge animation so the user can essentially "scrub" the timeline or navigate to a specific point on the timeline. I know you can create buttons to "sym.play()" different areas but I was wondering if there was a more streamlined solution (something similar to video playback controls.) Next, I'd like the user to be able to skip to different locations while the music remains in sync with the animations. I've created a few buttons to attempt to achieve this but the music plays independently regardless of where I jump to on the timeline.
    Any help would be most appreciated.
    Thanks in advance!

    I had some ideas why that may be so, but then, when I thought about it, properly, i have no idea why it is that way. Maybe it is because audio has a higher priority than graphics, in OS X, but if I remember correctly, it was like this before OS X. Maybe there is an offset for latency compensation, but they made it too large. (it seems to be the same amount, no matter what the buffer size is)
    just to make sure we are seeing the same thing. on my (somehat old) G4 I'm seeing about 60ms difference.

  • Is this setup capable of Labview controlled analog or digital output to 5V?

    DAQCard AI-16XE-50 to a CB-68LP using Labview 6.1 and NI-DAQ 7. Win2k pro

    chazimusmaximus,
    For your specific DAQCard AI-16XE-50, the only output you can perform is digital output since there are no analog output lines on this board. Digital ouptut with NI-DAQ 7.0 will work with LabVIEW 6.1, but you can only use the Traditional DAQ VIs. Windows 2000 and the CB-68LP are both fine in this combination.
    For example programs, simply launch LabVIEW 6.1 and go to Help >> Find Examples. Then follow the path Hardware Input and Output >> DAQ >> Digital Input and Output >> E-series to choose the example that works best for you.
    Have a great day.

  • Sequence 1create output digtal signal- 2 make microsecon​ds delay or less- 3 measure digital signal with board 6023e

    hello
    I need creat a digital signal and for this i use a counter output and then i need creat a delay after  a signal measurment and for this i use again a couter. My problem is how i can make this delay betwen create and measure a signal. this delay must to bethe shortest  possible  and precise. une of my attemps was make  a sequence and for make the delay i create a task for une virtual output with max frequency 5000000hz and just une pulse but i dont know how many time the labview get to go by the first task ( creat a output pulse and ent it) to make tis task before discribed to the last task (measure a digital sinal). Another thing that i dont know is how many time the libview get to create and eliminate une task. Une information beyond the kind of board (6023E) that can be useful to help me  with this problem is the information about my pc in this case i use a pentium4 3Ghz.
    thanks  

    ...My problem is how i can make this delay betwen create and measure a signal.
    ...how many time the labview get to end one task and start another one.
    What I tried to say is, that even if you use the counter of the 6023e-Board
    to create the delay and trigger the measure via LabView under Windows,
    you leave the realtime-path. Executiontime of LabView-code is then not
    determinated.
    One way to solve this, is triggering measurement via hardware and use LabView to read Data from the Buffer of the DAQ-card.
    You can find more info about DAQ in the "measurements manuall" of NI, delivered with your LabView Software.
    Lorand

  • USB-6009 pulse train generation with digital output....

    Hello!
    I've bought a new USB NI-Card (USB-6009) and now I'm trying to adopt an old vi that uses traditional DAQ drivers. I wrote that vi for a PCI NI-Card (PCI-6024E), which has two counters to generate two pulse trains simultaneously. Now I've only one counter and that's why I'm searching for a good way to create pulse trains using a digital output! The pulse trains are both ranging between 100 Hz and 100 kHz.
    I'm sure somebody has an idea how I can solve the probem in the best way
    Kind regards,
    Peter

    You can't do it with this low cost board. Both digital and analog outputs are software timed only. The analog out is rated at only 150  samples/sec and the digital is about the same. You can't even use one of the counters because it is not a hardware timed counter output. It is an event counter only as an input.

  • PID with digital output

    Hi,
    I have the application.
    I do not clear about PID function but, I would like to ask you about my application.
    I have a sensor water level and a few motors to control gates
    I measure water level and control motor via digital output(using the fieldpoint system)
    I would like to hold water level at level, so I use PV indicator  and SV control. when I change SV then will  control Motor (RW or FW motor).
    Can we use how technology to hold water level PV=SV  ?.
    Please let me know your comments.
    Thanks
    Nguyen Van Hung

    Hi Nguyen,
    There are several examples in CVI under Help » Find Examples that may be able to help speed up the development of your PID program (assuming you have purchased the CVI PID Toolkit).  These examples can be found by going to Toolkits and Modules » PID and Fuzzy Logic Control » PID.  Depending on how familiar you are with PID algorithms, I might suggest that you look at the GeneralPid example first.  Additionally, the PID Control Toolkit User Manual t is also a great place to look at the algorithms and the library functions.  Finally, in case you aren't aware, you can double click on any function that you find in the Libraries folder located in the bottom left of CVI to open a functions panel which will show all inputs and outputs of a given function.  Then, you can right click on any parameter to view details about that or on the function panel (outside an input box) for more information about the function in general.
    I hope these resources help you design an algorithm that works well for your situation!
    Regards,
    Trey C.
    Applications Engineer
    National Instruments

  • Need 1200 digital outputs that can be updated at 1 MHz

    I need to control about 1200 digital outputs (CMOS or TTL)  at high speed (1 MHz).  Any platform
    that gets the job done is OK, but I usually program in a WinXP environment.   I also have a problem
    of distributing these signals to many units over a roughly 50 by 50 foot area, so I also need hardware
    to either drive the outputs over an extended length of wire or to wirelessly distribute the signals to
    multiple substations which each operate between 10 and 50 units.
    A small number of inputs (maybe just two) would be very useful to control the timing of the
    state transitions.

    Thanks for  your response.
    Our application is controlling LED's for a computer graphics application.
    http://gl.ict.usc.edu/Films/RelightingHumanLocomotion/index.html has
    some pictures of the apparatus, as well as a short video showing how
    it works and the results we've got so far.
    The basic idea is to capture varying illumination conditions extremely
    rapidly using high-speed (Vision Research) cameras that go at 5000 fps
    or so.  The signals that drive the lights are just 5V DC,
    currently supplied by a large number of PICS, but we are hoping to find
    a more
    centralized solution, as well as a higher performance solution (large
    program memory for many lighting patterns, high speed processing to
    support flexible computation of patterns, high speed updating of
    outputs to allow for multiple on/off states within a single 200 usec
    interval
    to simulate grayscale control of the LED's).
    If the system is fast enough, it is possible that a smaller number of
    outputs could drive a large bank of latches that provide the final
    outputs,
    but ideally this would be handled by the NI hardware.  In other
    words, we would just buy enough output units, hook them up, and then the
    programmer just sets the 1200 bits of memory as desired and then triggers the refresh.
    To distribute the signals, one possibility is to have output units with
    between 10 and 50 outputs that can be connected to the central
    controller with long cables (up to 40 feet) and which in turn drive
    individual lights through wires about 10 feet long.  Wireless
    would be
    even better if it exists.

  • No internal speakers | digital output only | red light from audio jack

    I plugged in a stereo through analogue mini jack to the headphone socket of my mac book pro. When i unplugged the stereo, the internal speakers failed to work. There is now a red light coming from the jack as if a "digital output" is plugged into the socket. But no digital output has ever been plugged into the socket - and I have no control of mute or volume settings.
    When I plug headphones in, they work fine and I have control of mute and volume settings. Once the headphones are removed I am automatically set back to "digital output" with no control over mute or volume, and no audio from m internal speakers.
    I have tried changing the settings in system preferences/sound/settings/output ... but there is no option other than "digital output". I suppose I would like to select "internal speakers" but there is no option for this. And like I stated earlier, the jack is lit up red.
    I've tried software updates, restarts, disk utilities (permissions and repairs including repairing with the startup disk), plugging and unplugging, but to no avail.
    When I try to change the volume on the keyboard's volume controls I get the "no entry" sign under the volume bar and have no control (as if it were stuck on mute).
    The only thing I can think of is that I forced a mini jack into the headphone socket too hard so I'm worried that I've damaged the hardware.
    Could this have caused the problem? Or is this a software issue? Any help would be appreciated.
    In short I have no sound from the internal speakers.

    Same here. I don't remember doing anything out of the ordinary. I was working in Parallels on getting a AM station to stream via some web interface. Next time I went to play sound on the internal speakers, no go.
    I've tried zapping the PRAM, toggling the headphone jack and the toothpick thing. Nothing seems to work.
    I've also noticed that I get sound in my headphones in iTunes but not in Garageband (someone had suggested that starting up Garageband would reset things.
    Any other ideas out there?
    Is there a file that could get corrupted that I could switch out of my back up?

  • Audigy 2 ZS digital output to tosli

    First of all thank you for reading, this question probable has been raised before (done a search but couldnt find an answer to it).
    My doubt is, i own a Audigy 2 ZS (neither Platinum or Pro) wanted to know if i can plug this soundboard to my hifi stereo, through a toslink cable. I know the output on the board isnt toslink, so im think of using a cable such as this http://nanosatelite.eu/b2c/index.php?page=pp_producto.php&md=0&codp=250 with a male toslink and a 3,5 jack on the other. will i get a digital output with this cable, can it do the job (its only digital stereo im aiming at). any advices i should know?
    wanted to be shure about this, before buying the cable
    thank you for your time
    Nuno

    If the cable has a in-build coaxial to optical conversion circuit then yes, otherwise (I think this is the answer for you) no.
    You need a device wich can convert S/PDIF coaxial to optical (TosLINK). Creative des have one but sorry to say ... your card isn't on list you can use it with. So, you need to get something simliar or DIY one (it's not very hard to do).
    Get:
    http://www.maplin.co.uk/Free_UK_Deli'very/Coaxial_to_Optical_Digital_Signal_Convertor_2929/Coaxial_to_Optical_Digital_Signal_Convertor_2929.h tm
    http://www.cablestogo.com/product.asp?cat_id=504&sku=4008
    http://www.m-audio.com/products/en_us/CO2.html
    There are? couple more (just google).
    DIY:
    http://www.electricstart.de/
    jutapa

  • Digital input and digital output at the same time

    Hi all
    I have a PCI-6503 board. I have done 2 task that run simultaneously: the first one is port0_16 output and the second one is port2 input.
    I get sometimes (not every times...this is strange...) error-200587 saying:
    'Requested operation could not be performed, because the specified digital lines are either reserved or the device is not present in NI-DAQmx.
    It is possible that these lines are reserved by another task, the device is being used through the Traditional NI-DAQ interface, or the device is being reset. You might also get the error if the specified resource is currently in use by LabVIEW network variables bound to the DAQ Channel, or if the DAQ Channel is being used in any OPC Client software.
    If you are using these lines with another task, wait for the task to complete.  If you are using the device through the Traditional NI-DAQ interface, and you want to use it with NI-DAQmx, reset (initialize) the device using the Traditional NI-DAQ interface. If you are resetting the device, wait for the reset to finish.'
    In the attached VI i have recreated the basic structure of my real VI (the error is present even here of course...).
    How can i do?
    I want to have both digital input and digital output with the same PCI-6503 every single cycle... Is it possible?
    Please help me!!!
    Kind regards.
    I love the smell of napalm in the morning
    Attachments:
    DIO simultaneously error.vi ‏31 KB

    Hello Maverick,
    Did you have any luck with the example Raven sent you?
    In Raven's example, it properly passes the DAQmx task from one SubVI to another to avoid having to open the task again. These errors are likely to occur when you have multiple DAQmx calls in a VI that call the same task again without clearing the previously opened task. If at any given time you try to open a task that already is being used, you might receive an error "resource is reserved"... similar to your original example.
    If you are interested, here is an awesome link that gives a detailed explanation of the LabVIEW dataflow paradigm
    Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications
    Thanks and good luck!
    Jordan Randall
    National Instruments Italy

  • Headphones in = internal speakers | headphones out = digital output???

    When the headphones are plugged in, the sound comes out from the internal speakers.
    When the headphones are taken out, the sound comes out of the digital output, with a red light shining out the headphone port.

    I have a sort of similar problem, I have an imac 24" and recently purchased a pair of logitech S220 speakers.
    The speakers work fine and all, no problem, but as soon as I plug my headphones into the headphone jack on the logitech remote pod, the sound no longer comes from the superior external speakers, but from the imac speakers. It's quite annoying as I specifically bought these speakers for a louder listening experience at night, and good though the internal speakers are, they don't cut it for me.
    So any way around this guys? how do I listen to my music on headphones through external speakers??
    thank you very much
    regards

  • No "Digital Output Only" opti

    Hey guys, I have an Audigy 2 Value, and I am trying to output via the digital out, I have the mono to coax cable and everything ready into my receiver but I don't have the option in my controls to tick "Digital Output Only", which is what I have heard I have to do?
    Anyone have any ideas why it isn't there? Or how I can get it there?
    Thanks in advance.Message Edited by SubElement on 02--2006 0:04 AM

    No one?

Maybe you are looking for

  • Installed windows 7 over windows 8. Now I want to recover back to windows 8.

    Hello Everybody! OK so here is my situation. I bought a Pavilion G7-2235DX with windows 8. I made one recovery disc becuase I was impatient and figured that my recovery partition would be enough.  I decided immediately to install windows 7, and I ins

  • XML using the XMLDocument and XMLNode

    Hi guys, Im new to flex and I am trying to create an xml document in code. Here is a snippet of my code: fuelNode = xmlDoc.createElement("Fuel"); sectionNode.appendChild(fuelNode); childNode = xmlDoc.createElement("FuelID"); childNode.nodeType = 1; c

  • Process flow - How to deploy

    I am new to OWB and have created lot of maps and running maps one by one manually to load data. Now I want to automate it with process flow and workflow. I created a location for workflow and tested the connection. I have created a small process flow

  • Hello I cannot seem to get my airport to connect to a network

    Hello< the airport in my notebook will not connect to my network.  I just reconfigured the router (a linksys router) and my sisters macbook connects fine but mine does not.  The airport is on and when i try to put in the WPA password i get the color

  • Does Safari now block multiple applets on a page?

    After going through the process to re-enable Java in Safari, specifically the 1.7.0_67 JRE, Safari 6.0.5, on OS X 10.8.5, websites with 1 Java applet work fine.  However, if the page has 2, the second applet won't launch.  In the small test case belo