How to start AND end a loop using a Boolean Button set to "Switch When Released" operation

I have a Boolean button set to "Switch When Released" operation. When I press this button (now it's in the On state) I want to run a loop that does something continupously (for now, let's say it displays a simulated sine wave) until I press the button again (now the button is in the Off state) in which case, I want to end the loop. I am wiring my button to the loop condition that's set to "Continue if true" and have a "Wait Until Next ms Multiple" of 200 ms (I tried up to 500 ms). When I run the VI and press the button the first time, I see the sine wave displayed. But when I press the button again, nothing happens. It looks like it does not respond to the user interface. What's happening. What am I doing wrong? I'm using an Event Handler design pattern. I've also tried the Producer/Consumer (Events) design pattern. But I don't imagine the particular design pattern should make a difference. I've attached my code. Thanx.
Fataneh
Attachments:
My_Event_Handler.vi ‏107 KB

A simple solution would be to harness the timeout event, where you would put your data simulation. No need for parallel loops and local variables.
The event timeout is starts out as  -1 (infinite) but pressing the start/stop button toggles between a 200ms and an infinite timout whenever it is pressed. Since the evet structure always runs, all other events (e.g. stop) are also serviced.
Please ask if anything is not clear... Good luck!
Message Edited by altenbach on 07-13-2005 04:20 PM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
My_Event_HandlerMOD_CA.vi ‏116 KB

Similar Messages

  • How to start and finish a transaction using EJB 3.0 in JDeveloper

    Hello everybody!
    Does anybody can explain how to start and finish a transaction using EJB 3.0. I need to start a transaction insert some information in some tables and if everything was fine commit the information.
    I put the annotation @TransactionManagement(TransactionManagementType.BEAN) in my session bean and @Resource SessionContext ejbContext; but I don't what anything else I have to do.
    Any help will be appreciate.

    I tryied to use in the client the statement EntityTransaction transaction = myBean.getTransact(); but I receive the EJBException: Cannot use resource level transactions with a container managed EntityManager
    I just need to start a transaction something like this: transaction.begin(); and finish the transaction, something like this: transaction.commit();
    Does anybody can help?

  • How to Starting and Stopping OC4J Server using Ant

    How to Starting and Stopping OC4J Server using Ant
    In the ant task definitions for ant-oracle-classes.jar (see antlib.xml) there are two tasks called
         name="restartServer" classname="oracle.ant.taskdefs.deploy.JSR88StartServer"
         name="shutdownServer" classname="oracle.ant.taskdefs.deploy.JSR88ShutdownServer"
    I thought that these would shutdown and start the OC4J server. I guessed the parameters as – (Does anyone know where 50 ant targets are documented?)
    <oracle:restartServer
    userid="${oc4j.admin.user}"
         password="${oc4j.admin.password}"
         deployeruri="${deployer.uri}"
    />
    <oracle:shutdownServer
         userid="${oc4j.admin.user}"
         password="${oc4j.admin.password}"
         deployeruri="${deployer.uri}"
    />
    This, however does not start and stop the SOA suite. To do that I've hacked this solution together -
    <path id="oc4j.console">
         <pathelement location="${oracle.home}/config"/>
         <pathelement location="${oracle.home}/jlib/startupconsole.jar"/>
         <pathelement location="${oracle.home}/opmn/lib/optic.jar"/>
         <pathelement location="${oracle.home}/lib/xmlparserv2.jar"/>
    </path>
    <target name="stop" description="stop oc4j server" depends="init">
         <java classname="oracle.appserver.startupconsole.view.Runner">
              <classpath refid="oc4j.console"/>
              <sysproperty key="ORACLE_HOME" path="${oracle.home}"/>
              <arg value="stop"/>
         </java>
    </target>
    <target name="start" description="restart oc4j server" depends="init">
         <java classname="oracle.appserver.startupconsole.view.Runner">
              <classpath refid="oc4j.console"/>
              <sysproperty key="ORACLE_HOME" path="${oracle.home}"/>
              <arg value="start"/>
         </java>
    </target>
    This sort of works – except when the SOA suite doesn't stop cleanly – and needs user interaction to press a Close button. This isn't very useful when doing a continous integration build and deploy.
    So, does anyone have any suggestions or alternative methods to do this?
    - frank

    Actually if the server throws exceptions when it stops (which it always has since we applied patch 10.1.3.3) this technique will pause until a user responds to pop-up ... So a better way (I think) is -
    <target name="start" description="start oc4j server" depends="init">
    <java classname="oracle.appserver.startupconsole.view.Runner">
    <classpath refid="oc4j.console"/>
    <sysproperty key="ORACLE_HOME" path="${oracle.home}"/>
    <arg value="start"/>
    </java>
    </target>
    <target name="stop" description="stop oc4j server" depends="init">
    <echo message="We expect OC4J *NOT* to stop cleanly, so we will timeout after 3 minutes ..."/>
    <java classname="oracle.appserver.startupconsole.view.Runner" fork="true" timeout="180000">
    <classpath refid="oc4j.console"/>
    <sysproperty key="ORACLE_HOME" path="${oracle.home}"/>
    <arg value="stop"/>
    </java>
    </target>
    <target name="restart" description="restart oc4j server">
    <antcall target="stop"/>
    <!-- wait for server to quieten down -->
    <waitfor maxwait="2" maxwaitunit="minute">
    <not><http url="http://${oc4j.http.hostname}:${oc4j.http.port}"/></not>
    </waitfor>
    <antcall target="start"/>
    </target>

  • Warp Stabilizer: How to Start and End Full Frame?

    Often I only need to stabilize part of a scene so I just crop the segment to be stabilized. But I want the transition to and from the stabilized segment to be smooth. There is no "timer" so I cannot change the level of stabilization from 0% to 100% over a period of 1-2 seconds. So how do I achieve this?

    In the past when I wanted to stabilize a portion of a clip, I'd stabilize the part of it that I needed stabilized and then crop the non-stabilized part in to match the percentage that's scaled and then use the motion settings to sort of move the clip around to match the start or end frame that's stabilized. It's not perfect, but it's fairly seemless. Yeah, it would be nice to gradually de-stabilize something but for now, this is what we do on the rare occasion that we need to do it. Warp Stabilizer in After Effects is a bit more fully featured so maybe there's a way to do it there, I don't know.
    Good luck!

  • NI PCI 6225: How to start and stop an acquisition using triggers

    Hi,
    Hi already spent two days reading the previous post on start/stop trigger and end up with just a complet breakdown....
    I'm using a NI PCI 6225 for a project on brain activity.
    I want to start the aquisition of 10 channels at 1Khz on a first trigger (i.e. portline 0) and stop it on a second trigger (i.e. portline 1). The duration of the recording should not exceed 5min.
    Any help will really be apreciated as well as some explanations. I'm not an expert but I do can understand if I'm being explained...slowly. I hope this post will not contribute additionally to the/my confusion on this topic....
    Thanks for your attention and help,
    OD

    Hi,
    Unfortunately, it is not possible to stop the acquisition with a second trigger (just start the task). There are some approaches to what you need, but not exactly the same. Please take a look to the next example.
    http://zone.ni.com/devzone/cda/epd/p/id/5028
    I think the only way to perform what you need will be by software and with all the consideration about timing that you should already know.
    Regards,
    Richard.

  • I am having data i want to measure pulse width without using hardware and tell me how to start and stop soft timer using labview

    soft pulse width measurement

    If you are creating a pulse in software somehow, then you can use Pulse Measurements.vi that's on the Analyze>Waveform Measurements palette. This will require that the input is of the waveform data type with signal and timing information. There's several timing functions on the time & Dialog palette that you could probably use. Check out Tick Count and Elapsed Time. If you could provide more details on what exactly you need to do, we could provide more help.

  • How to print the Module pool screen using a push button in the screen

    Hi Every one,
                         i have developed a module program , which have a selection screen and it display the output in a structured way.
    output includes boxes, texts etc...
    my problem is :---
    How to print the Module pool screen using a push button in the screen.

    When the "Print" button is pressed:
    leave to list-processing and return to screen 100.  "(current screen)
    Call a transaction that runs your print program.
    Rob

  • Editing Loop Start and End times via automation / MIDI controllers?

    I'm trying to play a sample in EXS24 and have the Sample Start, Loop Start and End times manipulated over the course of the song. I've tried to open up the EXS sample editor, click on the numerical value of the Loop Start, and then attempt to Learn Automation. All it does is assign the knob for the instrument Volume Level. Is there any way to do this? It's basically how an Akai S612 works: http://www.vintagesynth.com/akai/s612.shtml
    I switched gears and tried it also with Battery, and there's a way to map the Start and End times in there, but it's not seeming to work as I've intended. I can't seem to make the loops move as they should and there's ways to use up to 4 loops, but not a way to target each loop's start and end points via separate controllers.
    I could use my S-612 [and probably will], but in moments where I don't have one available, I'd love to find a solution to this.
    Thanks,
    +odd

    Anyone with any thoughts? would be great to solve this.

  • How do I stop calendar inserting 'starts' and 'ends'

    I have recently bought a new laptop ( OS Yosemite version 10.10.2) and find the automatic entering of 'starts' and 'ends' times on my entries in calendar very irritating.
    How do I stop it doing this ?
    The previous version I used did not do this automatically by default.

    I had the Integrated Gmail 2.5.5 addon enabled.
    After disabling the addon the problem is gone.
    Hope it works to you guys.

  • How to get start and end time of an ESB instance in SOA 10.1.3.4

    Hi All,
    I am using soa 10.1.3.4 and want to track the esb instance start and end time. (For example, in case of bpel we can query the cube instance table to get creation and modify time of an instance. )
    How to get that in esb?
    Thank you.
    Regards,
    Satish

    Hi Satish
    You may enable instance tracking option on the ESB Console and track the instances audit information and also from the logs(log.xml) when ESB loggers are set to DEBUG mode.
    Regards
    A

  • How can I control the video playback start and end time?

    I'd like to be able to start a video/audio playback at a particular point in time say 3 seconds from the starts of the video and play it for only 3 seconds. How can I set the unique start and end points rather than play the whole video. I'd also like to be able to do this using the SeriesElement so I can set the start and end play points for a series of stacked videos. How can this be achieved?

    Not sure I understand the question.  Can't you just append the param to the URL?  Like so:
    var url = new URL("http://video-research/video.f4v?start_time=500");
    If your question is more about playing a subclip of a progressive video, that's not something OSMF has support for.  You'd need to write a server script which checks for that parameter and then returns the relevant portion of the requested file.  (This is typically referred to as "pseudo-streaming", if you Google that term you'll find a wealth of info.)

  • How to Print Project Edit Logs incl info on start and end of clips

    I would also be interested in how to share these electronically.

    If you are re-capturing then you must have used Capture Now to get the clip first time round or you would have run into the same trouble with pre-roll. You'll have to capture the clip again using the same method. Of course, the chances of getting the same start and end code using Capture Now are slim, but if you can get in earlier and out later then you should be able to manually re-connect the clip.
    rh

  • How to input my own Validity Start and End Dates in ME21N

    Hi All,
    I have to change the Validity Start and Validity End date in Addiitional Data Tab of ME21 transaction( PO Create ) using default Customer Values.How Can i accomplish it?
    I have used the BAdI ME_PROCESS_PO_CUST and implemented it, I have coded in the method PROCESS_HEADER.First I retrieved the data using get_data( ) method, changed the values with Customer Values and called the method set_data( ).
    However my validity start and End Dates and not changing.
    Even in ME21N if I create the PO with my own Validity Start and End dates, and go to ME23N to display the created PO, still in the additional data tab, the start and End dates are current date and Next date respectively.why its happening?
    Thanks in advance

    Hi,
    Can you please let us know in which business scenario this is required.
    SAP has provided separate functionality of Outline Agreement for considering validity period.
    If you let us know the business scenarion some solution/workaround can be suggested.
    Regards

  • I've updated to yosemite from Mavericks, but since i can't connect to the internet I used my time machine back up which was march 2013. Now my macbook pro won't start and ends with a prohibited ted sign. Any suggestions pls.

    I've updated to yosemite from Mavericks, but since i can't connect to the internet I used my time machine back up which was march 2013. Now my macbook pro won't start and ends with a prohibted sign. Any suggestions pls.

    Install or Reinstall Yosemite, Mavericks, Mountain Lion, or Lion from Scratch
    Be sure you backup your files to an external drive or second internal drive because the following procedure will remove everything from the hard drive.
    How to Clean Install OS X Yosemite
    OS X Mavericks- Erase and reinstall OS X
    OS X Mountain Lion- Erase and reinstall OS X
    OS X Lion- Erase and reinstall Mac OS X
    Note: You will need an active Internet connection. I suggest using Ethernet if possible
                because it is three times faster than wireless.

  • How to find START and END block number in a datafile?

    Hi Guys,
    I am trying to use dbverify utility with "start" and "end" flags in it. How can I find the starting block # and ending block # of a datafile. I checked v$datafile query but its not very helpful. Any help would be appreciated.
    MM

    If you mean used blocks, then check out DBA_EXTENTS

Maybe you are looking for