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

Similar Messages

  • 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

  • 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

  • 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

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

  • 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

  • Need help created state machine with timed digital output

    Hello everyone I'm new in LabView especially about how to make a state machine. I want to make simulation about state machine with digital output. In Front Panel there are volt_in as an input slider (0-10 V), two numeric control (upper limit and bottom limit), a waveform chart to plot those 3 value, and three boolean (P0.0, P0.1, P0.2) as an indicator. Boolean indicator will on if input from slider exceed the limit in certain situation. This simulation will work as follow:
    1. Define the upper & bottom limit (ex. 8 & 4V)
    2. Make an input from slider (0-10V)
    3. If input (2) exceed the upper limit but less than 10 second (ex. you have 9V input for 8 second, but after 8 second you change the slider back to normal between 4-8V) then the boolean indicator P0.0 & P0.2 will stay off
    4. If input (2) exceed the upper limit more than 10 second (ex. you have 9V input for 4 second, change to 8.5 V for 3 second, and then change to 10V for 3 second) then the boolean indicator P0.0 will turn on for 5 second, turn off, then follow by indicator P0.2 for 5 second, and turn off
    5. Wait 15 second, then repeat process from (2)
    Same process for input that exceed the bottom limit (P0.1 and P0.2 as indicator).
    Can you help me make the block diagram of this process? I will appreciate any of your help.
    Best Regards
    juventom 
    Attachments:
    State Machine Digital Output.vi ‏28 KB

    I would highly recommend you to open the template in LabVIEW to design state machines. You can the Standard State Machine template if you go to File -> New.. and Browse to VI -> From Template -> Frameworks -> Design Patterns.
    Also, here is a good explanation of one:
    https://decibel.ni.com/content/groups/northeast-oh-labview-users/blog/2009/09/08/state-machines
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

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

  • Problem with digital output and microph

    Hello! I recently bought a new motherboard MSI K8N SLI Platinum that have onboard Sounblaster Li've 24bit, with coaxial and spdif and also the standard outputs. I ve connected via a fiber optical cable to my amplifier and i checked the digital output only box to the advanced settings on the mixer. I am hearing sound very well from my amplifier but when i connect headphones to with microphone to my soundcard , i don't hear anything at all from my headphones. Also i cannot speak via microphone. If i uncheck the box digital output only i hear sound from my headphones and also i can speak to microphone. Is there some way to have them both enabled? In my previous motherboard i didn't have that problem. I could hear sound from my amplifier with pcm signal and from my headphones and microphone analog at the same time.
    Thanks!

    Thibaud,
    The clue is here: " i take acquisition with one sample on demand."
    You are apparently using software timed output. To maintain accurate phasing at 80 Hz you need timing which is accurate to better than 4 milliseconds. This is not likely to occur with a desktop operating system. Sometimes it will be good and other times OS latencies will throw the timing way off.
    If your board supports it, use hardware timing. The timebase sources on most boards are far more precise and accurate than software timing.
    Lynn

  • Digital stimulus-f​requency response: Need to drive with digital output trigger. Using counters for response.

    I need to drive stimulus-response with a software driven digital trigger and NI-TIO counter based response. No analog I/O is really relevant, although I have a PCI-6035E multi-function DAQ as part of my gear. I intend to use the analog, but its timing is non-critical and can be software timed.
    The real trick is that I want to set the basic timing of the system (in the range of 1 - 50Hz) from the timer0 on the 6035E. This signal needs to be replicated to drive a trigger pulse and to route through RTSI (or a PFI) to trigger frequency counts using the four possible groups of counter/timers on the 6602.
    What I need is:
    while( enabled )
    Repeat at (
    software controllable rate = 1-50Hz)
    Trigger Sets a PFI line for 10-20us
    same trigger sets an RTSI line
    - Software Set Delay (usually zero)- stable is more important than the delay time!
    Count for software set time on 4 counters
    analog samples
    Post-process
    I want to do this in LabView. I have checked out the Advanced sychronization demos online, but the examples all use analog triggering and buffered digital I/O. This doesn't really address what I need to do.
    I have made some failed attempts which relied on software to sync up the trigger and the response frequency acquisition. This is definately flawed. I need to start the counting right after setting the digital output trigger, and stop the count after a fixed interval for frequency calculation.
    I am having trouble working through the signal routing to get the timing to trigger off the digital stimulus output pulse.
    Any help would be appreciated
    Thanks,
    Joe

    Joe
    What are you using the trigger from the 6035E for? I do not know what you mean by, "to trigger frequency countes."
    If you are having problems just routing the signal to the 6602, here is a vi that shows you how to route a signal through the RTSI cable to use as the source of a counter.
    Brian
    Attachments:
    Route_RTSI_to_Source.vi ‏67 KB

  • Need help with waveform and digital output

    Hey everyone,
    I am driving a rotational motor with an example waveform output VI and an example digital output VI. I am able to successfully send a square wave with the desired properties to rotate the motor and I am also able to successfully send a digital output (1 or 0) to change its direction (clockwise/couter-clockwise.
    However I need some advices to write a setup such that after the motor runs as desired, I can return the motor back to its original position. I think the simplest way is timing how long it takes to finish its task, and just change the digital output, keep the same wave properties and run for the same amount of time.
    So how can I time how long the program runs and with some kind of button, change the digital output and run the program again?

    As more of a program architecture tip, this sounds like a great time to be using a State Machine.  I say this because you mention resetting the motor (one state) then running it again (another state) repeatedly.  As a design tip, I would check out this article, along with the Design Pattern Template that comes with LabVIEW.  You can find this by going to File >> New... then expanding the tree to VI >> From Template >> Frameworks >> Design Patterns >> Standard State Machine.
    Cheers, 
    Brian A.
    National Instruments
    Applications Engineer

  • How can I improve the timing of my 2 Digital Output signals?

    Hi,
    I am using a NI DAQ Pad-6015 (usb) with Labview 8.5 and XP, to generate 2 Digital Ouputs (500ms high for the first one and  600ms high for the second one). The timing doesn't need to be very accurate so I am not using the 2 hardware clocks outputs. When runing the VI, and measuring the duration of the outputs with an oscilloscope, I get 520ms and 640ms. This is not too much of a problem, but I would still like to know, if I am doing the right thing in my program, and/or if it is possible de improve it?
    Thanks for your help,
    Regards,
    Marc
    Solved!
    Go to Solution.
    Attachments:
    Forum.vi ‏37 KB

    This VI can be convert to labview 8.0 because subvi are not compatible with old version.
    I post a screenshot.
    Aurélien J.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Du 30 juin au 25 août, embarquez pour 2 mois de vidéo-t'chat ! Prenez place pour un voyage au coe...
    Attachments:
    image.jpg ‏38 KB

  • Digital Output Sequence (variable timing) NI 9472

    Hi, 
    Wondering if anyone has any suggestions for creating a VI to do the following:
    I have 6 valves which I want to control with a NI 9472 module (8 digital outputs). The valves have a set sequence of 6 stages, each with different times (which I would like to be able to vary)
    I have 3 of the above setup (ie 3 sets of 6 valves) that I would like to control in the same way but independent from each other.
    I have attached a diagram of the valve setup and sequencing that i would like to achieve.
    Thanks for your ideas.
    Setup:
    NI cDAQ-9174 Chassis
    3 x NI 9472 24V sourcing module.
    Solved!
    Go to Solution.
    Attachments:
    Valve Positions.JPG ‏20 KB
    Sequence Timing.JPG ‏36 KB
    Valve Setup (3 x 6).pdf ‏24 KB

    OK here is a quick idea about my suggestion. Let me know what you think. For now you need to set up the array for the time and valves before you start the program.
    Tim
    Johnson Controls
    Holland Michigan
    Attachments:
    Timed Valves.vi ‏26 KB
    Time Array.ctl ‏6 KB
    Valve Array.ctl ‏5 KB

  • Error -200279 with simultaneous analog input (different devices) and digital output.

    Hi guys,
    I am a beginner in Labview and have been dealing with this problem for a couple of weeks now and just can't seem to get it completely right, I have a feeling there are a few small bugs in my code/hardware setup.
    I am running an scxi-1000 chassis with a 1600 module and 1302C along with a 1303 accesory for temperature measurements, this is connected to four thermoucouples. Unfortunately I have a limited number of modules available so I am also using a PCI-6221 DAQ card with an scb-68 breakout box used for a digital output and analog input voltage channel. Attached is my labview program. When I run the code at a 50 Hz sampling rate it runs with no errors but the data file comes out extremely wrong, this is also attached. When I run the code at 100 Hz I get error-200279 after a few loops. I used to have 2 daqmx timing VIs (one for each input), but the same error would eventually happen, I have also tried increasing the buffer size on said timing VI. I am also using an old computer (Pentium IV) could this effect the program?
    I have learned a lot going through forms for similar problems to mine but I just can't get it to for an extended period of time, I have posted my simplest code.
    Thanks in advance,
    Luca
    Attachments:
    tc_2.txt ‏1102 KB
    FinalCombined_2.vi ‏128 KB

    Ok this makes sense. I have made the suggested modifications but still getting the same error with sampling rates of 100 Hz or higher. Could you check that I have implemented the queue VIs properly (new file attached)? Also when running at 50 Hz in debug mode it does not look like the second while loop (with the dequeue element) comes into play until I hit the stop button, once I hit the stop button I get the following error:
    Error 1 occurred at Dequeue Element in FinalCombined_2.vi
    Possible reason(s):
    LabVIEW: An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
    =========================
    NI-488: Command requires GPIB Controller to be Controller-In-Charge.
    This leads me to believe I have programmed the queue elements incorrectly.
    Thanks for your help, any suggestions are greatly appreciated.
    Luca
    Attachments:
    FinalCombined_2.vi ‏102 KB

Maybe you are looking for

  • Error message: ORA-27125: unable to create shared memory segment Linux-x86_

    Hi, I am doing an installtion of SAP Netweaver 2004s SR3 on SusE Linux 11/Oracle 10.2 But i am facing the follow issue in Create Database phase of SAPInst. An error occurred while processing service SAP NetWeaver 7.0 Support Release 3 > SAP Systems >

  • A C++ and COM question...

    Greetings, in the middle of a project where I'm trying to build a Flash frontend for a DVB application (DVBViewer) I came across a problem. I need to interrogate this application (with COM - Component Object Model) to gain some informations (channel,

  • Problem with Datastore Tier Rate Factors

    Hi all, I have problem with Chargeback Datastore Tiers. I have three different datastore types and I want to charge them seperately. To do this, I created three datastore tiers and moved that datastores to them. For all three datastore tiers, I assig

  • Importing/Exporting tag librariy possible?

    I have a major problem with the "apply source formatting" and auto code formatting of my code with DW 8 on my PC. It auto inserts three lines of spacing for css, php and jscript. I tried manuaaly adjusting it in the tag library and it made all of my

  • Fitting Muse site to screen

    We are currently building an Adobe Muse website for a client and while we fit it correctly for our large desktop mac computers/internet explorer, our clients opened up their site in Chrome and the resolution/screen size was out of wack, creating a bo