Starting and stopping Elapsed Time

I have some code in LabVIEW 8.2.1 I am writing for Qual test with a customer. The basics of the test are the following: monitor and record pressure (thru transducers), temperatures (fluid and ambient), and monitor the opening and closing a valve. The valve has two light switches orientated in such a way, that mechanical counters will count a cycle when it is fully closed to open to closed.
The problem I am having, is that I need the elapsed time vi to start counting, once it has moved off of the full open switch. It needs to count to 240 seconds, at which time it will pass on to an on bit, which will energize the valve again. I can get it to start running at the right part, but it will stop once
it gets in between the two light switches. It almost seems like the elapsed time vi doesn't have enough flexibility for what I need. That or I need to write a bunch of code that would enable it to do what I want.
I am not sure on how I can post code so it can be viewed in LabVIEW, so here is a word doc.
Attachments:
elapsed timing vi.doc ‏45 KB

Hello Chadius, 
Thanks for posting,
I took a look at your code this morning. We at NI recommend using varibales as one of the last resources when trying to pass data out in cases where this is rseally necesary, when looking at your code I realized that the variables to pass data are not needed and that actually there are some misconceptions about the functionality of the vi funtions, do not be ashamed that is totally understandable when you are new to a concept and more understandable if you are new to labVIEW.
Before proceeding with the code I would like to encourage you to check the Getting started with LV It gives you the basis to start programming in labVIEW and helps us understand better how LV executes.
There is also a lot of good help loaded in Labview that can help us determine what to use and what is expected of each function, you can access this by pressing ""CTRL+H" and accesing the detailed help when hovering over a specific VI and clicking detailed help.
Then if you are a new user to labview and would likely use labview for long term development I will suggest the training.
Now, getting to your code I can see that you are doing a bit more code than what you actually need, so for instance:
-we can eliminate the constants and the selector and just pass the boolean.
-we can also use less while loops so the part where you write to the variables can be done in the same while loop on the right.
-Instead writing to the variable and reading from that same variable you can just wire a cable so you have the same data
-You can use the error wire out/in of the functions to control code execution.
Last but not least, I am asumming here that this application you are coding is most likely to be a state machine where you are making a choice depending of the inputs you have, If "A" then "B"
This is an example of a simple state machine based on user input, you can change that input to be an event, a trigger etc.
Hope this helps, 
Luis
Application Engineer
National Instruments. 
Attachments:
LV_Getting_Started.pdf ‏918 KB
This way looks better.JPG ‏20 KB
Delete constants pass only bbolean.JPG ‏15 KB

Similar Messages

  • Starting and Stopping a Timer in Java Card + GSM

    Hi,
    I seem to not be able to start a timer that my applet has
    allocated using the PRO_CMD_TIMER_MANAGEMENT
    pro active command. I want to for example set the timer
    interval to 5 seconds and I understand from the gsm
    specs that the TLV value should then be {(byte) 0x00,
    (byte) 0x00, (byte) 0x05} as the hour is zero, the minute is
    zero and the seconds = 5 .
    The command qualifier I set to 0x00 to start the timer and
    I set it to 0x02 to stop the timer. The start and stop I
    control from two menu items. From the GSM spec the first 2 bits
    control the timer and the remaining 6 are RFU (reserved for future use),
    now I assume I can then set the RFU bits to 0.
    I then have a EVENT_TIMER_EXPIRED in my processToolkit which then plays a tone.
    The tone proactive command works but I dont seem to be able to start the time or
    stop it ?
    HELP ?
    is there any suggestions or any error in my reasoning here ?

    I tried your solution but it seems to have no effect (?)
    This is the log entry of the comms during sneding of the timer start
    command:
    (Notice that where you have the Timer Identifier tag = A4, here it is
    24 and where you have Timer Value Tag = A5, here it is 25 - these tags and the APDU's are generated with the GSM java card libs in the development kit I'm using.....) It seems to go through but the TIMER_EVENT_EXPIRED never happens....Help ? Have a look at the source code I included (maybe I'm doing something wrong)....
    **THE APDU's
    //346:
    A0 12 00 00 13
    //Fetch
    //     RAPDU = D0 11 81 03 01 27 00 82 02 81 82 24 01 01 25 03 00 00 10
    //     SW = 9000
    //347:
    A0 14 00 00 0C 81 03 01 27 00 02 02 82 81 03 01 31
    //>>Terminal response
    //     SW = 9142
    **SOURCE CODE
    //IN A METHOD CALLED FROM A MENU ITEM SELECTED
    byte[] valCurrentCallUnit = {
    (byte)0x00, (byte)0x00, (byte)0x10
    }; //i.e. 1 second
    timerHandle = reg.allocateTimer();
    proHdlr.init(PRO_CMD_TIMER_MANAGEMENT,(byte)0x00,DEV_ID_ME);
    proHdlr.appendTLV((byte) TAG_TIMER_IDENTIFIER,timerHandle);
    proHdlr.appendTLV((byte) TAG_TIMER_VALUE,valCurrentCallUnit,
    (short) 0, (short) 3);
    result = proHdlr.send();
    //the following is not suppose to be required according to GSM 11.14
    reg.setEvent(EVENT_TIMER_EXPIRATION);
    //IN THE processToolkit method, I have:
    public void processToolkit(byte event) {
         EnvelopeHandler envHdlr = EnvelopeHandler.getTheHandler();
         ProactiveHandler proHdlr = ProactiveHandler.getTheHandler();
         ProactiveResponseHandler rspHdlr;
    switch(event) {
    case EVENT_TIMER_EXPIRATION:
    doSomething();
    proHdlr.init(PRO_CMD_TIMER_MANAGEMENT,
    (byte)0x00,DEV_ID_ME);
    proHdlr.appendTLV((byte) TAG_TIMER_IDENTIFIER,timerHandle);
    proHdlr.appendTLV((byte) TAG_TIMER_VALUE,valCurrentCallUnit,
    (short) 0, (short) 3);
    result = proHdlr.send();
    break;
    } /** switch event */
    }/** processToolkit */
    Any help would be appreciated....

  • I am having data i want to measure pulse width without using hardware and tell me how to start and stop soft timer using labview

    soft pulse width measurement

    If you are creating a pulse in software somehow, then you can use Pulse Measurements.vi that's on the Analyze>Waveform Measurements palette. This will require that the input is of the waveform data type with signal and timing information. There's several timing functions on the time & Dialog palette that you could probably use. Check out Tick Count and Elapsed Time. If you could provide more details on what exactly you need to do, we could provide more help.

  • Starting and stopping timer using external inputs interfaced with labview

    hello,
    I have trouble finding how to start and stop the timer using external voltage or current pulse. we are interfacing a circuit to labview. so for that we need to count the time it takes between the two external voltages. We have to keep on comparing the voltages to some reference voltage. And when the external voltage crosses the reference voltage we have to start the timer and again we have to stop the timer using tha same logic. We need it for time calculation between the triggers.
    hope you can help.

    https://decibel.ni.com/content/docs/DOC-23334 is agood example to start. You need to modify it to include stop trigger.

  • I do not have the 'Advanced' tab on the menu bar. I am trying to change ringtone on my iphone 4s. Have done the following: Right cick on song, entered the start and stop times, but unable to proceed as need 'Advanced' tab in order to change to option.

    I do not have the 'Advanced' tab on the menu bar. I am trying to change ringtone on my iphone 4s. Have done the following: Right cick on song, entered the start and stop times, but unable to proceed as need 'Advanced' tab in order to change to option.

    You don't need to upgrade your software.  But if you're struggling with Spry, IMO you should cut your losses and switch to something better for the longrun.
    If you have a budget to work with, I highly recommend Project Seven's Pop-Menu Magic 3.  It's easy to use in DW CS4, 5, 6 or CC.  More importantly, it's bullet proof and works in all devices. 
    Pop-Menu  Magic3 by PVII (commercial DW extension)
    http://www.projectseven.com/products/menusystems/pmm3/index.htm
    If you don't have a budget to work with, you can roll your own menus with jQuery plugins.  A bit more effort on your part, but they perform better than Spry.
    jQuery Superfish
    http://users.tpg.com.au/j_birch/plugins/superfish/
    jQuery MegaMenu2
    DEMO:
    http://www.geektantra.com/projects/jquery-megamenu-2/
    DOWNLOAD:
    http://code.google.com/p/jquery-megamenu/
    Nancy O.

  • In Month View, showing start and stop times for appointments

    Hi, I want to show both the start and stop times for all appointments in my iCal Month view and have not been able to figure out how to do that. Any suggestions? - Dave

    I would also like to know how to do this if possible. I want to print month-view schedules with start and end times for events. Thought I'd bump this up to see if anyone has any ideas.

  • Printing event start and stop times

    In month view, is there any way to have both the start and stop times for an event show when you print the calendar so you can see the duration of an event - thanks.

    You might be able to use this script to reset the start/stop times to zero.  Try with a small selection and see if it works for you.
    http://dougscripts.com/itunes/scripts/ss.php?sp=batchtrimtime

  • My ipod nano 7th gen. won't save the changes I make to a song's start and stop time. How do I fix this?

    So I have a few songs that I don't like the intro to or the end of it that I had cut to where I wanted on my previous ipod. When I try to do the ame thing with this one with the start and stop time, it will work for awhile and then randomly start and stop where it had originally. I have done it like 4 times now for some songs and I can't seem to get it to stick. Suggestions?

    If you use the Sync feature in iTunes, then it needs to be done to the song in your Music Library, then synced with the iPod.  If you do not use the Sync feature and are performing the changes to the song on your iPod specifically, then the setting may be getting overwritten when you drag the song that's already on the iPod back onto the iPod.  It will overwrite all local settings for the song on the iPod with the settings in your library. 
    Try performing the changes to the song in your music library, and then dragging it back over to your ipod (or Sync your iPod if you use that feature).  This will make sure that the setting are consistent in both your library and iPod in-case you were to ever overwrite the song once more.

  • Hard drive starts and stops a few times

    I went to my parents for the Christmas holidays today and tried to use their older computer to put music on to my iPod. Since it's so old I couldn't use iTunes, so instead I used Ephpod. After it was done copying the files to the iPod I saved the changes and disconnected, but immediately afterwards instead of going straight to the menu, the hard drive started and stopped about 10-15 times with the Apple logo being displayed. Now I can't reach the menu, the hard drive will start and stop spinning until it gives up, and when I reconnect it to the computer it won't even recognize it as an external drive. Any ideas?
    eMac   Mac OS X (10.4.3)  

    I have the same issue and the iPod wont reset.

  • I am trying to do a full Time Machine Backup to a new external disk. The backup starts, and it says "Time remaining about 4 days." That seems like a very long time, but the real problem is that the computer "logs off" after a few hours, and the b.u. stops

    I am trying to do a full Time Machine Backup to a new external disk. The backup starts, and it says "Time remaining about 4 days." That seems like a very long time, but the real problem is that the computer "logs off" after a few hours, and the backup stops. The system preferences are set to "Never" for Computer sleep and Display sleep. The computer does not ordinarily log off automatically, but it has done this twice since I started the Time Machine backup.

    If you have more than one user account, these instructions must be carried out as an administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Enter the word "Starting" (without the quotes) in the String Matching text field. You should now see log messages with the words "Starting * backup," where * represents any of the words "automatic," "manual," or "standard." Note the timestamp of the last such message. Clear the text field and scroll back in the log to that time. Select the messages timestamped from then until the end of the backup, or the end of the log if that's not clear. Copy them (command-C) to the Clipboard. Paste (command-V) into a reply to this message.
    If all you see are messages that contain the word "Starting," you didn't clear the search box.
    If there are runs of repeated messages, post only one example of each. Don't post many repetitions of the same message.
    When posting a log extract, be selective. Don't post more than is requested.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Some personal information, such as the names of your files, may be included — anonymize before posting.

  • Is there a DJ app for the Ipad that will read the "start" and "stop time" setting for each individual song, as they are set in the song Options screen in Itunes?

    Is there a DJ app for the Ipad that will read the "start" and "stop time" setting for each individual song, as they are set in the song Options screen in Itunes? The Ipod Touch, by itself does not allow cross-fading, therefore when the stop time is edited short, the song jusst truncates then goes to the next song. I tried the DJay ap and while it would crossfade, it would NOT read the song settings for the stop marker. So now I want to try and Ipad and see if there is an app that will READ the Itune stop settings within the song. I do NOT want an app that will allow me to DO the stop marker. I want an app that will READ the stop marker from the song as it is set in Itunes.

    Itunes provides the option for setting the Start and Stop times of each music track.  However, the start and stop times do not synchronize to the iPhone.  I don't understand why this option is even available as it doesn't work when listening to music on the phone.  I have not found another application that will support the start and stop time markets.  I have searched quite a bit for this but can't find anything.  I hope we can find something. 

  • Programmatically starting and stopping my vi at set times

    I have a vi that runs during every production shift, however the running and stopping of this vi is currently manual, requiring a user to start and stop the vi at the appropriate times. I would like a way of programming the vi so that it starts every weekday at 6:55am and stops every weekday at 15:05pm. All my while loops run if engine status is TRUE, so I wondered if starting/stopping the engine appropriately would be sufficient. I will need to reinitialise all my values from the previous day – does this happen automatically by stopping/restarting the engine? I would also like to ignore weekends if possible.
    I have attached the vi that I would like to automatically start and stop. If anyone knows the best way to program this (slightly messy) vi, then I would greatly appreciate the help.
    Thanks to all,
    Stuart
    Attachments:
    HC2 Efficiency Information SW Edit (rev 10).vi ‏1202 KB

    My LV8 is having issues this morning and does not want to open the VI I sent you, so I jsut created the loop that I had added.  It is very simple, but should get you started.  It does not ignore weekends I have not had time to work on that.  You could do something like every time the start time is triggered, increment a counter and when the counter hits 6 (saturday if you start counting on monday), do not start the engine and then when it hits 7 reset the counter.
    Good luck and post back if you have more issues.
    Kenny
    Kenny
    Attachments:
    start stop.vi ‏16 KB

  • Reset song start and stop times

    Resetting start and stop times for all songs.
    Hi. I recently trialled a DJ BPM matching software product and unknown to me, it scanned all my songs and in the majority of cases, put new start and stop times (in seconds) so now when I play my songs in iTunes, they either start to play early and/or stop playing before they are complete.
    I can go and reset these parameters manually but I have 5000 songs so wondered if there was a utility or a file I could edit that would do this for me as its really annoying that the DJ software didnt reset these when I uninstalled it at the end of the trial period.
    Thanks
    Jason

    You might be able to use this script to reset the start/stop times to zero.  Try with a small selection and see if it works for you.
    http://dougscripts.com/itunes/scripts/ss.php?sp=batchtrimtime

  • I am trying to create a ringtone, when I right click and and go to get info I can't open anything under options. Itunes is not allowing me to do anything under options including changing the start and stop times. ??

    I am trying to create a ringtone, when I right click and and go to get info I can't open anything under options. Itunes is not allowing me to do anything under options including changing the start and stop times. ??

    GarageBand '11 - Create an iPhone ringtone - Apple Support

  • FLV starting and stopping at specific times?

    Im using the flvplayback to put up a video in my swf.
    in my swf i also have several buttons.
    the thing i want to do is when i for example click a button i want to
    start playing the movie from 5 seconds in it and then stop the movie at for
    example 10 seconds in it. even if the video is 20 seconds long i want to
    be able to stop it automatically at 10 seconds in the movie. the start and stop should be
    controlled from the button..
    i know how to start the movie at a specific time but i dont know
    how to stop it at a specific time. is this possible?
    thanks for helping med out!

    FLVPlayback class has a property playheadTime.You will need to read the value of it periodically - so when a desired time is reached, you implement required functionality.
    To do that you will need to add either Event.ENTER_FRAME listener or instantiate Timer class or setInterval method for reading playheadTime.

Maybe you are looking for

  • GL Account Balances by Trading Partner

    Hi All, Our client has a requirement wherein he wants to know if there is any standard report through which we can find out the GL Account Balances by Trading Partner i.e. the user wants to see the GL account Balnces Broken down by trading partner. W

  • Ignoring non-ASCII characters in XML file.

    Hello all who read this, I got the following problem. Trying to read an XML file which contains UTF-8 characters. My database doesnt support UTF-8 char set .... obviouselly. Below you will find my procedure for parsing XML file ... now i was wonderin

  • How to write on new a line in "Comments"

    For things such as photos and folders, if we click "Get info", we can write in an input area called Comments. I am inputing a lot of information and I need to have paragraphs or starting on new lines to make things more tidy. How can I start writing

  • Precautions for performing a system copy

    Respected Guru's I have to perform a system copy, should i reconfigure STMS after the copy. Should i follow any precautions before performing a system copy in STMS. Thanks and Regards, Dayanandan.

  • Can i transfer music from my mac to my windows formatted ipod?

    just got a mac, it is safe for me to transfer music from mac to my old iPod which was formatted for windows?  My mac can read my device in fact i could see the songs stored in my iPod from my iTunes,  im just worried if I can transfer music...please