Accurate time between digital on/off

Hi All
I had posted this before in software board but i think this board is more appropriate. I am operating a valve which uses a digital signal (1 or 0) to switch on and off. I need to vary the time it remains open from 5 ms to 100 ms. I was using 'wait until ms' block up till now but it is not very accurate.
I am attaching the final version of the program I am currently using. The
daq card is pci 6516. We also have a PCI 6251 which as I understand can be used
for hardware timing but am not really sure how to go about it. I
would be greatful if someone could push me in the right direction. 
Regards
Abhishek
Solved!
Go to Solution.
Attachments:
DOD_valve.vi ‏27 KB

You will not be able to use the CB-37F-LP with the PCI-6251.  I would recommend using the SCB-68 or the TBX-68.
SCB-68
http://sine.ni.com/nips/cds/view/p/lang/en/nid/1180
TBX-68
http://sine.ni.com/nips/cds/view/p/lang/en/nid/1182
I attached another program that will output a digital high for 5ms and then a low for 100ms (like what you asked in the beginning).  This is all hardware based an relies on the clock frequency and what values I am outputting.  Currently the program has a clock rate of 200Hz and outputs an array of 1 digital high bit and 10 digital low bits for every clock edge.  To just send one pulse out of the card you would need to just change the array that is written to the output and change the sample clock to finite samples. 
Message Edited by Jordan F on 01-16-2009 05:11 PM
Regards,
Jordan F
National Instruments
Attachments:
CorrelatedDO[1].vi ‏23 KB

Similar Messages

  • Time between digital inputs?

    Hi, I would like to measure the time between a digital input being true.
    Basically I have a prox picking put a point on a rotating shaft (to determine RPMs).
    What I want to do is measure the time between consecutive input signals from the prox, divide 1 rev by the time, multiply this by 60 to get RPMs. Then compare that value to a set value ( say 300 RPM ). If it is equal or great, contine onto the rest of the program, if it is less than the set value, keep looping until it is greater than or equal to the set value.
    Thanks in advance for the help!
    Ryan
    LV 7.1

    If you need to measure accurately the rotation speed on a single turn, software timing may not be accurate enough, since the Window internal clock readings have lags (read "errors") of more than 10 ms (= 100 rps, about 2 rpm error), even when no other application is running. So either you count (and wait) for a given number of rotations, and calculate an average, or you use hardware timing with a counter on the DAQ card (if any)...
    Otherwise, if you only need an estimate of the rotation speed, you can read the digital line and wait for 2 consecutive changes. The period can be calculated from the time stamps. See the attached vi. Wait a few seconds to observe the variations generated by Windows.
    Merry Christmas, and Happy Wiring !
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Rotation speed.zip ‏14 KB

  • How can I measure time between transitions at digital input

    I am using LabVIEW 6.0 to measure the time duration between 2 transitions in a digital input port. I have a set up including an HP 34970A Data Acquisition unit with the 34907A Multifunction Module plug-in. The LabVIEW program is trying to poll the digital input for level changes and then using the Time function(Tick Count) to check the times at the transitions. However this method doesn't work reliably as I have to measure time periods of 500ms.
    Is there any good way of mesuring time period with the above setup. I don't have a module which connects to the internal multimeter in the 34970A. The other stuff I have are a HP 34903A(Actuator Module) and a HP 33120A(Function/Waveform Generator).
    Any method for m
    ore accurate time measurement with the above setup will be appreciated. If not, what else do I need to make accurate time measurements.

    Frankly I doubt that you're going to be able to measure time interval with much accuracy. You're periidically polling a static digital input and how often you poll is going to vary. You could try polling as fast as possible and eliminate as many background tasks as you can. If your tolerance for the measurement is plus or minus 100 msce, then maybe you'll get a decent measurement most of the time. If it's plus or minus 5/10 msec, then it will never happen. The pc's clock is just not that accurate and a software timed loop on Windows is not deterministic enough. Get a counter/timer board for something really accurate or use a scope to capture the waveform.

  • Generate complement​ary digital signals with dead time between each pulse and controlled by duty ratio

    I am to generate  two complementary digital signals using NI 9606 conected by RIO Mezannine Card to NI 9683 (Half Bridge DO).
    I am able to generate the signals but I am not able to put dead time between high and low signal and also, low and high signal.
    Requirement:
    (1) When the first signal goes high and the second signal goes low, there should be a controllable dead time.
    (2) Also when the second signal goes high and the first signal goes low, there should be a controllable dead time.
    I am able to do requirement 1, but I am unable to fulfill requirement 2.
    Please have a look at my VI and let me know how to go about satisfying requirement 2.
    Attachments:
    complementary test 2.vi ‏69 KB

    Hi Frank ,
    I have already taken note of the example Tannerite has provided  and have built my vi ( attached in previous post) surrounding that example.
    Now I require to control the PWM duty cycle as you can see from the vi using a knob and that control refers to both the signal 1 and 2.
    Now the signal 1 end and signal 2 generation requires a controllable dead time. Similarly, signal 2 end and signal 1 geneeration also requires another controllable dead time.
    I am able to do either one dead time at a time using delay but not two dead time simultaneously.
    I feel that I have two put the delays at the appropriate data flow point. I am working on that.
    I would really appreciate if you could give some insight on how to solve this dead time issue and generate two complementary waveform with dead times whose duty cycle can be controlled by a knob controller in fronty panel .
    I have also posted the required timing diagram for reference as suggested by Tannerite.
    Best regards.

  • How can I measure the time between each two successive rising edges ,using Digital Input ?

    Hello
    I'm trying two measure the time in seconds between each two successive rising edges on a digital input .
    Till now I have managed to detect the rising edge ,increment a counter with each rising edge ,and snap the time at which the rising edge happenned
    all I need now is to subtract the current rising edge time from the previous rising edge time in order to calculate (T) which can be 1/frequency and display it in realtime to the user.
    but I don't know how to do this
    Can somebody please help me !!!
    Solved!
    Go to Solution.
    Attachments:
    Counter without time.vi ‏11 KB

    Woah!  
    Sorry Apok, but your code is becoming way too complicated/messy. I don't think that all of those shift registers or boolean conversion/operators are needed at all.
    If you want to measure the timing between two button presses then this is a different (much less complicated) way. It simply records the timing of the button press into a shift register then compares the two.
    Spoiler (Highlight to read)
    Of course this is a very quick and basic solution just to show you that it can be much simpler than you are making it (remember to use the mechanical actions of the buttons to get the behaviour you want).
    A better way would be to use an event structure looking at value changes of the buttons to determine the timings between clicks.
    -CC
    "If anyone needs me, I'll be in the Angry Dome!"
    Attachments:
    Time between clicks.vi ‏9 KB

  • Creative Zen 8GB not keeping accurate time on cl

    Hello, I am wondering if anyone else is experiencing problems with thier Creative Zen's (mine is an 8GB) not keeping accurate time on the digital clock on the player? My firmware is .2.0 by the way. I have a fully charged battery and noticed yesterday that the time on my clock was way off and needed to be set once more. So I set it correctly yesterday, now 24 hours later, the time is again way off...it thinks it's :6 pm even though it's 0:20 pm as I post this message.
    I have noticed this several times previously and have adjusted the clock accordingly each time...this is not just a random incident.
    I have used the player for several hours today but the battery still has lots of charge left and the unit functions correctly minus this time issue.
    Any feedback or help would be appreciated.
    Thanks,
    Drew

    I too hope that if others are having this problem that they would add their comments to this thread. I know this is a rather small issue, but it is annoying none the less. I mean otherwise my player is rock solid. Yes I could turn off the display of the clock and not rely on it at all (now I don't because it's always wrong) but that means I am settling for a product that does not work as advertised with ALL it's features working correctly. I am being kind of picky but I just want the product to function correctly... I don't think that's being too out of the ordinary with my expectations.
    Anyhow, to make a long story short, I have been issued an RMA number and plan on sending the player off to Creative here in Canada.
    I promised to post a follow-up with a copy of what Creative has sent me for correspondence in case others are interested. Oh and just to be complete, here are my answers to the suggested self-troubleshooting methods in the following email - yes I am running the latest firmware release and I am a clock setting professional now because I have done it so many times.
    I have also searched this forum for other users who may be having this issue and I did not find too many (I found this interesting). So that is why I created this thread. I am starting to notice, at least at this time, a few others who are having similar experiences as I-yup I agree I am not the first to have problems with my MP3 player nor the last. Just was curious to see if this was a common problem or if I was the lucky one of the bunch or one that people just didn't bother to report...
    Regardless everyone's feedback is appreciated and respected.
    Anyhow here is their email:
    Dear Drew,
    Thank you for your contacting us at Creative Technical Support; we
    appreciate the opportunity to assist you.
    I understand that you are having some issues with your Zen player. The
    device does not display the time correctly causing you to reset the time
    frequently. I'm sorry for the inconvenience caused; allow me to offer
    some possible solutions to this issue.
    Prior to sending us an email, I believe you would have gone through some
    basic troubleshooting steps for your player. If not, please refer to the
    Knowledge Base article below:
    How to Use and Troubleshoot Your Zen Player
    http://us.creative.com/support/kb/ar...p?l=2&sid=4763
    To begin, I would suggest you refer to the following Knowledge Base
    article regarding setting the Time and Date on your Zen Player,
    specifically the first part that deals with Zen players in general.
    Changing Date, Time, Clock and Alarm On A ZEN Player
    http://us.creative.com/support/kb/ar...p?l=2&sid=5638
    Subsequently, you might wish to update your player's firmware to the
    latest version. You may use the Recovery Tool to do so. Please follow
    the link below:
    http://www.creative.com/products/mp3...me.asp?region=
    However, if the time on the player still does not display correctly, you
    may need to schedule for a repair or replacement. Please note that your
    product will be tested upon receipt and if no malfunction is found in
    the product, it will be returned to you.
    Please follow this link to have an RMA issued for your product:
    http://us.creative.com/onlinerma
    All applicable fees will be assessed at the time that your RMA is
    processed in an effort to expedite the repair or replacement of your
    product.
    Thank you once again for contacting us. I hope the above articles are
    able to address your concerns. In the mean time, perhaps you might be
    interested in the Creative Aurvana In-Ear Earphones for your Zen player.
    These earphones have been designed to block out 90% of ambient sound,
    thus providing more precise audio reproduction. It would be a great
    complement for your player. For more information about this product, do
    have a look at our website
    http://us.creative.com/products/prod...&WT.mc_id=3862
    If you still require assistance, please reply to this email with any
    previous correspondence to ensure the quickest and most accurate
    service.
    Best Regards,

  • IPhone time when "set automatically" off by 2 minutes (AT&T?)

    I've noticed that the time on my iPhone is about 2 minutes behind what actual time is. I am in Des Moines, Iowa, so perhaps there is some issue with the signal AT&T is sending, but my girlfriend's iPhone also is two minutes off.
    Has anyone else noticed the the automatic time on their AT&T iPhone is not accurate?
    (In my case, accurate time is the time I am seeing on Mac OS X when using the "Set date & time automatically" option in the Date & Time control panel; if I compare at www.time.gov I find the same time, so it sure looks like AT&T is sending the wrong time out.)

    When time is set to automatic on the iPhone, the iPhone displays the time which is being fed to it by the tower to which it is connected at any given moment. Thus if the tower is not set correctly, the iPhone will display the wrong time. You can call AT&T to notify them of significant errors, but switching the iPhone to manual time setting is better in areas where there are significant irregularities, particularly if time stamps vary greatly between towers!

  • 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

  • Best way to capture data every 5 ms (milli-seconds) in the .vi diagram when using "Time between Points, and Small Loop Delay tools" ?

    - Using LabView version 6.1, is there anyway to change the "Time Between Points" indicator of (HH.MM.SS) to only (mm.ss), or to perhaps only (.ss) ?
    - Need to set the data sampling rate to capture every 5 milliseconds, but the defaults is always to 20 or greater; even when the "Small Loop Delay" variable is adjusted down. 
    Thank you in advance.

    I have no idea what "Time between Points, and Small Loop Delay tools" is. If this is some code you downloaded, you should provide a linke to it. And, if you want to acquire analog data every 5 milliseconds from a DAQ board, that is possible with just about every DAQ board and is not related to the version of LabVIEW. You simply have to set the sample rate of the DAQ board to 200 samples/sec. If it's digital data, then there will be a problem getting consistent 5 msec data.

  • Measuring times of digital events on a NI PCIe 6259

    I am trying to figure out how to acquire time stamps every time a digital input (Boolean) changes values relative to the beginning of a AO output. Ideally, I would like to reset the time stamp to 0 each time the AO output occurs (different trials). Both counters on the 6259 are free, however I am already using the ao/SampleClock in my VI. Thank you for any help.

    Hello Joes,
    Since you have 0-30 events which you want to measure the time of, it would be easiest to calculate the time in post processing. You can use a start trigger to trigger both the analog output and the digital input.  Using the start trigger will synchronize the start time. The high to low transitions can be found in the recorded data and the time can be calculated using the position in the data array and the delta time between samples.
    Eric
    Eric Liauw
    AE Specialist - Automated Test | CLD | CTD
    National Instruments

  • How can I increase the transition time between songs on my IPOD?  I do not want a fade.

    How can I increase transition time between songs on my IPOD?  I do not want a fade.

    If Crossfade is OFF, the fadeout is actually part of the recording, so you won't be able to change how it fades.
    If you want to make the silence (gap) between songs longer, there is only one setting I know of that relates to the gap between songs, and it is in iTunes.
    Do a Get Info on a song in iTunes (File -> Get Info OR Cmd-I from keyboard) and go to the Options tab in the Info window.  There is a setting called Part of gapless album.  If that checkbox is checked, the songs are played with no gap.
    I don't know of any other setting in iTunes or the iPod that makes the gap between songs longer.

  • Count time between 2 readings from serial port... help!.

    Hi guys,
    I am using my application to get the readings sent by microcontroller from serial port. It works perfectly. But i have the problem, the pic uses 16bits counter, and sometimes i measure frequency lower than 15hz (65535-->16bits). Thats why I thought to measure the time between each pulse that it recieved in serial port. So i could multiply the reading about the time which spend in arrive to serial port. I know if any pulse spend more than 15hz, i should add 65535 to this reading.
    Then, the idea is count the time spent between each reading in serial port. SInce pics count and later send each turn.
    I dont know if it is possible, and exist any easy way.. Can ayone help me?.
    I would like to see any example of it, always it is possible.
    Regards, Fonsi.
    Attachments:
    capture.GIF ‏19 KB

    You're not going to be able to get even close to 1 usec resolution using the built-in time functions though I don't see any of those in your attachment. The windows clock is simply not that accurate. If you need to precisely time your serial reads you might want to look at using the timed loop. You can set the period of that to 1 msec.

  • Time between pulses

    Hi, I want to measure flow of some fluids. Sensors give a binary pulses per 10l. I made  a vi which do it but I think there is some bug in Lab view 8.2
    I used math script for this calculation . I want to use PCI 6510 as digital card for this. In my program it was used simulation for this card.
    What was a problem?
    It works correctly, but when I press in front panel in (for example) place for indicator of flow(mouse cursor) it start to calculate quickly. I am afraid this qcould be a wrong situations in application.
    How can I solve this problem??
    Thanks
    Emir O.

    Hi Emir
    Since the reading of a digital measurement from the PCI-6510 is software time base we have to get the stamps inside the while loop using one of two functions, the first one can be the “Get Date/Time in Seconds”, this function will give you the current time every time the loops runs in a date/time format. The other function is the “tick” function (see code attach) that will give you the time in milliseconds.
    Both cases you will have to save the timer value in an array with the digital value read from the card, for simplicity you can bundle the data with the timestamp into a cluster, from here a little bit of array manipulation and calculation will give you the time between pulses; this calculation has to be program by you. Always remember that since you have software timed application all these measurements are depended on how good your code is written and your computers speed. What I will suggest is to use Producer/Consumer design pattern were you read the data with the producer and make all the calculation with the Consumer.
    I will also suggest taking a look at this DevZone article since you are using a simulated device: NI-DAQmx Simulated Devices.
    Message Edited by Jaime F on 11-05-2007 12:57 PM
    Jaime Hoffiz
    National Instruments
    Product Expert
    Digital Multimeters and LCR Meters
    Attachments:
    Read Dig Port1.vi ‏31 KB
    time stamp.JPG ‏80 KB

  • Time between songs

    My grandson, not particularly noted for his patience, claims his first generation shuffle doesn't work properly. In tolerance only a loving grandfather can exhibit I have played his music (which I neither like nor understand) for several hours in both modes and checked out the forward and back buttons. All seems to be working satisfactorily. THE QUESTION: the time BETWEEN selections varies between three or four seconds to 15 or 20 seconds and can be as much as 90 seconds. Is this normal? If not, is there a remedy? My understanding is that some songs have been downloaded from iTunes and some have been ripped from CDs.
    Dell Dimension 4550   Windows XP  

    I don't think you can crossfade songs on a shuffle--the songs are loaded exactly as they are ripped. (You can crossfade in iTunes to reduce/eliminate silence between tracks.)
    Many songs have extra space at either the beginning or end of them. 90 seconds sounds a bit long--but believe it or not I once discovered a 17 minute song on my playlist. I knew the song didn't go on forever, so I checked it out. It turns out it was the last song on the album and when the album was cut the song was never ended--the track just ran until the end of the CD (the song itself was only about 4 minutes).
    Your grandson should note some of the songs that display these unusual gaps between tracks and then look at the actual song file.
    If you have sound editing software, you can cut off the dead space at the beginning or end of songs. It's pretty easy to do this because the songs display as sound waves--and dead space is just a straight line. You can safely snip off the straight lines, re-save the sound file, re-import into iTunes and the problem will be solved.
    Or, you can live with the space between tracks knowing there's not much you can do to change it within iTunes.
    The only other option is for you or your grandson to burn a CD of songs with no tracks--so it will re-import as one long track. There won't be any spaces, but there won't be any option to shuffle the music either, because it will look like one song to iTunes.

  • E-series. Time between 2 leading edges w/ GPCTR

    We are attempting to acquire the time between 2 first leading edges with 2 light screen signals coming into PFI_9.  The light screen signals send pulses to PFI_9 independently and one at a time.  However, we realize that we sometimes get multiple pulses subsequent to first pulses on each screen and this yields erroneous GPCTR times between first leading edges.   
    We want just the first edges of each screen.  If need be, we can separate the lines from the screens so that screen 1 goes to PFI_9 and screen 2 goes to PFI_4, or some other such recommendation.  If we do that, what might the code look like?
    Attachments:
    ScreenPulses.doc ‏49 KB

    I would bring the signals in on two different PFI lines and approach the problem like this:
    1. Create a Pulse Generation task on one counter (CTR0) to trigger off of the first light screen pulse.
    2. Setup a second task on CTR1 to count edges on CTR0. Set this task to stop (or pause) when it sees the second light screen pulse.
    3. Now you have the amount of time between the pulses (Take the amount of events counted and divide by the frequency of the pulse train generated on CTR0).
    I don't know if this will help you or not, but here is an example of doing this in LabVIEW. The example is in DAQmx which I would recommend using if your hardware supports it. I am attaching a screenshot. If you don't have LabVIEW at least you'll be able to see the program flow from the screenshot.
    I hope this is helpful!
    Garrett H
    National Instruments

Maybe you are looking for

  • Problem with Sales Set in ECC 6.0

    Hai Guys, I am having a problem on having a Sales Set. We have two company codes. I am creating the sales set by the following steps. 1. Create an article, (type: Sales set instead of single article) and in the Basic Data, click the components button

  • I forgot my icloud password. How to restore my iphone5 without it?

    I don't have my icloud password. How to restore my iphone 5? I already created a new apple ID and is asking me for the old one.

  • Photoshop Elements 12 Editor crash on launch

    This is a new (3 month old PC) with Photoshop Elements 12 loaded (installed when PC was new).  It has run without any issues until the last week when it has started to fail to launch.  The PC is running Windows 7 - 64 bit.  Crash Report: Problem sign

  • Anchored Text Objects Verticle Top

    I'll spend more time asking than it may take to fudge it into place, but, see the anchored graphic. I placed it inline because there will be a lot of reflowing and fitting left to do. It is limiting my ability to align the top margins for this two co

  • Where did multiple saved login names go in ios8 Safari?

    Where did multiple saved login names go in ios8 Safari? In io7 you could have multiple logon names for a given webpage, and select which one you wanted, and even though these different names are saved in saved passwords in the Safari settings, I can'