Execute Case Structure with Button Press Slows Down VI

Hi -
I'm fairly new to LabView, and I am having some issues with using a button to run a timed while loop.
I am writing a VI that outputs a timed voltage pulse to an output channel on a DAQ; meanwhile, the VI reads and graphs the voltage on three input channels on the DAQ. When I use a timed loop that automatically executes when the VI runs, the program works. However, I would like to include a button so I can control the timing and number of voltage pulses sent to the output channel, instead of sending only one voltage pulse each time the VI runs. I have tried to do this using a button wired to a case structure. If the button is 'true,' the VI should send the voltage pulse. If the button is 'false,' the VI should keep the voltage at zero.
When the button is 'false,' the VI runs normally; however, when the button changes to 'true,' the VI slows down and never sends the pulse. Why does this happen? How can I fix it?
Also, how can I send the voltage pulse only when the value of the button changes?  I only want the timed loop to execute once when the button changes value.
Thanks for any help or advice!!!
Attachments:
Sensor Read6.vi ‏85 KB

The graph is in the same while loop as the case structure.  The while loop won't iterate until all the code inside of it has completed.  So the graph only gets updated once, and won't update again until the while loop iterates again.  If you need more continual updating you may want to put that in a loop that executes a couple of times, or completely separate your code into 2 while loops.  Is it that long of a wait considering your pulse length is 1 second?
Your analog output code is just writing a voltage out (7 volts) until it eventually writes out 0 volts.  There is no reason for it to drop down unless you have some sort of electrical problem between your DAQ device and the device on the other end that is reading the 7 volts.  What are you connecting that analog output too?
What if you don't use LabVIEW and try to test out that analog output using Measurement and Automation Explorer?  Does it do the same thing?

Similar Messages

  • Executing PL/SQL with button press.

    Hi-
    What i'm attempting to do is simple. I have a single HTML page with a region on it called "Buttons" and a single button. The point of the button when pressed is to execute an Oracle stored procedure which performs a query and inserts the result set into a temporary table. Under "Database Manipulation Request/Database Action", i've selected "No Database Action". Under Conditions, i've select Condition Type of "PL/SQL Expression" and placed the name of the procedure in the Expression 1 box. When i run the page, i get the following error:
    Invalid PL/SQL expression condition: ORA-06550: line 1, column 34: PLS-00222: no function with name 'PRC_LOAD_TEMP_BULK_DATA' exists in this scope ORA-06550: line 1, column 7: PL/SQL: Statement ignored
    The executable is a "procedure" not a function, and i'm guessing that i haven't set up the button properly. How do i properly initiate a database executable from the press of a button?
    thanx,
    jim.

    Actually, something isn't quite right.
    I would like my process to work like this:
    1) Start with page which has a button on it which extracts data and inserts to a table.
    2) Press that button.
    3) The button would do two things: (a) extract/populate data and (b) navigate to another form which shows the data just extracted.
    My problem is that if i set up the navigation for the button under "Optional URL Redirect" to go to page 2, it DOES do so, but doesn't execute the extract process. If i remove this navigation, the extract/populate DOES happen, but the navigation doesn't happen.
    What must be done to either the page processing or the button to allow BOTH the extract/repopulate AND the navigation when the button is pressed?
    thanx,
    jim.

  • Case structure with more than 200 cases, slower lab view app

    Problem Description :
    i am currently making a vi which compose of a simple case structures, a case structure with more than 200 cases, what i noticed is that the more i added cases the slower the labview reacts, it takes time for me to route wire on each of the cases.
    i dont know if there are any setting in the labview environment that i can increase the buffer size? i dont know... but its getting slow (only on the
    vi with more cases in a case structure)
    mytestautomation.com
    ...unleashed the power, explore and share ideas on power supply testing
    nissanskyline.org
    ...your alternative nissan skyline information site

    Can you clarify what you mean by "slow". Does it run more slowly or does it feel sluggish during editing?
    Could you attach the actual VI?
     Overall, I agree with the notion of local variable overuse. For example, you read the same local variable twice in the same case. Is there a need for this? Is there a chance that it varies between the two reads? Typically, you would place the terminal in front of the case structure and wire to all the locations where you need the value. This ensures that the data is consistent. Still, this should not cause any slowdown problem.
    (On a sidenote, the code in the upper left corner is inefficient. You convert the same data to lower case with each iteration, so you might want to place this before the loop and do it only once (well, if you are lucky, LabVIEW will fold the operation, but still....). Also your "index array" operation can be replaced by autoidenxing of the 2D array on the outer loop boundary.)
    LabVIEW Champion . Do more with less code and in less time .

  • HT4061 ????  How do I power up my iPad?  My iPad won't power up. It just stays a black screen.  Tried the start up button, the home button, pressing them down and holding.

    ????  How do I power up my iPad?  My iPad won't power up. It just stays a black screen.  Tried the start up button, the home button, pressing them down and holding.

    Could be the battery is completely drained. Use the charger that came with the iPad and plug that into a known good wall outlet. Let it charge for at least an hour. Then, while it is still plugged in reset your device. Press and hold the Home and Sleep buttons simultaneously until the Apple logo appears. Let go of the buttons and let the device restart.
    If the device restarts let it remain on the charger until the battery indicates 100%. If it still will not turn on Make an appointment at an Apple Store to have your device examined by a technician. Or contact Apple Support.

  • My magic mouse behaves erratically with intermittent problems - slows down, right click doesn't work, disconnects for a few seconds then reconnects. Anyone suggest what I could do to fix this?

    My magic mouse behaves erratically with intermittent problems - slows down, right click doesn't work, disconnects for a few seconds then reconnects. Anyone suggest what I could do to fix this?

    I just figured out the print quality issue for my wife with her new iMac and new printer.
    She replaced both at once and she couldn't understand why her Artisan 730 was lower quality then her Epson R280 when they had the same specs.
    Turns out the newer printer had the option to connect via wifi which we used during setup.
    The driver options are completely different depending on how you connect.
    Once I connected via USB the correct options were available and the print quality was better.
    Looking at the R2400 it dies not have wifi, but while researching the problem for my wife someone esle was having an issue updating to the latest printer driver.
    If you go into the print utility from the Printer and Scanner system preference and under the general tab you should have driver 5.5.
    One user had to delete the old printer driver before Software Update loaded the newer printer driver.
    https://discussions.apple.com/message/15947486#15947486
    On my MacBook Pro (w Snow Leopard) I always had to reconnect my wifi at home when it woke up. I upgraded my router from an old Netgear to a newer N D-Link and stopped having to do that.
    I would be surprised you would have that problem with an Airport Extreme, you might check to see if there is a firmware update for it.

  • Execute case structure a certain number of times within a while loop

    Hi guys,
    I was wondering if it was possible to execute a case structure a specified number of times within a while loop. Basically I'm running a camera where each iteration of the outer while loop displays a frame of a live video feed and I'd like to capture the next x amount of frames (specified by the user) each time the 'Start Capture' button is clicked. The block diagram within the case structure captures and saves an image frame. As the program is written right now, frames will continue to be captured until the 'Start Capture' button is clicked again. Instead of having to click the button again to stop the case structure from executing for each iteration of the while loop, I'd like it to only execute for the next x iterations of the while loop. Any help would be appreciated. Thanks.

    Hello Uxorious,
    A while loop has a iteration counter that gives an integer value of how many times the loop has iterated. You can utilise this to count the number of frames captured. I assume that the program could be running for any amount of time before clicking start capture, if that is the case then you will need to be able to detect when you have clicked the button and add the desired number of frames you wish to capture to the current loop iteration.
    If you use a shift register on the outer loop with the start capture button connected to it (inside the loop) you will be able to compare its current value to its previous value. If it changes from false to true then you can add the desired number of frames to it to give you the loop iteration value where you need to stop.
    Then you can compare the current loop iteration value to that number and once reached, you can use a property node to change the value of your start capture button back to false.
    One final thing, don't forget to initialise the shift register I suggested to false so that you don't run the risk of missing the first time you press the button.
    I hope that makes sense.
    Alistair
    Best regards,
    Ali Bailey
    National Instruments
    Don't forget to Kudos useful posts!

  • CASE STRUCTURES WITH TAB CONTROL

    Hi,
    I have created  tab controlled  case structures for three different cases,
    Tablet type
    Machine Input
    Output
    It seems that data is not interlinked while switching betweeen the cases.
    I have to select the start buttun for each tab to get results.And also if I skip the second tab and jump to third tab, it doesnot give results. SOmehow the data is not acquired.
    Can anyone help me out for the same.
    Attached is the main VI (PAR_LAB_ATT_00_01)followed by a sub VI(gen time array)
    Thanks
    Sumit
    Attachments:
    PAR_LAB_ATT_00_01.vi ‏200 KB
    Generate Time Array.vi ‏15 KB

    Please don't use all CAPS when posting your message subject.
    How are you running your VI?  I don't see any while loop in it, so it only runs once.  Which means only the case structure associated with the tab that is currently highlighted before you press the run button will actually run.
    The vast majority of the time, a tab control is only used to control what is displayed in the front panel and is not used to actually control the execution order of the program.
    I would recommend looking at the online LabVIEW tutorials
    LabVIEW Introduction Course - Three Hours
    LabVIEW Introduction Course - Six Hours

  • How do I use a Case Structure with Strings?

    I need to use a string list to set up a set of cases to be performed. Is it possible to tell a single case structure to do "a, b, c, and d, but not e or f" or "do a, c, d, and f, but not b or e" etc... when you use a string containing the cases to be used?

    Blackavar,
    A case structure will only execute a single case at a time. If you want to have multiple cases execute in parallel, then you would need to have multiple copies of the case structure and split the string apart and wire them to all of the needed case structures.
    This could be done with reentrant subVIs to run truely in parallel. Anther method would be to have 6 different case structures, all with 7 cases each. The 7 cases would be "a", "b", "c", "d", "e", "f", and "0". Your input sting will need to be built up so that it will always be 6 characters long and then split up so that each character goes to one of the case structures. You would have your needed code for cases a - f. Case "0" would do nothing.
    Randy Hos
    kin
    Applications Engineer
    Nationsl Instruments
    http://www.ni.com/ask

  • Modify Case structure with VI Scripting

    This is possible:
    you need a file, where only a case structure is on the BlockDiagram (BD).
    This file is called (e.g. Test1.vi)
    Then you start this VI:
    And in your test1.vi you have updated the case structure ( CaseStructure ) with VI Scripting
    Sometimes you will need this
    BR
    Eugen Wiebe
    Eugen Wiebe
    Bernstein AG
    CLAD - Certified LabView Associate Developer

    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 execute a 'remote' when-button-pressed trigger?

    I am using Forms 6 in an 8i/10g environment. I have a data block (COMPACT) which is on canvas MAIN. Compact has an item (button) called CREATE_COMPACT, with a when-button-pressed trigger. I also have an error canvas which has a button called RESTART, so they can restart the entire build after an error. The restart code is exactly the same as the create_compact code, and, after the restart, I want the focus to be the main canvas, so I would like to just have the restart when-button-pressed trigger shift focus to the CREATE_COMPACT trigger and execute it. I have tried:
    go_item( 'Compact.Create_Compact' );
    do_key( 'Enter' );
    This switched me to CREATE_COMPACT but did not execute the trigger. I then tried:
    execute_trigger( 'Compact.Create_Compact' );
    and then:
    execute_trigger( 'Create_Compact' );
    but neither of these work. I get error FRM-40700 no such trigger. Is there any way to do this short of copying code or creating a pl/sql procedure?
    thanks

    do_key('ENTER') will execute the code in a KEY-ENTER trigger so I suggest you move your code into the KEY-ENTER trigger. On your when-button-pressed trigger you should also use do_key('ENTER');

  • ZFS with de-dupe slowing down...

    Hi all,
    I'm new to Solaris but am evaluating the de-dupe capabilities of Solaris 11.
    I have conifgured a Virtual Machine using VMware vSphere 5 with 8GB RAM and a 1.5TB disk and am slowly copying a few million PDFs into a SMB share in the ZFS pool from a remote server.
    It's been going well, I'm getting a dedup ratio of 3.3 but after copying 3.5TB of files, I've noticed it slowing down. Now it seems to copy really fast for around 5-6 seconds but will then pause for 10-15 seconds before carrying on for another 5-6 seconds etc...
    I'm using the default record size and running "top" doesn't indicate that I'm using any swap, neither do the performance stats in VMware.
    Any help/advice/pointers would be gratefully appreciated!
    Dave

    Thanks for the info. Here's the output of the zdb -DD command
    bucket allocated referenced
    refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
    1 12.6M 1.58T 1.08T 1.08T 12.6M 1.58T 1.08T 1.08T
    2 582K 72.8G 64.9G 64.9G 1.32M 169G 151G 151G
    4 295K 36.9G 34.1G 34.1G 1.47M 189G 174G 174G
    8 189K 23.6G 21.9G 21.9G 1.99M 255G 237G 237G
    16 97.2K 12.2G 11.3G 11.3G 2.06M 264G 245G 245G
    32 52.9K 6.62G 6.15G 6.15G 2.29M 293G 272G 272G
    64 27.5K 3.44G 3.21G 3.21G 2.35M 301G 280G 280G
    128 13.3K 1.66G 1.53G 1.53G 2.32M 297G 273G 273G
    256 5.75K 736M 672M 672M 2.05M 262G 240G 240G
    512 2.96K 379M 351M 351M 2.06M 263G 243G 243G
    1K 1.15K 147M 132M 132M 1.68M 215G 193G 193G
    2K 711 88.9M 78.7M 78.7M 1.73M 222G 196G 196G
    4K 103 12.9M 9.72M 9.72M 560K 69.9G 52.4G 52.4G
    8K 33 4.12M 3.76M 3.76M 374K 46.7G 42.5G 42.5G
    16K 7 896K 817K 817K 155K 19.4G 17.7G 17.7G
    32K 28 3.50M 3.10M 3.10M 1.03M 131G 116G 116G
    64K 23 2.88M 2.64M 2.64M 1.69M 217G 200G 200G
    128K 6 768K 750K 750K 1.31M 168G 164G 164G
    Total 13.9M 1.73T 1.22T 1.22T 39.0M 4.88T 4.10T 4.10T
    dedup = 3.36, compress = 1.19, copies = 1.00, dedup * compress / copies = 4.00
    By my calculation, that makes the dedup table 13.9M * 320 = 4448M = Approx 4.5GB
    Does that look right to you experts? That would indicate that my allocated RAM of 8GB should be plenty I think.

  • Execute case structure only once

    Hi everybody.
    I want to execute a case structure inside a while loop only once. The case strucutre is controlled by a counter, so that every time the counter has a value multiple of N, the program records an acoustic signal and calculate the main peaks of the FFT. The problem I have at the moment is that, every time the case is executed, it records and analyze the sound several times until the counter jumps to the next value. I want the case to execute only once every time the counter has a value multiple of N. I atttach the vi.
    Thank you for your attention guys!!!
    Attachments:
    Pulsations2.vi ‏243 KB

    GERD is right.  You should use a feedback node to store the previous count value.  If the current count is Not Equal AND the remainder is Equal To Zero run your case.
    Since your counts are all integers, I would also recommend changing the representation to an integer type.  I32 would likely be the most appropriate.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How about an Error Case structure with warning?

    Hi,
    while wiring some vis and thinking about error handling....
    In most cases the simple case structure feet by the error cluster will do the job. However in some cases when you deal with warnings, wouldn't it be nice to have an additional (optional) warning case that is true for a not empty source string and/or an error number?
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

    I forget to mention: Of course there is a solution possible by unbundling the cluster and check the error number and string followed by a case. I still remember the time when the case selector couldn't handle the error cluster ... (started with LV3.1 )
    I just thought it would be a nice thing when you wire the error cluster to the selector and get the red and green case and you can right click, add a case and get a yellow(?) case named 'warning'
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'
    Attachments:
    Example_BD.png ‏2 KB

  • Case structure with two selectors

    Hi all
    Once again I'm wondering...
    ...if it is possible to wire more than one value to a case structure. I'm just working on a project and came to a point where I have to nest case structures. I have two enums and depending on both enums I set a value.
    How would it be to have more selectors so that the following code extract could be "drawn" with just one case structure?
    enum X1 = {manual, auto}
    enum X2 = {red, green}
    if(X1 == manual && X2 == red)
    else if(X1 == auto && X2 == red)
    Maybe something useful for new LV versions, if it does not exist yet.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...

    @David - Great solution. I might remember it one day .
    @Shane - You could have given me at least "en stutz" . Well, I see your point, but in every textual language exists this possibility. Although your argument is acceptable (the compound enum), I prefer to have enums without combinations. Ok, maybe the values would make some sense, but I like it better if they are separate. In addition, what should I do if one input is an enum and the other a boolean? And now don't say "use DavidCrawford's solution" .
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...

  • Recording with audio playback slowed down 65% what speed do I need to speed the video back up to to get it into real time?

    Ive recorded a test video with audio/music playback slowed down 65% what speed do I need to speed the video back up to to get it into "real" time?
    If I'd slowed the audio playback down 50% I would make the video 100% faster.
    If I'd slowed the audio playback down 100% I would make the video 200% faster.
    So its obviously somewhere inbetween speeding up by 100-200%
    Sorry but its melting my brain today and I cant remember the calculation.
    thanks

    hey all
    Thanks for the advise on this. I will explain a little more what am have/am intending to do.
    I have used Audacity to slow the song down (Effect>Change Tempo)
    Audacity will allow me slow the original song down by up to 99% (Or anything in-between up to 3 decimal places)
    Unfortunately I am working to a time restraint of 12 minutes per clip (as my DSLR will only allow up to a 12 minute clip).
    The song at normal speed is 4 minutes long.
    Originally I slowed the audio down by 50% (Making the audio 8 minutes long), lip synced to it using a rasta blaster and recorded the video using my DSLR at 720p 50fps.
    I then imported the video and audio I had been lip syncing to into FCPX.
    I sped up the video by x2 (equivalent to speeding it up 200%)
    Retime>Fast 2X
    Layered the PROPER normal speed audio back over the top and all was fine.
    Test video complete.
    (You can ignore the 65% slowed down audio I mentioned earlier if you like, that was just an example of a slower than 50% audio test)
    Firstly what I really want to do is to be able to slow the AUDIO down as much as possible (But still within the restraints of only being able to adjust FCPX retiming within a whole 1 percentage in the final video edit), but have the AUDIO of the song as near to/under 12 minutes as possible.
    I will then re-record the video again to this new slowed down audio.
    Secondly I will speed up the video from 12 minutes to 4 minutes.
    Thirdly I will layer the correct 100% Normal AUDIO on top.
    The FINISHED video should then look like everyone is wizzing around at high speed but the guitar playing/lyrics look like they are being played/sung at the normal speed.
    Whatever happens (due to the constraints of FCPX) I need the calculations to work so that FCPX is retimed exactly to a whole 1% for the final video to sync up correctly.
    So what I need to know in a nut shell is:-
    What calculation do I use to work out the percentage to slow a 4 minute song down to a 12 minute song?
    What calculation do I use to work out the percentage of how much I need to then speed the 12 minute video up to turn it back into a 4 minute video?
    My mind is melting

Maybe you are looking for