Need help created state machine that is time based

I need help with my labview program. My goal is to write a program that allows the user to turn a toggle button on/off. When they do this it will start a loop witch turns on a digital switch for 45 minutes then off for 30 seconds and on and on till the user toggles the switch off. The timing does not have to be precise. I am using the NI 9476 digital output card.
I have written the code to turn the switch on/off. I know need to add the looped fuction for on 45 minutes/off 30 seconds. I assume the most efficient method would be using a state machine, but I was having trouble figuring it out.
Attached is the program I have written thus far without the loops.
Thanks,
Barrett
Solved!
Go to Solution.
Attachments:
Test Setup X01.vi ‏16 KB

I cannot see your code since I don't have 2010 installed. A state machine would be good approach but in order to allow the user to cancel and possibly abort the process at any time your state machine should have a state such as "Check for timeout". In teh loop containing the state machine use a shift register to pass the desired delay value and the start time time for that particular delay. Once the user starts the process set the delay time to your desired time (45 minutes expressed as seconds) and have another shift register that contains the next state to go to after the delay completes. Use a small delay (100ms to 500ms depending on how accurate you want your times to be) to prevent your state machine from free running and then check the delay again. Use the current time and compare it to the start time. If the desired time has passed then go to the next state. You can store the next state in a shift register. No do the same thing for your Off Time state.
Mark Yedinak
"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Attachments:
Simple Delay in State Machine.vi ‏14 KB

Similar Messages

  • Need help created state machine with timed digital output

    Hello everyone I'm new in LabView especially about how to make a state machine. I want to make simulation about state machine with digital output. In Front Panel there are volt_in as an input slider (0-10 V), two numeric control (upper limit and bottom limit), a waveform chart to plot those 3 value, and three boolean (P0.0, P0.1, P0.2) as an indicator. Boolean indicator will on if input from slider exceed the limit in certain situation. This simulation will work as follow:
    1. Define the upper & bottom limit (ex. 8 & 4V)
    2. Make an input from slider (0-10V)
    3. If input (2) exceed the upper limit but less than 10 second (ex. you have 9V input for 8 second, but after 8 second you change the slider back to normal between 4-8V) then the boolean indicator P0.0 & P0.2 will stay off
    4. If input (2) exceed the upper limit more than 10 second (ex. you have 9V input for 4 second, change to 8.5 V for 3 second, and then change to 10V for 3 second) then the boolean indicator P0.0 will turn on for 5 second, turn off, then follow by indicator P0.2 for 5 second, and turn off
    5. Wait 15 second, then repeat process from (2)
    Same process for input that exceed the bottom limit (P0.1 and P0.2 as indicator).
    Can you help me make the block diagram of this process? I will appreciate any of your help.
    Best Regards
    juventom 
    Attachments:
    State Machine Digital Output.vi ‏28 KB

    I would highly recommend you to open the template in LabVIEW to design state machines. You can the Standard State Machine template if you go to File -> New.. and Browse to VI -> From Template -> Frameworks -> Design Patterns.
    Also, here is a good explanation of one:
    https://decibel.ni.com/content/groups/northeast-oh-labview-users/blog/2009/09/08/state-machines
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • I need help creating a formula that looksup cell data and give a value.

    I want to have the table "At a glance"  show the total days a driver has worked, there total in sales and there total in milage. The table shown is a example of what I want to have happen. I want to input any name into cell B2,C2,D2,ect. that is found in the row C2:C17 of Checkpoint (Truck 1) and Checkpoint (Truck 2) and return the total amount of day the driver has driven both trucks, The total in sales the driver has collected (Truck 1 and 2) and How many miles the driver has driven (Truck 1 and 2). I realize that these tables are not labeled correct. If I enter a name into B2 and the driver associated with that name hasnt driven then I want "N/A' to show in cell B2 and so one. I assume that the formula that is created for cell B2 will be copied and pasted into cell C2, D2, ect..
    If someone could help me with this problem I'd really appreciate it.
    Thanks.

    Hi br,
    To show the number of days worked by a driver, you need to COUNT the number of times that driver's name appears in row 2 of both tables.
    To calculate his total sales and total mileage, you need to SUM the amounts he brought in each day and the distances he drove each day.
    Your functions for this are COUNTIF and SUMIF.
    Formulas in At a Glance:
    B2: =COUNTIF(Truck 1 :: $3:$3,B$1)+COUNTIF(Truck 2 :: 3:3,B$1)
    B3: =SUMIF(Truck 1 :: $3:$3,B$1,Truck 1 :: $5:$5)+SUMIF(Truck 2 :: $3:$3,B$1,Truck 2 :: $5:$5)
    B4: =SUMIF(Truck 1 :: $3:$3,B$1,Truck 1 :: $12:$12)+SUMIF(Truck 2 :: $3:$3,B$1,Truck 2 :: $12:$12)
    Fill all three formulas right to the last column of At a Glance.
    To put N/A in place of the 0 in Roger's column and the empty columns, wrap each of the formulas in an IF statement:
    Bn: =IF(AND(ISERROR(MATCH(B$1,Truck 1 :: $3:$3,0)),ISERROR(MATCH(B$1,Truck 2 :: $3:$3,0))),"N/A",formula)
    Where formula is the formula used in column B above.
    Regards,
    Barry

  • Uber Noob Needs Help Creating website!

    I need help creating my webpage: It has a textbox on it were
    the user enters a URL and it then redirects the end user to that
    URL when they press the GO Button. It also has a check box saying
    "Hide my IP", If the end user clicks this box and then clicks go
    they will be directed to the website they stateted in the Textbox
    but this time it shall mask there IP Address so they can bypass
    proxys and surf anonomosly. Please can someone give me some HTML
    code i could use for this site or a Link to a website that can give
    me the code.

    I assume the application is connecting to Oracle using an application ID/password. If so, check to see if that user has a private synonyn to the table. If so drop it since you have a public synonym.
    Verify that the public synonym is in fact correct. Drop and recreate the public synonym if you cannot select against the synonym name using an ID that can perform select * from inhouse.icltm where rownum = 1. That is if this other user cannot issue select * from icltm where rownum = 1 without an error.
    Check that the application ID has the necessary object privileges on the table.
    Queries you need
    select * from dba_synonyms
    where table_owner = 'INHOUSE'
    and table_name = 'ICLTM'
    You may find both public and private synonms. Either fix or delete. (Some may reference someelses.icltm table if one exists)
    select * from dba_tab_privs
    where table_name = 'ICLTM'
    and owner = 'INHOUSE'
    Note - it is possible to create mixed case or lower case object names in Oracle by using double quotes around the name. Do not do this, but do look to see that this was not done.
    You could also query dba_objects for all object types that have the object_name = 'ICLTM'
    HTH -- Mark D Powell --

  • I need to create a schedule that will be performed every day

    Hi,
    I need to create a schedule that will be performed every day. Must start at a specified time and finish their work at a certain time. Joby hooked to this schedule must do their work in a loop, until he completed the work to the procedure. Do you have any solution?

    6e4e5455-0183-4163-be68-1e68fc529042 wrote:
    Hi,
    I need to create a schedule that will be performed every day. Must start at a specified time [...]
    Easy, use DBMS_SCHEDULER to schedule the job to start at a particular time every day.
    [...] and finish their work at a certain time. [...]
    What should it do if it finishes early? What should it do if it hasn't finished its work by the given time? There may be things you can do to make it crash out at a given time - but its helpful to know what your aims are first.
    Joby hooked to this schedule must do their work in a loop, until he completed the work to the procedure. Do you have any solution?
    I don't have a clue what that last sentence means, let alone a solution.

  • Need help with a workflow that will restrict resize to 720x540

    I need help constructing a workflow that will resize any image I choose to 720x540. I want this to be restrictive to this size, in other words I don't want 720x468 or etc. I have tried this too many times, will no success so now I am reaching out for help. HELP. Once I have correct resized an image as needed I want to change its format and save a copy.
    As always thanks for your reading and replying to my Post,
    Sebastian

    Hi there,
    what Image editing software do you have, if any ?
    regards
    Ric

  • Aperture Workflow - need help creating workflow for photo management

    Hi -
    I currently shoot with a Canon SD890 (point & shoot) and a Nikon D300 (SLR). My photography is either personal photography or street photography. I may use some of my photography for a web project but that should not be considered right now. I shoot jpegs with the SD890 and RAW with the D300. I need to create a workflow that will allow me to manage all of my photos as well as the RAW vs JPEG aspect. Here are a few initial questions:
    1) Should I separate the RAW and JPEGs in Aperture (two libraries)? One library for finished photos and one for negatives?
    2) What folder structure should I use? Since I am not a professional photographer, I won't be shooting projects. I think something date or event driven would be best (preferably both).
    I am interested to hear how others do this...especially if you use both point & shoot and SLR cameras.
    Thanks for your help!

    jnap818 wrote:
    1) Should I separate the RAW and JPEGs in Aperture (two libraries)? One library for finished photos and one for negatives? I am interested to hear how others do this...especially if you use both point & shoot and SLR cameras.
    No, use a single Library. Aperture will have no problems with the various formats or with various different cameras.
    2) What folder structure should I use? Since I am not a professional photographer, I won't be shooting projects. I think something date or event driven would be best (preferably both).
    Actually those date or event driven batches of images are very logically "Projects" in Aperture. Simply name each group of images as you import into AP as a new Project.
    IMO it is not good to import camera-to-Aperture (or direct to any app other than the Finder). Best is to use a card reader and use the Finder to copy images from the camera card to a folder on the computer hard drive.
    Below is my Referenced-Masters workflow:
    • Remove the CF card from the camera and insert it into a CF card reader. Faster readers and cards are preferable.
    • Finder-copy images from CF to a labeled folder on the intended permanent Masters location hard drive. I label that folder with the Project name suffixed with _masters, that way I can always find the Masters if Aperture forgets where they are.
    • Eject CF.
    • Burn backup copies of the original images to DVDs or to hard drives (optional backup step).
    • Eject backup DVDs/hard drives (optional backup step).
    • From within Aperture, import images from the hard drive folder into Aperture selecting "Store files in their current location."
    • Review pix for completeness (e.g. a 500-pic shoot has 500 valid images showing).
    • Reformat CF in camera, and archive DVDs of originals off site.
    Note that the "eject" steps above are important in order to avoid mistakenly working on removable media.
    I strongly recommend that every Aperture user spend $35 and work through the tutorial CD Apple Pro Training Series: Aperture 2 (Apple Pro Training Series) by Ben Long, Richard Harrington, and Orlando Luna (Paperback - May 8, 2008), Amazon.com. Note that the value is in working the tutorial, not in using the book as a manual.
    Good luck!
    -Allen Wicks

  • I need help making a square that scans across a screen.

    i'm trying to make a program that creates images of a square scanning across a black background.  so far all i have is a program that makes one image where i can alter the size of the square and its position.  I'm very very new to labview and i need help with the structure that would create all the images of the square scanning across and then shift down and scan across again.
    thank you very much,
    Joseph Sadler
    Attachments:
    Drawexample.vi ‏24 KB

    As Lynn found, there is a memory problem with the vi which didn't show up in my limited testing.
    Using Shift Registers with Picture Controls can cause problems.
    See this thread.
    Try the attached "mod" version.
    Then I got to thinking, why redraw the box (2x with "erase") - when you could just move a box around?
    (Note: I used a picture for the box, but you could use other objects.)
    The "mod1" version does it this way.
    steve
    Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
    question. Give "Kudos" to replies that help.
    Attachments:
    squarescan mod.vi ‏20 KB
    squarescan mod 1.vi ‏20 KB

  • How to create State machine workflow?:

    How to create State machine workflow

    Hi,
    According to your post, my understanding is that you want to send email to Assigned to person when item is created in Task List.
    You can set E-Mail Notification to Yes under your Workflow Tasks list > Settings > Advanced Settings. By doing so user specified in AssignedTo will receive e-mail notification when task is created.
    Here is a similar thread for your reference:
    https://social.technet.microsoft.com/Forums/office/en-US/44f63c3c-8dfc-4f02-b627-a92249404ae3/task-list-advance-settings-email-notification-send-email-when-ownership-is-assigned-or?forum=sharepointgeneral
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • I Need Help for the popup message every time I go to safari: "Warning! Old version of Adobe Flash Player detected. Please download new version."???

    I Need Help for the popup message every time I go to safari: "Warning! Old version of Adobe Flash Player detected. Please download new version."???

    If you are talking about Safari on the iPad, there is no version of Adobe Flash for iOS and there never has been. Clear Safari, close the app and reset the iPad.
    Go to Settings>Safari>Clear History and Website Data
    In order to close apps, you have to drag the app up from the multitasking display. Double tap the home button and you will see apps lined up going left to right across the screen. Swipe to get to the app that you want to close and then swipe "up" on the app preview thumbnail to close it.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.
    If you are talking about Safari on your Mac, you are in the wrong forum. But I would still clear the cache, quit Safari and restart the Mac.

  • I need help writing a script that finds the first instance of a paragraph style and then changes it

    I need help writing a script that finds the first instance of a paragraph style and then changes it to another paragraph style.  I don't necessarily need someone to write the whole thing, by biggest problem is figuring how to find just the first instance of the paragraph style.  Any help would be greatly appreciated, thanks!

    Hi,
    Do you mean first instance of the paragraph style
    - in a chosen story;
    - on some chosen page in every text frames, looking from its top to the bottom;
    - in a entire document, looking from its beginning to the end, including hidden layers, master pages, footnotes etc...?
    If story...
    You could set app.findTextPreferences.appliedParagraphStyle to your "Style".
    Story.findText() gives an array of matches. 1st array's element is a 1st occurence.
    so:
    Story.findText()[0].appliedParagraphStyle = Style_1;
    //==> this will change a paraStyle of 1st occurence of story to "Style_1".
    If other cases...
    You would need to be more accurate.
    rgds

  • HT5622 I need help finding a movie that I downloaded, can anyone help me with this?

    Hello, I need help finding a movie that I downloaded, can anyone help me with this?

    If you downloaded it to your iTunes library it will be in the Movies folder.  If you downloaded it to an iOS device you will find it in the Videos app.  This explains how to redownload previously purchased videos (available in some locations as long as the studio permits it): http://support.apple.com/kb/PH12283.

  • TS1424 i need help finding a purchase that somebody made on my cedit card without my knowledge to itunes and i want to file a claim

    i need help finding a purchase that somebody made on my cedit card without my knowledge titunes and i want to file a claim

    You can view purchases via Store > View My Account on your computer's iTunes (and you can view subscriptions). If you want to contact iTunes support then you can do so via this page : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • I need to create an APP that runs on an Android Tablet to play mp4 video stored on the SDCARD.  I ha

    I need to create an APP that runs on an Android Tablet to play mp4 video stored on the SDCARD.  I have tried using VideoPlayer and passing NULL to the Connect() method, but while this will play a video from a shockwave SWF it will not play it as an APP from a .apk file.

    There are several apps in the App Store. Look at them to see what might meet your needs. There is a keynote app that might be best for you.

  • HT4796 do i need to create a new user each time i do a migration ?

    do i need to create a new user each time i do a migration ?

    If the computer you are migrating to already has a user the Migration will create a new one.
    If not Setup Assistant should be used instead (see Pondini's Guide)

Maybe you are looking for

  • Album art mixed up on Ipod 5G

    Hello, I have a 5g ipod and recently finished riping over 200 CD's to Itunes. I added album art to every song on every disk . My Ipod is displaying the album art but it is displaying the wrong art on many songs. Sometimes it shows one art image on th

  • [SOLVED] Switch x displays with script instead of ctrl-alt fx

    Hi, I am looking for a way to switch x displays on a computer without using the keyboard. Is this possible with a bash script of some sort? EDIT: I found chvt but that only works from a tty, running sh chvt X doesn't work from a terminal emulator. ED

  • ABAP Certification - Regd

    Hi All, I am currently preparing for certification this tech ed. I got the syllabus fom SDN and sap website. i found the following is <b>missing</b> from the syllabus. <b>ALE / IDOC/ EDI Smart forms SAP Script LSMW ALV Reporting ABAP Query RFC BAPI</

  • Absence Details form error

    Hi When i trying to create the absent details for an employee and when trying to save i am getting the following error msg APP-PAY-07448: This person is not eligible for the element associated with the absent type In the element I didn't provide any

  • Sending e-mails

    Verizon not responding due to a long running script...I get this message every time I try to compose a reply to an e-mail from anybody.  Does anyone know how to correct this problem?