How do I delay 1 of many outputs exiting a case structure?

I have a system here which is sort of a finite state machine, using digital I/O, I am monitoring a series of digital inputs which in turn form a binary number which is the input to a case structure. Depending on the binary string (number) that is read by the case structure, a particular series of boolean constants (T or F) exit through the case structure which are then used as my digital outputs (in my case they are controlling a series of relays). Basically, I have a condition where I would like one of the relays to be time delayed when switching in one direction, but not in the other. The problem is that when I do delay this bit, it also delays all of the bits coming from the case structure.
i.e. all the relays are delayed. How can I delay just one of them?

Well, I can't think of a really easy way. You could generate a delayed pulse on a counter output, instead of using a digital line. Otherwise you will need to keep track of the delay time in your loop somehow. The timing is only going to be as accurate (deterministic) as your loop rate, and will be operating system dependant. You may have some jitter. Attached is an example of a software delayed boolean indicator. Download both VIs.
-Jim
Attachments:
delayed_relay.vi ‏30 KB
boolean_trigger.vi ‏14 KB

Similar Messages

  • How to avoid delay during analog output generation by changing its frequency?

    Windows XP
    LabVIEW 7.1
    PCI-6036E + BNC-2120
    Hi,
    I am going to create a vi to generate an engine speed sensor signal (a simple square wave with specific missed pulses, in my case 58 pulses “teeth” and 2 missed pulses “missed teeth”) as an analog output but in addition give me the opportunity to control parameters for example frequency online to simulate the engine speed changes during running that vi. For this purpose I have started with “Continuous Generation.vi” which is available in NI Example Finder under the following path:
    Hardware Input and Output > Traditional DAQ > Analog Output > Continuous Generation.vi
    Then I modified it towards above mentioned goal, all related vi s are attached. The main vi is: "Motor Signal Generator_1.12.vi"
    At the first try it looks that it works properly but when have a look on that more accurately with Oscilloscope (fortunately I have a good one: Agilent 54621A – 60 MHz, 200 Ms/s) obviously there is a gap (delay or Jitter) whenever I change the engine speed. It is also attached in Signal generation_problem report.doc file.
    Note: Small gaps are OK and related to predefined missed teeth but the big one is happened during changing engine speed.
    As far as I understand it is related to the time which case structure in AO C-GEN sub-vi needs for AO reconfiguration each time after changing the engine speed (update rate). How can I get rid of this delay or gap during signal generation and generating completely continuous signal?
    I have to mention that obviously I changed the frequency by changing the update rate. The other possibility is to change the number of updates in one period (refer to "generate arb frequency.vi" in NI site: http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3E48F56A4E034080020E74861) which resulted in no delay however then I can not change the frequency continuously but step by step (for example jump from 5Khz to 2.5KHz immediately) and this can not pass to my application.
    Any hint is appreciated.
    regards
    Attachments:
    Signal_generation_NIsupport.zip ‏81 KB

    Hi Roozbeh,
    The following example will allow you to vary the pulse train frequency during run time.
    Thanks,
    Lesley Y.
    Attachments:
    GenDigPulseTrain-ChangingSpecs.vi ‏75 KB

  • How to label/name a wire output from a case diagram

    I like how Labview displays the "name" of a wire - when it shows the right name!  Sometimes when a wire leaves a Case diagram, I notice it has the name of the wire in one case when I would prefer it to have the name from one of the other cases, and I wonder if I have worked out which case it uses - the last case.  The problem is that the typical Boolean Case diagram only has 2 cases, and you can't re-arrange the cases, except if you add a dummy case, rearrange, then delete the dummy case.  The attached VI illustrates the difference in the name of the blue wire (use the mouse hovering over the wire to see it). (LV 8.2.1)
    I think it would be nice if we could label the output tunnel of case diagrams (and hence the wire emerging from it).  It wouldn't need to be a visible label, but it would help to document the code.  What do you think?
    Message Edited by pauldavey on 06-07-2007 12:48 PM
    Attachments:
    Labelling Wire from Case Diagram.vi ‏10 KB
    Labelling Wire from Case Diagram.png ‏23 KB

    A picture is worth thousand words:
    Ton
    Message Edited by TonP on 06-07-2007 08:08 AM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    Labelling Wire from Case Diagram.png ‏7 KB

  • Enter and exit a case structure

    I'm currently building a control.  I have a condition for three booleans to become true to enter a case structure as true.  One of the conditions is a temporary increase in temperature. I want to stay in the case structure after the temperature becomes false but both of the other booleans stay true. Is there a way to do this or should I be using some other technique?
    Thanks,
    Colt

    I think this guy is running into the same misconception I and many of my classmates ran into about LabVIEW back in the day.  When your code enters the True Case, it will complete the True Case and immediately exit the True Case to complete whatever other tasks that may be outside of the Case Structure (assuming it didn't already do them). Then, the while loop (you must have a while loop) will move on to the next iteration, meaning it will do it all over again.
    Now, if you know already know and understand how code works in general (about iterations) then do forgive me.  I've edited a lot of student code and have seen this very mistake.  A misunderstanding of the fact that code reiterates and will do it all over again if not told to do something else.  Typically the mistake is made with Event Structures.  I know it doesn't make much sense to not understand that...but trust me, it makes sense to those who don't understand.  ha

  • How can I put a numeric indicator into a case structure using VI scripting

    I'm using VI scripting and I'm trying to add a numeric indicator inside a case structure.  I'm able to add the case structure and the numeric indicator just fine, but as soon as I specify the case structure as the "owner" of the numeric (as opposed to the block diagram being the owner) I get error 1060.  Is there any way around this?
    Note:  The reason I am doing this is because this specific pattern (indicator in a case structure) will prevent a VI from being inlined when it is being built.  This pattern will provide no functionality in itself, it only prevents the inlining.  It is added to a larger VI which is use to initialize objects in a simulation, and there are many of them in the total simulation.  If they are inlined, it takes a VERY long time to generate the C code, and performance on this VI isn't an issue since it is performed only once at the beginning of the simulation.  The rest of the VIs do need to be inlined for performance reasons.  Therefore, I'm open to other options to prevent a VIs from being inlined if the "indicator in a case structure" cannot be performed via scripting.
    If any of this is unclear please let me know and I can clarify.  Thanks.
    Solved!
    Go to Solution.

    I now understand what you were saying about inlining a subvi.  I did as you said and made a subvi with a case structure and an indicator within it.  I use the New VI Object node to add that subvi to the slow-inlining parent VI.  Then I tried to inline it using the invoke node, but I got error 1399, which make sense.  Is this what you meant for me to do, or did I misunderstand?
    Also, I tried the ControlTerminal reference approach you mentioned earlier.  Unfortunately when I called the move method on the control terminal property and had the 0th frame of the case structure as the owner I got error 1060 again.
    I really appreciate your help.  Do you have any other thoughts?

  • How do I select different graphs to show using case structure?

    Hello,
    I am working on a piece of code where I am getting  data from 6 different sources (reading temperature & pH on 6 different tanks)...  I am using
    1)  a case structure
    2) while loop
    3)  waveform chart
    Now, I want to have it so, the User selects which graph he wants to see (tank 1, tank 2, tank 3, etc...).  And then, program ONLY SHOWS the graph for THAT TANK...
    So I have an Event Structure with the "Tank #" control, which is supposed to change the graph that is on display.  However, right now, it is not working.
    Let's say I start the program..., then I click "Tank 1"...  it graphs Tank 1...  then I click "Tank 2"...  instead of COMPLETLY CHANGING the graph, it CONTINUES to graph the data from TANK 2 on the same graph.  I.E.:   it plots points  1 - 7  from TANK 1,  then plots points 8 - 15 from TANK 2,....  on the same Graph.
    I don't want that.  I want it to change the graph.   But if I put the graph in the Case Structure, it puts multiple graphs on the Front Panel...  How can I do it?
    NOTE:  Ignore case 3.   And each case should be corresponding to Tank #...
    Thank your for reading--
    Attachments:
    GraphProblem_NI forum.vi ‏3166 KB

    the easy answer is that you should clear your waveform graph before sending new data to it...
    It's as easy as writing an empty array to it's property node Value...
    But.. 
    you've got much... much more cleaning up to do.  Clearing the graph is just one thing.
    Your code is unreadable.  Why do you have 3 While Loops?
    What does the bottom one do?
    Why are you complicating things with cluster going into the queue?  An enumerator would do the same trick.
    Is this code going into a cRIO or cFieldpoint?  If not, what's up with using Shared Variables?  Are you planning to send data over the network?
    Debugging this code will become a nightmare.  Scalability will be worse..
    I would recommend refactoring the code while it is still manageable.

  • How to create an array in if/else or case structure without 0's ?

    Hello,
    I've been trying to do this for a while now.
    I only managed to think of this in three ways:
    1. (What I'm doing right now Create the array by going through a for loop, which populates the array by auto indexing. It populates with correct number if true and with a '0' if false. The idea was to delete the 0's later on in the code. This however seems highly ineffective.
    2. Make use of a shift register, which automatically adds the correct number to an array. The problem is that the array will keep growing and growing and at the very least would tremendously slow down my program. At worst, it would crash.
    So, my question is: How do I create an array that if a comparison is true, it puts the element in and if not it does nothing ?
    I've attached a PNG snippet of my code.
    Kind Regards,
    David.
    Solved!
    Go to Solution.
    Attachments:
    Get_Indices.png ‏24 KB

    Pladio wrote:
    I've been trying to do this for a while now.
    You did not explain what "this" is. Can you give some typical inputs and expected outputs? Populate your controls and indicators with typical data and make it the default efore attaching.
    Pladio wrote:
    So, my question is: How do I create an array that if a comparison is true, it puts the element in and if not it does nothing ?
    Your code show three different comparisons. Which one are you talking about.
    Pladio wrote:
    I've attached a PNG snippet of my code.
    That code makes very little sense. Why is there a shift register if the data in it never changes? What is the purpose of the inner FOR loop? Why are you creating a 2D array?
    Do you want to remove all rows where the corersponding SD is zero, for example?
    LabVIEW Champion . Do more with less code and in less time .

  • White tunnel in a case structure at every output

    I´m working with a TCP READER in a case structure. But every output fron the case get white tunnel. What`s happening?

    A white tunnel on an output of a case structure indicates that the tunnel is unwired in at least one case. If you're using LabView 6.1 or 7, one option is to right-click on the tunnel and select Use Default If Unwired. But I prefer to wire to the output tunnels in every case: it removes any question about what value is presented to the case outputs.

  • How many at-exit commands are allowed in the pbo.

    hi
    how many at-exit commands are allowed in the pbo.

    Hi Chaitany,
    EXIT-COMMAND statements are mainly used to exit out of the transaction by over-riding the mandatory field check.
    So, essentially, it makes sense to have only ONE Exit-Command code block.
    Also take note that Exit-Command can be provided ONLY in PAI and not in PBO.
    Cheers,
    Venkat
    P.S: Kindly reward points for useful answers

  • How do I delay a picture change in Keynote beyond the 60seconds the build process allows from one graphic to another on the same slide?

    How do I delay a picture change in Keynote beyond the 60 seconds allowed in the 'build' it procedure on the same slide?

    BazzyS wrote:
    I'm referring to a graphic change within the same slide not transition between slides.
    In the suggestion I gave, using a transition instead of a build, has exactly the same visual effect as a build, it just uses a different tool.
    in my example earlier, I have 7 coloured objects, the first 6 objects appear using a dissolve build.
    The 8th object appears with the same effect, a dissolve, but is delayed by 5 minutes because it uses a dissolve transition.
    I used a transition instead of a build which uses 2 slides to achieve the effect, the viewers will not care how many slides there are and what tool is used, its the end result that matters.
    first 7 objects appear in a build
    a transition set up using a disolve and a delay of 10 minutes
    7th object appears with a disolve

  • Internal Email recipient Status: 400 4.4.7 Message delayed, too many concurrent deliveries of this message at this time

    Hi All,
    I've read the other threads on this but not found one exactly like it. We are running Exchange 2010 SP3 Update 1. We recently sent out an internal email to a distribution that had a couple of dynamic DL's in it and a few regular DL's. 
    A lot of people got the initial email and others didn't until the following day. There was around 3000 or so users in that group. When investigating it with the message tracking log, a lot of users had "400 4.4.7 Message delayed, too many concurrent
    deliveries of this message at this time" for the status.
    Could this be to do with message throttling? I can find very little information on this on the Internet.
    Thanks in advance,
    Chris

    This is not throttling.
    How many HT servers do you have? What is the name of queue they all are residing? 
    Cheers,
    Gulab Prasad
    Technology Consultant
    Thanks for your response Gulab,
    I have two HT servers and I'm not sure what queue they were residing in as they eventually all went through. Is there any way I can tell this with the message tracking logs?
    Thanks again,
    Chris

  • How to Create MultiSheet Excel Report Output in XML Publisher in Oracle R12

    Dear All,
    How to Create MultiSheet Excel Report Output in XML Publisher in Oracle R12.
    My Requirement is to develop RTF Template and geneate Excel output in Multiple sheet.
    plz guide me on this..
    thnx
    Khushal

    plz see
    BI Publisher: How to create Multisheet in Single Excel file using Excel Template [ID 1352000.1]
    for r12 you can use excel template
    i think it more appropriate for excel output

  • How to send the ALV GRID output to spool by using the print button in std t

    How to send the ALV GRID output to spool by using the print button in standard tool bar.
    We have created a button in the va02 transaction.  If user click on the button the new screen will be display on that screen we are populating the alv grid output using the oops concept.  But i am unable to send the output to spool using the print button in the standard tool bar.
    I am able to display the Print parameter dialog box but i am not able to send it to spool.
    Kindly help.
    Thanks In Advance.
    G.V.Ramana

    Hi Shaik,
    There is not properties button in my print screen.
    MODULE user_command_0900 INPUT.
        WHEN 'EXCEL'.
          PERFORM excel_download.                              
        WHEN 'PRI'.
          PERFORM print_output.
    form Print_output.
    CALL FUNCTION 'RSPO_LIST_LAYOUT_FITS'
               EXPORTING
                    columns        = 80
                    device         = 'ANY '
                    lines          = 65
                    maxpenality    = 1999
               TABLES
                    layouts        = lt_layouts1
               EXCEPTIONS
                    unknown_device = 1
                    OTHERS         = 2.
          IF sy-subrc = 0.
            LOOP AT lt_layouts1.
              IF lt_layouts1-penality < 1000        AND
                 lt_layouts1-penality < l_min_penality.
                l_layout       = lt_layouts1-layout.
                l_min_penality = lt_layouts1-penality.
              ENDIF.
            ENDLOOP.
            IF NOT l_layout IS INITIAL.
              CALL FUNCTION 'GET_PRINT_PARAMETERS'
                   EXPORTING
                        mode                   = 'CURRENT'
                        line_size              = 80             "#EC *
                new_list_id            = l_new_list_id
                        no_dialog              = l_no_dialog
                        layout                 = l_layout
                   IMPORTING
                        out_archive_parameters = rs_arc_params
                        out_parameters         = rs_pri_params
                        valid                  = l_valid
                   EXCEPTIONS
                        archive_info_not_found = 1
                        invalid_print_params   = 2
                        invalid_archive_params = 3
                        OTHERS                 = 4.
              IF sy-subrc NE 0.                                 " INS SLIN
              ENDIF.                                            " INS SLIN
              IF rs_pri_params-linsz LT 80 OR
                 rs_pri_params-linsz LT gt_stack-s_lprint-width.
                gt_stack-print_line_break = 'X'.
              ELSE.
                CLEAR gt_stack-print_line_break.
              ENDIF.
              IF l_valid NE 'X'.
                rs_pri_params = ls_pri_params_sav.
                rs_arc_params = ls_arc_params_sav.
              ENDIF.
            ENDIF.
          ENDIF.
    endform.                    " Print_output
        CALL METHOD gv_cost_tot_alv_grand->set_table_for_first_display
                EXPORTING
                   is_layout         = gs_layout_cost_tot_grand
                CHANGING
                   it_fieldcatalog   = gt_fcat_cost_tot_grand[]
                   it_outtab         = gt_cost_tot_grand[].
    Please check my code

  • I have copied my CDs into iTunes  (currently running v11) to play on my iPod.  I have now bought a non Apple mp3 player to use when I am out running.  How can I copy the many tracks I want from iTunes onto the new player?

    I have copied my CDs into iTunes  (currently running v11) to play on my iPod.  I have now bought a non Apple mp3 player to use when I am out running.  How can I copy the many tracks I want from iTunes onto the new player?
    Thanks

    I tried Notpod but can't get it to work.  Part of the problem, I suspect, is that I can't create a folder on my player (a SanDisk Clip+).  I also can't do this in Windows Explorer.  Whilst I can see the Clip+ in Explorer, the option to create a new folder isn't there.
    The error mesag I get in Notpod is:
    "Unhandled exception has occurred in your application.  If you click Continue, the application will ignore this error and attempt to continue.  If you click Quit the application will close immediately.
    InvalidArgument=Value of '0' is not valid for 'SelctedIndex'. Parameter name: SelectedIndex"
    Then, when I plug the Clip+ into a USB port, iTunes thinks it is my iPad - which is because, I guess, Notpod hasn't worked.
    I can drag and drop files from the Music folder where my iTunes tracks are stored onto the Clip+ and they get converted but I'd rather synchronise a Playlist from iTunes if I can.
    Thanks anyone who can help

  • How can I implement a "goto" in exiting loops?

    Hi, I've encountered a problem when trying implement an early exit from a loop. Can anyone advice me on this, really wish to how to tackle this issue.
    Thanks in advance...

    I'm going to assume you're using a For loop...  If this is the case you can do two things.  One, you could switch to a while loop, and just have the conditions 'if i = [former input to For loop N], stop', as well as the early exit condition wired to the stop (ORed).
    The other is that you could have all of your code inside error cases (case structure with error wired to the case selector), and once your early exit condition occurs, set the error to true, and the For loop will finish itself without executing any more code (essentially instant).
    I would recommend the while loop method, as there's less wasted CPU cycles.  I could however be way off with this answer.  If so, please be a bit more specific. 
    Hope this helps

Maybe you are looking for

  • Family account settings - FAQ?

    Is there a FAQ or tutorial on how to set up multiple devices where some are shared by family members?   The whole concept of accounts and apple ids is very confusing when you don't have a one-to-one match with people and devices and I can't even find

  • Virtual Machine Additions in Virtual PC for Mac 7.0.2

    I'm also new to Virtual PC for Mac and will try some of the suggestions for speeding it up; it is painfully slow. However, I have another but related question. I keep getting a prompt when I boot Windows XP Prof. and it opens Virtual. It tells me tha

  • Change font in Illustrator cs4 js

    I need to assign specific font to my text and it doesn't work. What am I doing wrong: var my_OUTSIDE_TextFrame = myInstrLayer.textFrames.add(); my_OUTSIDE_TextFrame.geometricBounds = ["1.6 in", "1 in", "1.85 in", "2.75 in"]; my_OUTSIDE_TextFrame.cont

  • Delete key

    My delete key will not funtion since I downloaded the latest version. Any Help Please!!!!!

  • Flash movie interactive

    Hello, I imported a Flash movie (created in 8, saved in 6 to work with Captivate). It's a graphic of an engine with a list of engine parts on the left. The student needs to drag the engine part name to the engine part in the graphic. My question is: