How to use elapsed time function with state machine in Lab VIEW

Hello
I've been trying to use state machine with elapsed time function in order to sequentially start and stop my code. The arrangement is to start the code for 1 minute then stop for 5 minutes. I've attached the code, the problem is when I place the elapsed time function out of the while loop it doesn't work, on the other hand when I place it inside the loop it does work but it doesn't give the true  signal to move to the next state. 
Could you please have a look to my code and help me to solve this issue.
Regards 
Rajab
Solved!
Go to Solution.
Attachments:
daq assistance thermocouple(sate machine raj).vi ‏436 KB

Rajab84 wrote:
Thanks apok for your help
even with pressing start it keeps running on wait case 
could you please explain the code for me, the use of Boolean crossing, increment , and equal functions 
Best Regards 
Rajab 
OK..I modded the example to stop after 2 cycles. Also recommend taking the free online LabVIEW tutorials.
run vi. case statement goes to "initialize", shift registers are initialized to their constants. goto "wait"
"start"= false, stay in current state. If true, transition to "1 min" case
reset elapsed timer with True from shift register(counter starts at zero)."time has elapsed"=false, stay in current state(1 min). If true, goto "5min" case
reset elapsed timer with True from shift register of previous case(counter starts at zero)."time has elapsed"=false, stay in current state(5 min). If true, goto "1min" case. Also, bool crossing is looking for "true-false" from "5 min" compare function to add cycle count.
Once cycle count reaches 2, stop while loop.... 
Attachments:
Untitled%202[1].vi ‏42 KB

Similar Messages

  • How to use a timer together with an event.

    Dear All,
    Today I tried all day to accomplish someting with labview, but I didn't succeed. Perhaps you can help me.
    The problem is as follows. 
    I have an event structure inside a while loop. The events are all triggered by booleans. Those booleans initiate
    for instance some pumps or  other apparatus. The time-out is put at 200ms and inside the time-out structure 
    are some GET function (for instance to obtain the values of some balances and to do some calculations with those obtained values.
    Now I would like to be able to start an experiment. This means by pressing a boolean initiate the experiment. This experiment involves 
    the starting of a timer and after every 10 minutes, the obtained/calculated data (from the time-out) structure should be written to a .xls file.
    I'm not able to programm this part of the program. My first problem is that I need an event (triggered by a boolean) that start a timer. This timer should run always (independant of other events) until stopped by another boolean. After every 10 minutes this timer should initiate (with a boolean?) the data writing to a .xls file.  Can this be done by resetting the timer after every writing event?
    So I have multiple questions, but my main question is how to build an event which is trigger by a boolean and then initiates an overall timer.
    Thanks! 
    Bio

    OK.  That worked.
    You have made all the mistakes self-taught beginners with LabVIEW make, except that you apparently have a pretty good idea of what you want your program to do.
    1.  LV is a dataflow language.  This means that any node which has all its inputs satisfied can run and once started any node runs to completion before another starts.  In your event case the timeout case will execute 200 ms after the loop starts (assuming the user did not push a button before that).  The Waits in the sequence frames mean it will be at least 555 ms before the timeout case completes.  200 ms later is will run again, if not other event has occurred.  Furthermore, you do not know whether the Waits will run before or after the other code in each od the sequence frames because there is no data dependency between the Waits and that other code.
    2. A matter of style: It is recommended that front panels and block diagrams do not exceed one screen size.
    3. Local variables violate the dataflow paradigm and are almost always unnecessary.  The WIRE is the variable.  Connect things via wires not local or global variables.  You will also need some shift registers.
    4. Sequence structures are almost never required.  One exception: Single frame structures around something like the Wait function which does not have error clusters for dataflow.
    5. Look at the Producer/Consumer Design Patterns which come with LV.  File >> New.. >> VI >>  From Template >> Frameworks >> Design Patterns..  The events version will be useful.  Also learn about state machines.  That architecture is versatile, powerful, adaptable, and much more likely to get you to where you need to be with your program.
    6. The events will all be queued up in the internal event queue.  It just takes a long time for your program to get to them.  I like to keep the code in every event case simple enough that it executes before the user could get to the next button. The queued message handling in the Producer/Consumer takes care of this.
    7.  You probably should have an event for Stop experiment.  It would send a command to the consumer loop to shut down all pumps, close files, and any other "cleaning up" which needs to be done before stopping the program.
    This may seem like a lot, but you have most of the pieces.  Some re-arrangement and re-organization will help a lot.
    Lynn 

  • How to use xsl document() function with LiveCycle XSLT processor

    Hello,
    I would like to use LiveCycle XSLT processor to merge xml documents by using the xsl document() function.
    However, I have not, yet, found  clear reference information on the specifics of how to accomplish in LC. For instance if you have
    a transformation that does merging using a standalone xml editor (such as Oxygen), than what is required to accomplish the same
    using the LiveCycle XSLT service.  How do you specify the URI of the XML document that is specified as an input in the xsl document() function. Your insight is appreciated.   Regards

    Hello Steve,
    I checked the reference that you cited (XSLT Transformation).   The reference omits discussing how to use xlst document() function within a stylesheet.  I think that probably means that feature of xslt technology is not directly available through LiveCycle.  When I find a workaround, I'll post an update...for the user community that might encounter the same issue.  Thank you for your response and insight.  Regards, jb1809

  • How to use airport time capsule with multiple computers?

    I'm sure there are some thread about this but i couldn't find it... so sorry for that but hear me out! =)
    I bought the AirPort Time Capsule to back up my MBP
    And so i did.
    then i thought "let give this one a fresh start" so i erased all of it with the disk utility and re-installed the MBP from the recovery disk.
    I dont want all of the stuff i backed up just a few files and some pictures so i brought that back.. so far so good.
    Now i want to do a new back up of my MBP so i open time machine settings, pick the drive on the time capsule and then "Choose" i wait for the beck up to begin, and then it fails.  It says (sorry for my bad english, im swedish haha) "the mount /Volume/Data-1/StiflersMBP.sparsebundle is already in use for back up.
    this is what i want:
    i want the "StiflersMBP.sparsebundle" to just be so i can get some stuf when i need them. it's never to be erased.
    i want to make a new back up of my MBP as if it's a second computer...
    so guys and girls, what is the easiest and best solution?
    Best regards!

    TM does not work like that.
    If you want files to use later.. do not use TM.
    Or do not use TM to the same location. Plug a USB drive into the computer and use that as the target for the permanent backup.
    Read some details of how TM works so you understand what it will do.
    http://pondini.org/TM/Works.html
    Use a clone or different software for a permanent backup.
    http://pondini.org/TM/Clones.html
    How to use TC
    http://pondini.org/TM/Time_Capsule.html
    This is helpful.. particularly Q3.
    Why you don't want to use TM.
    Q20 here. http://pondini.org/TM/FAQ.html

  • How to use my Time Capsule with my Router?

    My Time Warner Cable HS connection uses a specific modem, the Motorola Surfband SBG6580.
    I was currently using my Tiem Capsule as my router and just a Cable Modem from Time warner, but this particular service uses this wireless router. I need to get my Apple Time Capsule back into my netowrk.
    I would either like to understand how to use the Motorola as a switch or just as a modem so I can use the Time Capsule as my router or vica versa, use my Time Capsule as just a back up drive and leave the Motorola as my rwireless router. The onyly thing about this second configuration is that I need to connect to the Time Capsule wirelessly with one of my computers for back up, the other two are both on an ethernet port hard wired.
    So this is what I have to put in place:
    Motorola Wireless Cable Modem
    Time Capsule
    5 Port EasyNet Switch
    iMac Desktop (Ethernet hardwired)
    Macbook (Ethernet hardwired)
    MacBook (wirelessly connected to the network)
    Any thoughts great appreciated.
    Henry

    It's likely that your ISP will require that the Cable Modem is the first device in the chain. You do need to set the Time Capsule to Bridge mode, disabling the DHCP. Now, the Cable Modem is providing DHCP to devices that connect to it, and devices that connect to the Time Capsule.
    You will be able to wirelessly connect to the Time Capsule and network.
    Here is a simple article explaining:
    http://www.ehow.com/how5309467bridge-time-capsule-mac-pc.html

  • How to use video capture function with Ti4200-VTD8X card?

    I have installed nVIDIA Capture Driver provided by MSI (come with VGA card), but don't know how to use this function, do I need to run a third party program or simething else?  I couldn't find any document or information in MSI site talking about this function: "Capture the image through the video input port on the card".   Please help,  Thanks in advance.

    Try Ulead Video Studio or check your card's bundled software.Intervideo WinProducer anywhere?
    Check your card's manual for proper connections   :D

  • How to use the sharing function with other pc on the Finder sidebar?

    I discver my housemates' pc's names under "sharing" on the Finder sidebar. We all use the same wifi network at home.  Neither they nor I have enabled anything so I'm just wondering what is that for and where am I able to control sharing options?
    Also I can even access their iTunes libraries. How do these all work? Am I able to set any security options at all?

    On the doc page (this is also in the download package),
    http://download.oracle.com/docs/cd/E17277_02/html/index.html
    see:
    Getting Started Guide
    Java Collections Tutorial
    Direct Persistence Layer (DPL)
    All of these describe how to use data types other than byte arrays.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to use a @PRIOR function with a SubVar in a cross dim formula?

    Hi all,
    I have a pretty basic logic to calculate a member:
    Rate = Account1->Entity->Prior Forecast Year / (Account2->Entity->Prior Forecast Year + Account3->Entity->Prior Forecast Year);
    We have a SubVar for the Current Forecast Year, so in my formula I wanted to use @PRIOR(&CurFstYr)
    I got an error message: expected type [MEMBER] found [NUMBER] ([@PRIOR]) in function []
    The calc validates and runs with no errors if I use &CurFstYr only, which gives me the option to create a Prior Forecast Year subvar: &PriorFstYr. Is this my only option?
    I've also tried using SUMRANGE function. The formula validated for @PRIOR(&CurFstYr). Eventhough the calc script validated, the calc stopped after 3 seconds with the below error message:
    Error executing formula for [Rate] (line 0): invalid object type
    Any idea why the SUMRANGE calc failed to run? Also, once again, is my only option to create a new SubVar for the Prior Forecast Year?
    Thanks,
    Mehmet
    Edited by: Mehmet Sevinc on Mar 2, 2012 12:14 PM
    Edited by: Mehmet Sevinc on Mar 2, 2012 12:29 PM

    You have this:
    Rate = Account1->Entity->Prior Forecast Year / (Account2->Entity->Prior Forecast Year + Account3->Entity->Prior Forecast Year);I don't have Essbase fired up, but I wonder if this would work:
    Rate = @PRIOR(Account1->Entity->&CurFstYr, 1, "Years") / (@PRIOR(Account2->Entity->&CurFstYr, 1, "Years") + @PRIOR(Account3->Entity->&CurFstYr, 1, "Years")) ;You can put a cross dim into a @PRIOR statement, but you will need to specify the dimension unless it's whatever is tagged as Time. My guess is Years is not the Time dimension.
    I'll bet the @PRIOR doesn't make things fast.
    Regards,
    Cameron Lackpour
    Edited by: CL on Mar 2, 2012 6:26 PM
    Forgot the first @PRIOR

  • How to use ora:parseEscapedXML() Function with String Content

    Hello,
    I am receiving a ResponseMessage that returns a string, but the content of the string is actually XML. I have tried to use the ora:parseEscapedXML() function to parses the string (see XML Fragment below) to return structured XML data that can be assigned to typed BPEL variables. The documentation is very limited for this (I've looked in the Developer Guide draft that is available at the OraBPEL site).
    2 customer records from XML literal fragment copied from string result:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <recordset>
    <customer>
    <CustNum>AROUT</CustNum>
    <CustLName>Hardy</CustLName>
    <CustFname>Thomas</CustFname>
    <CustEmail>[email protected]</CustEmail>
    <CustAddress>120 Hanover Sq.</CustAddress>
    <CustCity>London</CustCity>
    <CustRegion></CustRegion>
    <CustPostalCode>WA1 1DP</CustPostalCode>
    <CustCountry>UK</CustCountry>
    </customer>
    <customer>
    <CustNum>BSBEV</CustNum>
    <CustLName>Ashworth</CustLName>
    <CustFname>Victoria</CustFname>
    <CustEmail>Victoria.Ashworth@B&apos;s.com</CustEmail>
    <CustAddress>Fauntleroy Circus</CustAddress>
    <CustCity>London</CustCity>
    <CustRegion></CustRegion>
    <CustPostalCode>EC2 5NT</CustPostalCode>
    <CustCountry>UK</CustCountry>
    </customer>
    The copy rule for assigning CustNum to accountnumber that fails:
    <copy>
    <from expression="ora:parseEscapedXML(bpws:getVariableData('DataService_OutputVariable','invokeSpecMsgReturn','/recordset/customer/CustNum'))"/>
    <to variable="outputVariable" part="payload" query="/client:QueryResult/client:customer/client:accountNumber"/>
    </copy>
    Any help would be greatly appreciated.
    Thanks,
    Sean

    Hello,
    I am attempting to provide more information in order to hopefully get some better guidance here.
    1) The BPEL process I built receives input from a client that is one of city name or region name or postal code or country name and returns a list of customer records with their AccountNumber, LastName, FirstName, Email, Address, City, Region, PostalCode and Country. The BPEL flow invokes a packaged integration Web Service that retuns the records in a string whose content is XML (see XML fragment below).
    2) The string content returned is vaiable based on the input (i.e. city name="London")
    Two customer records from XML literal fragment copied from string result:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <recordset>
    <customer>
    <CustNum>AROUT</CustNum>
    <CustLName>Hardy</CustLName>
    <CustFname>Thomas</CustFname>
    <CustEmail>[email protected]</CustEmail>
    <CustAddress>120 Hanover Sq.</CustAddress>
    <CustCity>London</CustCity>
    <CustRegion></CustRegion>
    <CustPostalCode>WA1 1DP</CustPostalCode>
    <CustCountry>UK</CustCountry>
    </customer>
    <customer>
    <CustNum>BSBEV</CustNum>
    <CustLName>Ashworth</CustLName>
    <CustFname>Victoria</CustFname>
    <CustEmail>Victoria.Ashworth@B&apos;s.com</CustEmail>
    <CustAddress>Fauntleroy Circus</CustAddress>
    <CustCity>London</CustCity>
    <CustRegion></CustRegion>
    <CustPostalCode>EC2 5NT</CustPostalCode>
    <CustCountry>UK</CustCountry>
    </customer>
    I want to <assign> each record from the packaged integration service result (the string whose content is XML) to a complexType variable defined within the BPEL Process WSDL (see example below).
    XML fragment from BPEL WSDL:
    <element name="QueryResult" type="client:recordType"/>>
    <complexType name="recordType">
    <sequence>
    <element name="customer" type="client:customerType" maxOccurs="unbounded"/>
    </sequence>
    </complexType>
    <complexType name="customerType">
    <sequence>
    <element name="accountNumber" type="string"/>
    <element name="lastName" type="string"/>      
    <element name="firstName" type="string"/>
    <element name="email" type="string"/>
    <element name="address" type="string"/>
    <element name="city" type="string"/>
    <element name="region" type="string"/>
    <element name="postalcode" type="string"/>
    <element name="country" type="string"/>
    </sequence>                         
    </complexType>
    I have read through the tutorial and reviwed the XPath Funtion example in the reference (C:\OraBPELPM_1\integration\bpelpm\orabpel\samples\references\XPathFunction), but I am stsill very unclear as to how to handle this. I would appreciate any and all help.
    Thanks,
    Sean

  • How to use my time capsule with windows vista

    i have a 2tb time capsule iphone 3gs appple tv and a ipad 2 the wife and kids have iphone 3gs and 4 and id like to set up a home network for us all to use and share music and photos is this possible

    Sorry the title never gets into detail at any point.. no vista computer is listed.
    Access the vista computer to TC turn on the guest network and allow full read write access. Make sure you have the workgroup set correctly. There are issues sometimes on the windows side but try that.
    As for using the TC as a file store.. well it isn't a good idea. It is a backup device.. which has no ability to back up itself. There is no mirrored disks and one day it will die and you can say bye bye to your precious photos and music. You can work your way around the issue.. sure.. in the end you will need an alternative backup on a computer.. that alternative backup will then be backed up to where??
    If you must run your itunes and iphoto library on the TC just read about how to set up the libraries in network location. Google will find the posts.
    http://gigaom.com/apple/using-time-capsule-as-a-media-drive/
    You perhaps should read all the other posts about why not.. as well as how to.

  • How to use the time capsule with my existing router?

    Here is my situation. I have Alltel PCD UM185 USB modem for their mobile broadband internet. I have a Cradlepoint MBR1000 router which I plug the usb modem into to share the internet through a wireless network which has WPA security on it. I want to use my 1TB time capsule to backup the computers in my house wirelessly and not as a router. What connection do I need to make and how to do I setup the time capsule this way? I can't figure it out. Thanks for any help in advance. If you need more information just ask.
    Thanks,
    John

    Steven's solution will work just fine if you want to connect the Time Capsule using ethernet.
    You might also consider configuring the the Time Capsule to "Join" the wireless network. In this type of configuration, backups would occur only over wireless and you could locate the Time Capsule virtually anywhere it can receive a good, strong wireless connection. Important Note...the ethernet ports on the Time Capsule are not enabled in this type of configuration, so you will not be able to connect using ethernet.
    Open AirPort Utility and click Continue
    Then select the option to "Join a wireless network" and follow the prompts

  • How to use a 'Percentofsum' function with a group selection

    Hi All!
    I have created a report using CR XI in which I select on certain records in a database and then further select on those records using a group selection. The displayed records in the subgroup are correct. I sum these totals of the grouping using a formula (Basically 3 formulas, one for Reset, another for the calculation, and the third for the display) since if I just use the 'built in' summary function it will still total all records that were selected before the group selection. My dilemma is that I need to get a percentage of the subtotal based on the total of that grouping. Below is an example of the layout of the report:
                                                                                __Dept %_            Program Bugt             Prgm % of Dept Bud              Cost of %_
    GH#1    ADMIN                                                        100%
    GF#2    LEGAL                                                                                448694                          4.22%                                 12382
    GF#2    CITY MGR                                                                               445414                          4.19%                                 12294
    GF#2    CITY CLERK                                                                           113075                          1.06%                                  3110
    GF#2    COM PROMO                                                                          391657                         3.69%                                  10827
    GF#2   CENTRAL                                                                               1430570                         13.46%                                 39492
    GF#1                                                                      293406                 2829410                                                                      78105
    The "2829410"  is the Display formula I used to accurately calculate the listed program budget numbers. The 3 formulas I used to get that number is a Reset formula (whileprintingrecords;Numbervar W := 0;) located in GH#1, a Calculation formula (whileprintingrecords;Numbervar W := w + Sum ({@Next Year Budget Amount}, {gl_master.a_org}); ) located in GF#2, and a Display formula (whileprintingrecords;Numbervar W;W) located in GF#1. The percentages that currently display in the "Prgm % of Dept Bud" are wrong as they use the 'built in' PercentofSum function when you right click on the filed in the details section and select summary as a percentage of. I need a formula that would do the following calculation: 448694/2829410 = 15.85% and thus the "Cost of %" formula that would do the following calculation: 293406*.1585 = 12382.
    I tried using a similar "Reset", "Calculation", and "Display" formulas but I cannot get to work correctly. Any help would be greatly appreciated.
    Thanks!
    P.S. The reason I am using a group selection is because it is easier than listing out all the accounts (departments) that I do not want in the report and that selection could change from time to time where as what is in the group selection would never change.
    Sorry for long winded explanation.

    Read all about it.
    You'd probably have to write a little wrapper (using JNI) that passes
    parameters and return values around between your C function and
    the JVM.
    kind regards,
    Jos

  • How to use a time capsule with dsl

    How do you hook up a time capsule if you have dsl Internet connection?

    Connect an Ethernet cable from the DSL modem to the WAN "O" port on the Time Capsule, just as the Setup Guide illustrates.
    Time Capsule 802.11n (4th Generation) - Setup Guide

  • How to use SQL String functions with JPA and SAP NW

    Hi Everyone,
    I'm recently got the following problem:
    I have a Web Service project using JPA. But as i found out SAPs JPA implementation or more precisely openSQL restricts the use of the LOWER() function, which converts a String to lower case.
    Now I am looking for some sort of workaround. I want to execute the following JPQL query:
    SELECT bp FROM BusinessPartner bp WHERE LOWER(bp.companyName) LIKE LOWER(:companyName)
    I assume there is somewhere a flag to disable this restrictions, because there might be cases, like mine, where this standard functions are needed.
    Kind Regards,
    Carl

    Hi Vladimir,
    no it's not the same issue, because I am asking for a solution for this problem. There have to be ways to bypass this. Otherwise you can't use JPA properly. This is too much of a restriction!
    Is there no possibility to change to another implementation than openSQL?
    Regards,
    Carl
    Edited by: Carl Simon Heckmann on Feb 2, 2009 2:26 PM

  • How can I use my time capsule with Ethernet cable? How is it also possible to use time capsule as a normal external hard drive?

    My problem is that I don't know how to use my Time Capsule with Ethernet Cable, as when I use wireless it is really slow.

    Make sure that there is an Ethernet cable from one of the LAN <-> ports on your modem/wireless router to the WAN port on the Time Capsule
    Click on the Wireless tab at the top of the page
    Change the setting for Wireless Mode to Off (I assume that you do not want the Time Capsule to provide a wireless network since you already have a wireless network)
    Next, click the Internet icon at the top of the screen, then click the Internet Connection tab
    Connect Using = Ethernet
    Connection Sharing = Off (Bridge Mode)
    Click the Update button at the bottom and wait 30 seconds for the Time Capsule to restart and display a green light
    Then, you must power off your entire network...all devices....in any order that you want
    Wait a minute
    Start your modem/router first and let it run a minute
    Start the Time Capsule and let it run a minute
    Keep starting devices one at a time until everything is powered up
    If you are using Time Machine for backups, you will need to reset the connection because you have changed the way in which the Time Capsule connects to your network
    Open System Preferences (gear icon) on the dock
    Open Time Machine
    Click Select Disk
    Click the Time Capsule to highlight it
    Click Use for Backup or, it might be Use Disk
    Now you can connect your Mac using an Ethernet cable to one of the LAN <-> ports on the Time Capsule to back up using Ethernet. Be sure to turn off the wireless on your Mac before you start the backup.
    If you want to backup using wireless, disconnect the Ethernet cable from the Mac to the Time Capsule and turn on the wireless and connect to your wireless network. Your computer will now backup using wireless.

Maybe you are looking for

  • Replicating clobs and blobs in a remote database across dblink

    9iR2 When creating a materialized view in a warehouse pointing to a remote table in an OLTP environment, I got this error when trying to replicate a table with 3 clobs. ORA-22992: cannot use LOB locators selected from remote tables So, how does Oracl

  • Global variable in servlet

    Dear Friends, I have a hashtable(which keeps all user sessions) as a global variable in my login servlet and I have three methods in servlet. Hashtable sessiontable = new Hashtable(); public synchronized void addSession(HttpSession s) sessiontable.pu

  • Need a drop down for a selection screen

    HI all, I need a drop down for a selection screen. say for eg: Field is MARA-MTART   (Material Type). The selection is optional and the dropdown should be using check table: T134 How to get a dropdown? I think a function module is used , but I dont r

  • If I buy "pages" for my daughters iPad can I use it on mine?

    If I buy "pages" for my daughter's iPad, can I download it to my iPad?

  • BW related HR cubes and reports

    Hi any one explain me abt the bw related Hr cubes and reports. If possible please give me example of cubes and reports. Thanks Madhavi