Count the time that the output is active

I have made a program with a state machine, but I have one problem. I don't know how I can count the time that the output is active. I have tried several things, but the timer doesnt do what I want. The one time it counts up, also when the output is not active, or it starts counting again (start at 0) everytime its active.
Furthermore I have made a delay before the output is active and a delay when a other output is active. The first time it runs it works, but the next time it also doenst work. I think the source of this problem is the same as the one from the counter but I dont know for sure.
Can anybody help me with this? See the attachment for my VI. The counter is in case "pump up 10".
Attachments:
Probeersel state machine2.vi ‏92 KB

I have made a quick draft copy .You can further implement additional logic.
Attachments:
Probeersel state machine2.vi ‏43 KB
States.ctl ‏5 KB

Similar Messages

  • How to measure how long the output is active

    hi all, 
    i want to make a vi that measures how long the output is active, i was thinking about measuring the current but that would take up more control lines and i dont want to do that.
    so my question is how can i either 
    1) measure how long the output is active
    2) measure the current output from that channel, ie if i am outputting voltage is there a way for me to record the current output without using an additional channel
    thanks all 

    sorry i dont usually post questions on forums.
    i am activating a motor but only when it is outside of the limits, and so the current draw will be variable, i can measure the current during the calibration phase and then mulitply the voltage by the time that function has been active, but i was wondering whether or not the current itself can be measured and sourced on the same channel. 
    it is basically an on off controller and therefore the switching time would be rapid, however i have saturated the input to ensure it would not switch so eratically. 
    the output can remain active indefinately if outside the limits
    i was just curious whether or not it was capable of measuring the current being sourced from the channel i assumed that it may have that capability since some bench powersupplies display the current output on that channel 
    thanks for your responses

  • So I have been using my iPad for a few months now and I recently noticed that the time display next to the playlist name in the music  app that is supposed to display the total song count and time of a playlist is way off. I have a 25 song playlist that 2

    So I have been using my iPad for a few months now and I recently noticed that the time display next to the playlist name in the music  app that is supposed to display the total song count and time of a playlist is way off. I have a 25 song playlist that is around 2 hours on my computer appears as 2003 minutes on my iPad.  It's a smart playlist limited to 25 songs if that makes any difference. Is this happening to anyone else? Any help would be appreciated!

    Greetings,
    First make an iCal backup, File > Export > Archive.
    Remove the following to the trash and restart your computer:
    Home > Library > Caches
    Home > Library > Calendars > Calendar Cache, Cache, Cache 1, 2, 3, etc. (Do not remove Sync Cache or Theme Cache)
    Home > Library > Preferences > com.apple.ical (There may be more than one of these. Remove them all.)
    __NOTE: Removing these files will remove any shared (CalDAV) calendars you may have access to. You will have to re-add those calendars to iCal > Preferences > Accounts.
    Once the computer is back up and running open iCal and test.
    Hope that helps.

  • How can I count  time that a computer has been connectted with the internet

    I want to count the time which a computer has been connectted with the internet?
    I had already tried several times,
    one is socket,
    second is Runtime.exec("ping -n 1"+ip)
    I don't think they are better;
    do you have another idea?

    The internet is a conceptual entity not a physical entity so you are never connected to it.
    As a conceptual entity the internet is represented by a cloud of computing devices (computers, gateways, routers, etc.)
    Your computer connects to a another computer by being routed through various devices and then finally connecting to that remote computer.
    Depending on various thing you can measure the time that you can connect to other devices by either pinging a common IP in the internet (such as yahoo.com) or by pinging the router that that represents the entry point for your cloud (such as the router/gateway of your ISP.)
    If you are concerned about a particular connection, such a specific remote computer, then using a socket and sending a 'keep-alive' message and recieving the response is the best way to track that.

  • How do I reduce the time from the detection of a input threshold to changing the output?

    Hi,
    I am using LabWindows 8.1 and a PXI-4461 with Vista (home) on a 2.81 GHz Dual Core Processor.  I wrote code to do the following:
    (1) output a ramp, input a signal concurrently (precise sychronization of these two is not important at this point)
    (2) if the input signal rises above 0.5 V, hold the output constant for 2 seconds, while continuing the input
    (3) finish the ramp
    More info: I do a continuous sampling, with 4 samples per Write, to do the output.  The input is read and analyzed with RegisterEveryNSamples (where N = 4).  The communication between the tasks is through a global variable "trap," which is set to 1 when threshold is reached.  I achieve holding the output constant by stopping the task (maintain existing value = true), and then restarting after the pause.  At 40kHz and 4 samples per Write, the limit imposed by the discrete data blocks would be  0.1 msec, but in fact I am getting delays of about 2.5 msec.  My write buffer is 120x4 samples, just so that there is space for me to write.  I do need to save the input data after the
    acquisition, preferably the whole sweep, but most importantly the data
    while the output is held constant.  
    So my questions are:
    (a) Does it really take 2 ms to stop a task? When I put in "Timer()"  functions as below, I get a difference of 0.002, which is of course limited to the resolution of the Timer() function. Returning from a function (the EveryN callback) should not take that long, right?
    (b) Can you suggest any better ways of doing this?
    /*****begin excerpt *****/
    DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent(inputTaskHandle,DAQmx_Val_Acquired_Into_Buffer,4 ,0,EveryNCallback,NULL));
    DAQmxErrChk (DAQmxWriteAnalogF64(outputTaskHandle,480,0,10.0,DAQmx_Val_GroupByChannel,outData,&written, NULL));
    DAQmxErrChk (DAQmxStartTask(inputTaskHandle));
    DAQmxErrChk (DAQmxStartTask(outputTaskHandle));
        for (count =120;count<10000; count++)
            if (trap==0) {
                DAQmxErrChk (DAQmxWriteAnalogF64(gTaskHandle,4,0,10.0,DAQmx_Val_GroupByChannel,&outData[count*sampsToWrite],&written,NULL));
            } else {
                    DAQmxErrChk (DAQmxStopTask(outputTaskHandle));
                    time2 = Timer();
                    done = 1;
                    ProcessDrawEvents();
                    ProcessSystemEvents();
                    Delay (2.0);
                    trap = 0;
                    count++;
                    DAQmxErrChk (DAQmxWriteAnalogF64(outputTaskHandle,480,0,10.0,DAQmx_Val_GroupByChannel,&outData[count*4],&written,NULL));
                    count = count+119;
                    DAQmxErrChk (DAQmxStartTask(outputTaskHandle));
    /*****end excerpt *****/
    int32 CVICALLBACK EveryNCallback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples,void *callbackData)
        DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,nSamples,10.0,DAQmx_Val_GroupByScanNumber,&readData[inCount*nSamples],nSamples,&numRead,NULL));
        if (trap == 0 && done == 0) {
            for (i=0; i<nSamples; i++) {
                if (readData[inCount*nSamples+i] > 0.5) {
                    trap = 1;
                    time1 = Timer();
                    break;
        } else done = 1;
        inCount++;
    Error:
        return 0;
    I would appreciate any help or advice! Thanks.  (Sorry about oddities in the code.)

    There are a number of applictations like Carbonite, Aperture, Entourage, VM Fusion, Parellels, etc that treat any change to the application as a complete change to application's database.
    So, if you make one small email change in Entourage for example, the entire database is backed up on the next pass. As you might imagine, this can fill up a Time Capsule very quickly.
    Suggest that you download a utility like BackupLoupe to find out exactly what is being backed up on each pass. Then you can exclude that item from backups if you wish.
    http://soma-zone.com/BackupLoupe/

  • LabVIEW 6.1 If For Loop count terminal is zero then value going through the loop is not passed on to the output of the loop

    Hello, one of our customers just encountered an execution error in a vi running under LabVIEW 6.1, which doesn't exist under LabVIEW 5.1 or 6.01. I have a simple vi that has two encapsulated For Loops. Two string arrays go in, one goes out of the outer loop. Inside the outer loop the first array is indexed. The string which results from this indexing is compared with all other strings from the second string array in the inner loop. If it matches one of the strings of the second array, it is not outputted, otherwise this string goes through the inner For Loop to the output of the inner loop and from there to the output of the outer loop. The count
    terminal of the outer/inner loop is connected to the Array Size of the first/second string array. If the second array is empty, that means that the element in test from the first arry cannot match anything from the second array, so the element in test is send to the output of the inner loop and from there to the output of the outer loop. This works fine in LabVIEW 5.1 and 6.01, but NOT in LabVIEW 6.1. In LabVIEW 6.1 the inner loop is never executed if the count value is zero (which is correct), but the data line running through the loop is not executed either, which is different to what LabVIEW 5.1 and 6.01 do. There, the input string is sent to the output of the inner loop correctly even if the loop counter is zero. The solution is easy - I just have to connect the output of the outer loop to the data line BEFORE it enters the inner loop. But: I don't know if this is a LabVIEW 6.1 bug or if it is supposed to be a feature, but it brings some incompatibility in programming between the
    different LabVIEW versions.
    Best regards,
    Gabsi

    Hi,
    When a for-loop runs zero times, all outputs are 'undefined' (and should
    be).
    Besides, how would LV know what the output of a not executed routine should
    be?
    It might be handled differently in LV5 and LV6, which is unfortunate. In
    both cases, the result is undefined.
    It's not a bug. It's just something that should be avoided in any LV
    version.
    > The solution is easy - I just have to connect the
    > output of the outer loop to the data line BEFORE it enters the inner
    > loop. But: I don't know if this is a LabVIEW 6.1 bug or if it is
    In some cases this does the trick. But if the data is changed in the inner
    loop, this will effect the results if the N is not zero.
    Technically, I think the output in this construction is also 'undefined'.
    But LV handles this as expected / desired.
    Another solution is to use a shift register. If N is zero, the input is
    directly passed through to the output.
    Regards,
    Wiebe.
    "Gabs" wrote in message
    news:[email protected]...
    > LabVIEW 6.1 If For Loop count terminal is zero then value going
    > through the loop is not passed on to the output of the loop
    >
    > Hello, one of our customers just encountered an execution error in a
    > vi running under LabVIEW 6.1, which doesn't exist under LabVIEW 5.1 or
    > 6.01. I have a simple vi that has two encapsulated For Loops. Two
    > string arrays go in, one goes out of the outer loop. Inside the outer
    > loop the first array is indexed. The string which results from this
    > indexing is compared with all other strings from the second string
    > array in the inner loop. If it matches one of the strings of the
    > second array, it is not outputted, otherwise this string goes through
    > the inner For Loop to the output of the inner loop and from there to
    > the output of the outer loop. The count terminal of the outer/inner
    > loop is connected to the Array Size of the first/second string array.
    > If the second array is empty, that means that the element in test from
    > the first arry cannot match anything from the second array, so the
    > element in test is send to the output of the inner loop and from there
    > to the output of the outer loop. This works fine in LabVIEW 5.1 and
    > 6.01, but NOT in LabVIEW 6.1. In LabVIEW 6.1 the inner loop is never
    > executed if the count value is zero (which is correct), but the data
    > line running through the loop is not executed either, which is
    > different to what LabVIEW 5.1 and 6.01 do. There, the input string is
    > sent to the output of the inner loop correctly even if the loop
    > counter is zero. The solution is easy - I just have to connect the
    > output of the outer loop to the data line BEFORE it enters the inner
    > loop. But: I don't know if this is a LabVIEW 6.1 bug or if it is
    > supposed to be a feature, but it brings some incompatibility in
    > programming between the different LabVIEW versions.
    > Best regards,
    > Gabsi

  • How can one counter be sources (or gated) with the output of the other?

    I'm trying to use the counters to generate a square pulse train that contains a certain number of pulses (on 6036E). For that I need to gate counter0 with the output of counter1. The manual seems to indicate that I need to use
    GPCTR_Change_Parameter (deviceNumber, ND_COUNTER_0, ND_GATE, ND_COUNTER_1) ,
    however it makes no difference to the output; I see no gating. What am I doing wrong? Am I missing something?
    I would also like to source counter1 with the output of counter0. There's a similar function call to choose the source signal, but so far I've been unable to source a counter with anything but the internal timer.  I guess the reason for it might be the same as the gating problem.
    Petro

    Hi Petro-
    This example shows how to output a finite gated pulse train on an E Series board.  It mentions that it is a CVI example, but the main .c file does not include any CVI-specific functionality so it should work if you're using ANSI C.
    Equivalent functionality is available in NI-DAQmx for your board and is considerably more intuitive.  An example of pause-triggered pulse train generation is available in the "C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Counter\Generate Pulse\Dig Pulse Train Cont-Pause Trig" directory of your local drive.  One method to generate the "pause trigger" pulse train is shown in "C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Counter\Generate Pulse\Dig Pulse Train-Cont" .
    I'm not sure what you mean when you say "I would also like to source counter1 with the output of counter0."  What do you need to perform this operation for?  The reliance of counter 1 on counter 0 and counter 0 on counter 1 creates a type of circular reference that is almost guaranteed to be problematic.
    Hopefully this helps-
    Tom W
    National Instruments

  • Time machine space questions, not the same as Activity Monitor

    Hello
    I am new here and kindly ask your thoughts on what I am seeing.
    I have a 13" MacBook Pro early 2011 with OS 10.7.5
    Earlier this year I tried an upgrade to a new OS and experienced a failure that required me to make a visit to the Apple store.
    I believe they reinstalled the OS and if I remember correctly I just did a recovery with the Time Machine backup I had.
    While that backup was not very recent, yea OK I get that was stupid, what was odd was that not all my files were backed up.
    I lost a significant number of files from April 2013 until the time of the failure in 2014, for reasons I have no clue as to why.
    My Time Machine does not have any excluded files as far as I can tell.
    So my first question is:  Can anyone help me understand what may have happened and how to counter that?
    Then yesterday I decided to invest in a new backup external drive.
    During the process of setting it up and doing the 1st Time Machine backup on that, I noticed the following:
    In Activity Monitor under the "Disk Usage" tab shows the Macintosh HD as using 258 of 319 GB, and then selecting my user name it shows using 578 of 639 GB.
    When I did the backup with Time Machine it backed up approximately 250GB.
    I thought Time Machine backed up the entire HD.
    What is the difference between the Macintosh HD space and the user space in terms of usage and total?
    Should I be worried or visiting the Apple store again?

    OK, done.
    I created a text.txt document containing the words "Version 0". I saved it to the Desktop, closed it and selected "Back Up Now" from the Finder.
    Waited for that to complete, opened the test.txt document again, modified it by adding the words "Version 1", saved it, closed it and selected "Back Up Now" again.
    Repeated that twice more, so the end result was a Text.txt containing the words "Version 0", "Version 1", "Version 2", and "Version 3".
    I expect that I should now have three versions from which to choose to restore, all from different times, plus the latest one still on the Desktop.
    Creation and backups now complete, so the next step was restoration:
    From the Finder, I used "Enter Time Machine" and verified that I had four different recent times from which to choose. I chose the original text.txt document and elected to "keep both files". It restored the original, which I opened and verified it contained nothing but the text "Version 0".
    I repeated this for the subsequent version. I opened that one and confirmed it contained the words "Version 1".
    I repeated this for the subsequent version. Now I have three restored text.txt documents, plus the one on the Desktop.
    I opened all four text.txt documents and stacked them as shown in the following screenshot:
    Conclusion, no surprises that I can determine.
    Is this what you had in mind, or was there something I did that was different from what you need?

  • I have a DAQ Assistant configured to read multiple channels at the same time. When I wire a graph indicator to the output, I see all of my signals jumbled together. How do I split them up into seperate signals?

    I have a DAQ Assistant configured to read 2 channels at the same
    time. When I wire a graph indicator to the output, I see the 2
    signals jumbled together. How do I split them up into seperate signals?
    When I wire any type of indicator it is showing just one output of a single channel.
    I want 2 indicators showing 2 different signals as expected from the 2 channels configured. How to do this?
    I have tried using split signal but it end up showing only 1 output from 1 signal in both the indicators.
    thanks in advance.
    Solved!
    Go to Solution.

    Yes you are right. I tried that but I did not get the result.
    I just found the way. When we launch split signal, we should expand it (split signal icon) from above and not from below. It took me a while to figure out this. 
    thanks 

  • Is there a way to count the number of times an array moves from positive to negative?

    I have an array of values, and I need to find the number of times that the array changes signs (from positive to negative, or vice versa). In other words from a graphical standpoint, how many times a certain line crosses the x-axis. Counting the number of times the array equals zero does not help however, because the array does not always equal exactly zero when it crosses the axis (ie, the points could move from .1 to -.1).
    Thanks for you help. Feel free to email me at [email protected] I only have lv 5.1.1 so if you attach any files, they cannot be version 6.0.

    Attached is a VI showing the # of Pos and Neg numbers in an array, with 0 considered as non-Pos. It is easily modifiable to other parameters - including using the X-axis value as your compare point versus only Zero.
    This is a modified VI from LV (Separate Array.vi)
    Compare this with your other responses to find the best fit.
    Doug
    Attachments:
    arraysizesposneg.vi ‏40 KB

  • Printing: The outputs print on a printer other than that specified on the u

    We are using activity profile on the shipment to trigger outputs at different statuses set on the shipment document. In order to have the output trigger based on activity profile we need to have the timing for these output types set to “3”. Now the outputs set in the activity profiles are proposed on the sales document the first time the document is saved by the user. The communication details for the outputs proposed have the details from the user data set in the user master (SU01) for the person who saved the sales document as the print parameters for the output is “S” (user parameters).
    The issue is we want the system to print outputs proposed on the sales document to different printers.  E.g. The bill of lading output on the shipment document is required by the shipment planner to provide the same to the truck drivers. However the documents like pick list are required by the loaders loading the packages in the warehouse. Hence the documents need to be printed in different printers. How do we achieve this when the outputs proposed at the time the sales document is saved have the print parameters form the user data of the user who created the document?

    Hello,
    Have a look here:
    http://help.sap.com/saphelp_erp2004/helpdata/EN/7e/36e4c4023411d399b70000e83dd9fc/frameset.htm

  • How can I get the Elapsed Time express to output in milliseconds?

    I am trying to get the Elapsed Time express to output in milliseconds or in seconds to three decimal places. I am pretty new at this.
    Thanks in advance!

    I'm not sure I understand your question. The output of the Elapsed Time Express VI is a DBL. It's already a floating point number. The default format for a numeric indicator is 6 digits of precision. You can change this in the properties for the indicator.
    To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.
    Attachments:
    Example_VI.png ‏4 KB

  • SQ01 - SAP List Viewer - Ability to get the count of the output records

    Hello All,
    I have a problem with the SAP List Viewer output for an SAP Query.
    I have created a SAP query (SQ01) for a table. Its a basic query that queries on just one table (VTBFHA)
    When I run the query, for the output in the SAP List Viewer (ALV) format, Could anyone kindly help me figure out how to get the count of the number of records displayed in the output?
    For Eg: when we run the T code SE16, It gives us the number of records displayed in the output.
    Similarly, does anyone know if there is a way I could display the count of the number of records displayed in the output of the SQ01 query?
    I have tried checking the "Counter" in the basic list tab, but it does not give me the count.
    Any help will be greatly appreciated
    Thanks
    Subhani

    Yes there is a solution. Follow these steps
    Select your query
    Hit the button InfoSet Query
    Go to Edit->Settings->
    Check the box "Count in the Output list" in the Output tab
    Hit Save
    In pop up box select the user group
    hit enter
    Hit the back arrow (F3)
    now Execute the query
    You should be able to see the count in the output.
    The count will appear on the right most column of the output. If it does not go to the "Change layout" option and make sure it is part of the "Displayed columns list".
    Regards

  • I have Hello screen after i slide to set up gel language options after select English , Egypt it request to connect with WI FI after connect start to activate my IPhone after that it unable to activated because the activation server is unavailable

    I have Hello screen after i slide to set up gel language options after select English , Egypt it request to connect with WI FI after connect start to activate my IPhone after that it unable to activated because the activation server is unavailable and request to connect to itunes and no activate.

    4 possible causes of that message:
    1] Activation server is actually down. Very rare occurrence, but it does happen.
    When it does occur, down time is very short. Solution - try again.
    2] Your firewall or antivirus are blocking the connection. Solution - temporarily
    deactivate your firewall or antivirus until the update completes.
    3] Computer being used for the activation has previously been used to jailbreak
    an iOS device. Solution - use a computer that has not been used to jailbreak an
    iOs device.
    4] Your iPhone is jailbroken. Google may provide some direction. Be advised the jailbreak
    may have made changes that will prevent the iPhone from successfully activating.
    Terms of Use for this forum prohibit discussion of jailbroken iPhones.

  • IPad 3 'usage' over 'time since last full charge' counting the time wrong

    Over the week i saw that my iPad 3 is counting the usage time wrong. It is supposed to be from 8-14 hours you know, from 100% to 0% or something like that, but it shows me the same time from being standby. Like right now it says it has been in standby for 1 day, and the usage says the same! I thought it was an app but i deleted all the opened apps and turned it off and on, then just left t there and it still copied the time. Please help?
    PS i have the latest software update - the one that came up a week go

    Over the week i saw that my iPad 3 is counting the usage time wrong. It is supposed to be from 8-14 hours you know, from 100% to 0% or something like that, but it shows me the same time from being standby. Like right now it says it has been in standby for 1 day, and the usage says the same! I thought it was an app but i deleted all the opened apps and turned it off and on, then just left t there and it still copied the time. Please help?
    PS i have the latest software update - the one that came up a week go

Maybe you are looking for

  • Summing up a Column in ALV report

    Hi All, I have developed an ALV Report which will display Invoices and other details. Now i need to display the sum of NETWR column, if user wish to select that column and click the "SUM" icon. As of now, if i select the NETWR column and click 'SUM"

  • Problem with openURL when sending Mail

    Hi All I am trying to send mail from my app using [[UIApplication sharedApplication] openURL: [NSURL URLWithString:emailData]]; emailData contains a google URL that i want to send via email: http://maps.google.com/maps?f=d&saddr=45.578982,-73.565698&

  • Toshiba 40L7363DG - Home Button is not responding

    I have problems with the "Home Button". My 40L7363DG ist via WLAN connected. I'm not registered in "Toshiba Cloud TV". Country "Deutschland" (Germany). No firmeware updates available. When I press the home button "most times" nothing happens, it is l

  • Download acrobat professional 10.0 win

    I cannot find acrobat professional 10.0 win to download. Where can i find it? Uzo

  • HT201334 Apple configurator profile question

    How can you set the priority of profiles to install? Also, if one profile has a setting that overides another, which takes precidence?