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

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

  • Counting peaks within one minute intervals and outputting with time stamp

    I'm currently working on my senior design project for biomedical engineering. We are creating a piezoelectric sensor in order to measure respiration on a bed non-invasively. The sensor lays on bed under subject and records movement due to respiration. We currently have figured out how to detect peaks. However, now we want to count number of peaks detected within a 1 min time period and output that result with a 'timestamp'. We would like the output to be into excel as two columns, rate(number peaks in 1 min) and time. Time in minutes and not actual time is fine. Sampling rate was 500Hz.
    My current VI has peak detection criteria and can output total number of peaks and their locations.
    Any help would be greatly appreciated as this is our last step before verification and have been stuck on it for awhile. 
    It won't allow me to attach a tdms file in which our data is stored as, so I can't upload the data currently.
    Also attached is our current VI for peak detection labeled 3.26.Resp.PeakDetect.
    Thanks for any and all help!!
    Attachments:
    3.26.Resp.PeakDetect.vi ‏146 KB

    I see no need for a case structure.  Or did you set up a state machine that I missed?
    I recommend making a VI that does nothing but read your 30,000 samples and process it (counting the peaks and what not).  From there, you create the array for the number of peaks and the time (in minutes).  Then you can call that VI inside of a loop to build up the array of data points.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • 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

  • Western Digital: Problems with Time Machine

    I have a 1T Western Digital external drive. It is connected Via USB to one of the USB ports on the back of my Mac Pro. It seems to work just fine.
    I am running time machine to create a backup on that disk. It has created and continues to update, apparently successfully.
    From Finder Info, the file I see on the disk is called monster.sparsebundle. It is 393GB. The path shown on info is /Volumn/ExternalHD
    The Permissions read: System: Read&Write, and Everyone Read&Write
    Everything looks perfect.
    Except that when I try to go to the 'time travel' screen launching the Time Tracel app, NOTHING AT ALL HAPPENS.
    I have tried many things to solve the problem, now I am trying to see if it's somehow related to this Western Digital disk.
    If you have any theory, however strange, please share it. I am running out of ideas!
    Thanks!!
    Pito

    Excellent point Linc! Indeed this disk had been attached over the network and I was getting some weird probems and so to simplify things I connected it directly.
    A couple of other tidbits that I discovered. If I 'open' that sparsebundle so that it is like a mounted volume, and then disconnect TimeMachine from any disk, then the "Browse other Time Machines" (or whatever the command was) allows me to access that sparsebundle and see it in the 'time travel' display. Just what I had failed to do so far!!
    So, what I've done and I think its solving the problem: I deleted the sparsebundle and just re-created the backup (luckily I didn't care about the history) and it is now building the backup on my external disk 'correctly' and I can get into the time travel screen.
    Weird. I would definitely call this a bug in TimeMachine albeit a kind of esoteric one! Thanks for the CRUCIAL HINT!
    No one else came up with that, so my compliments!

  • How to get Digital waveform with Time.

    Hi
    I have 3 channels , each of which have ON/ OFF cycles specified with milliseconds as shown below.
    Channel 1       OFF(3000)   ON(2000)  OFF(1000)  ON(500)  OFF(4000)  ON(300)
                         The number in the bracket is the time in milliseconds for which the channel has to be ON or OFF.
    Channel 2      OFF(800)   ON(1000)  OFF(6000)  ON(2000)  OFF(5000)  ON(400)
    Channel 3       OFF(1000)   ON(700)  OFF(500)  ON(800)  OFF(400)  ON(600)
    So i need a digital waveform plot with Y axis showing the highs and lows for the channel  and X- Axis showing the time in  milliseconds.
    All the channels can be plotted in one graph or separate graphs.
    I tried plotting with each OFF as False and ON as TRUE and built a boolean array. then converted to digital.  but was not able to get the time (X-axis ) correctly. Is there any way to get Time on X axis for the Digital channel.
    Thank you .Regards. Hema.

    Hi Dennis,
    I have done the same way as you suggested.but the sample rate is common to all the channels.( that is each channel is one boolean array column in the 2D boolean array which is fed to the Digital function , but i need separate sample rate for each channel(1-D array).
    The Boolean array to digital takes 2D array as input, so i was not able to get different Time on X-axis.
    But i found out a solution( very long method)  by building time array separately and plotting the waveform without using sample rate.
    Now i want to get rid of the '1' and '0' which gets displayed on the digital waveform by default . That is for every high there is number 1 shown and every low number 0 is shown on the graph. Please can I know how to remove this number display.
    I saw digital waveform example too, but  on all digital  waveform, the numbers are shown.  Is there any property to be set to disable 1 and zero display.
    Thank you.

  • 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

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

  • 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

  • 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

  • Setting time critical digital output based on axis position (PCI-7358)

    HI,
    I need to set a time critical digital output based on encoder position (this will switch fast acting valves). I was planning to try the general purpose DIO but I can't find any examples, I have been through the manuals, searched the site etc. Where can I find help with this, all the examples only seem to deal with digital input triggering or RTSI? I'm thinking of an onboard program that just monitors encoder positions and sets digital outputs.
    Some time back I seem to remember reading that general purpose DIO should not be used for time critical operations, is that correct? And if so what are the other options - RTSI going to another DIO board? The DIO really needs to be deterministic, is RTSI the only option?
    Any advice appreciated / Martin
    Certified LabVIEW Architect

    Even with an onboard program you will always get a delay of several milliseconds between your axis has crossed the position and until the digital outputs are set. If this is ok for you then you could choose this approach.
    For the case that you only want to toggle one digital line the Breakpoint feature should be the best solution as it toggles the breakpoint output almost immediately when the breakpoint positions are reached.
    If you need to change a whole pattern instead of only a single line then the approach you mentioned would be the best solution (RTSI and high-speed DIO like the 653x boards). Combine this approach with the breakpoint feature by routing the breakpoint output to RTSI and using this as a update clock signal for the DIO board.
    Best regards,
    Jochen Klier
    National Instruments Germany

  • 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

  • What is the best way to Sync Digital Output(TTL) with Analog Output?

    I am trying to generate Analog waveform that synchronize the rising edge of a digital signal(TTL). The ttl will be used as trigger for camera. The board I have is USB-6343X. In my draft,  I used a clock as ttl so I can tune frequency easily. Could any one tell me what's the best way to accomplish such task? My draft seems working, but I hope there's more neat way. Thanks in advance for any help!
    Kind regards,
    Eric

    Hi Econg,
    You should be able to trigger your TTL output with the analog output by using the ao/StartTrigger as your trigger source on the counter task. You wouldn't have to have the extra Get Full Terminal Name.vi in your analog output task.
    Here is an example using your modified code. You will have to change the cDAQ1/ao/StartTigger to *your device*/ao/StartTrigger, but it should then trigger the counter output at the exact time when the analog output starts.

  • 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

Maybe you are looking for

  • Unable to load German characters in NON Unicode Essbase Cube

    Hi Guys, This is what we want to do: Build a Cube for Germany on our Essbase server in US. Our users will access cube using Excel Add-In from Germany. But since the Essbase server is in US, system environment variable ESSLANG is set to English_United

  • Mountain Lion Security

    Hi, I am a PGA/LGA certified hardware engineer who worked R&D for decades. One of the processes in R&D is the Verification of design function within complex designs that both do and do not use computers and or software. In the case of a design where

  • Running multiple soundtracks in iDVD slideshow?

    Hi, I'm creating a slideshow in iDVD and want background music to play as it progresses through my pictures. I'd like to play multiple songs, or portions of a song...not necessarily just run one 4 min song and have a bunch of photos run. Do I have to

  • My Photo Albums?

    Hi, I would like one page which has links to my photo pages, I started using the About Me template and it even has a My Photos Albums section. But how do I add the links to the separate photo pages? Also the other problem is that the Photo Page heade

  • Error in Create TCP Listener - Linux

    Hi, When using the Create TCP Listener function in Linux Red Hat 9.0, I get an error (ill-formet net address). What is strange is that I get this error only when running the VI (built as an executable) as a regular user. When I run it as root, no pro