How do I start, stop and restart a sequence with a periodic input?

Hi,
I have written some code that will monitor my com port (rs-232) continuously for an ASCII character (in this case a 'P'). When the P is received, I want a sequence structure to start working. The P will only appear once for a short while, but the sequence should carry on running until it finishes all the frames. On the next time a P appears on my monitor, I want to either stop the sequence structure regardless of which frame its in and restart the sequence from the beginning again or to run the sequence from the start again if it has already completed all the frames.
What sort of structure do I need to do this, are there any examples?
James

James,
Indiana is correct, my take on this is similiar.
If you have a 3 element sequence structure for example which runs if 'P' is returned from your COMs thread, you will need to query a variable in each element of the sequence in order to suspend execution of the next/remaining elements in the sequence if this event occurs. You can do this by reading the variable that your COMs thread sets using a case structure in each element of your sequence. In order to re-run your sequence if 'P' is returned during the execution you can simply set the suspend variable and ensure the code is in a while loop to recall the code.
See the attached example code/screen shot:
This is however not an elegant solution and the best way would probably be using the events structure and a user event to queue the P events. This is available in 6.1 but I believe its the professional package. See also my implementation using this method, again attached below:
Hope this helps,
Kind Regards
Steven Bird
Applications Engineer
National Instruments
Attachments:
Example.JPG ‏194 KB

Similar Messages

  • How to start, stop and restart task

    Hello Everyone,
    Need advice on what is the correct way to start, stop and restart a Java task?
    I have tried with Executors.newCachedThreadPool() or fixedThreadPool() however I was only able to submit the task once. My program crashed when i tried to resubmit the task again after a shutdownnow command()

    Tasks are designed to be run once. If you want restart functionality, use a service:
    http://docs.oracle.com/javafx/2/api/javafx/concurrent/Service.html
    The sample service I posted in the following thread demonstrates how to do this:
    Multithreading
    Use of Executors is not necessary as a Service encapsulates the execution thread management (though you can set your own executor on the service if you really needed it). All you need to do is make use of the service start, cancel, restart and reset methods as required. If you do use the cancel method, then you need to make sure that your service is properly interrupt aware for the cancel to function as you expect.

  • Start, stop and restart while loops

    Hi, my qustion is i have 2 example a and example b. Example b lets u start counting up in seconds when u want to. as long as the toggle switchs are in correct position. it also lets u start, stop and restart if need be. i want to be able to that with example a, but for some reason the while loop always sets of running independent of what position the the toggle switch. Any help greatly appreciated.
    Thanks Stuart
    Attachments:
    examplealib.llb ‏202 KB
    exampleb.vi ‏25 KB

    An example as the attachment.
    Attachments:
    switch.vi ‏23 KB

  • Shell script to start, stop and restart a JAR

    Hi everyone,
    Does anyone have idea to write a shell script to start, stop and restart a JAR under linux? it can indicate a method or parameter? Thanks!
    this JAR inculdes a class with main method like this:
    public class Client(){
      public Client(String name){
      public void stopClient(){
      public static void main(String[] args){
         new Client("/tmp/text.log");
    }

    Does anyone have idea to write a shell script to
    start, stop and restart a JAR under linux? That part isn't really clear.
    Start would be java -jar myjar.jar.
    Stop could either be kill, which kills the whole process; kill -TSTP, which suspends the process, or some application-specific communication such as sending something over a port; or putting something into a file or something.
    Restart could just be the same as start (if stop is just kill); kill -CONT, if stop was kill -TSTP; or some other app-specific communication.

  • Shell script to start, stop and restart a JAR under linux

    Hi everyone,
    Does anyone have idea to write a shell script to start, stop and restart a JAR under linux? it can also indicate a method or parameter? Thanks!
    this JAR inculdes a class with main method like this:
    public class Client(){
    public Client(String name){
    public void stopClient(){
    public static void main(String[] args){
    new Client("/tmp/text.log");
    }

    Does anyone have idea to write a shell script to
    start, stop and restart a JAR under linux? That part isn't really clear.
    Start would be java -jar myjar.jar.
    Stop could either be kill, which kills the whole process; kill -TSTP, which suspends the process, or some application-specific communication such as sending something over a port; or putting something into a file or something.
    Restart could just be the same as start (if stop is just kill); kill -CONT, if stop was kill -TSTP; or some other app-specific communication.

  • How can I stop and restart a .vi with a single front panel button?

    Hey guys, a newbie here.
    I have a .vi with a stacked sequence. The first few frames are hardware initialization and settings (LIN master node) and the data the hardware should transmit (frame response table). In the next frame there's a loop in which the hardware sends and recieves data (LIN monitor). If I want to change the initialization, settings or data values, I have to stop the .vi and restart it. I was wondering if there is a simple way of doing this with a single click (a button on the front panel).
    An alternative would be to put another loop outiside the whole stacked sequence and then run it a single time with a push of a button (the inner loop should let the outer one restart), is that possible?
    I hope I made any sense. Thanks for any suggestions.
    Tomaz
    Solved!
    Go to Solution.

    Ideally, redoing the code with a state machine would be the best way to go, if only so that you can add this powerful tool to your toolbox. That being said, wrapping your existing code in a while loop, with its own stop button to stop the program, will work if executing the entire sequence is ok. Where you might run into problems with this is if there is a step in the sequence that shouldn't be executed again, then it would require wrapping that sequence frame's code in a case statement that executes only the first time through. If you have the time, learning how to use a state machine would be a real benefit, really taking your LabVIEW knowledge to the next step, if you pardon the pun.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • How should I start, stop or restart SQL services if it is in a cluster?

    Hi,
    For migration purpose I need to stop sql server services in a cluster. I don't want to failover the cluster I just want to stop the sql server services before the windows system admin shutdowns the windows server and later start again once migration is done.
    This is clone migration so I don't have to do anything except stopping and starting the services of sql. I found two places there to take service offline and online, one is just clicking the services and application and in the right hand side directly right
    clicking the instance and take service offline, another is expanding the instance and taking offline agent and sql server service one by one. 
    I don't know which is the way.
    Please some one help me.

    Hello,
    You can use SQL Server Configuration Manager, SQL Server Management Studio, Cluster Administrator.
    Do not use the Services applet in Control Panel.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Stop and restart PRD system with script

    Goodmorning,
    i would restart my server every sunday.
    For windows and all services i haven't a problem.
    But for stop and after reboot restart "SAP R/3 System" what could i do? for do this in automatic mode?
    At today i start this in handle mode.
    Thanks.

    Hi Fabrizio,
    why do you want to reboot your server every sunday?????
    If you reboot your SAP this often, you'll have performance problems every Monday. All
    of your SAP internal Buffers must be filled again after an reboot. If your DB is on the
    same Host, also your DB Buffer is empty.
    If this is an productive System, i highly recommend you that you not reboot your SAP System this often....
    (By side, thats the difference between an *nix and an Windows System.).
    What is the reason for doing that?
    confused
    Regards Manuel

  • Shell script for start stop and restart standard

    Hi,
    I'd like to know if there's a standard template for shellscript for a kind of stop|start|restart execution of a server or stub.
    If you have any link or some info that explain how to do that nicely it would be nice!
    Thank you

    There's plenty of live examples in /etc/rc.d

  • Stop and restart the USRP

    Hello,
    I have been trying to implement a small application for reception and analysis of radio signals. Well, I want to be able to stop and restart the record at wish. The first operation works fine; I can record and stop. However, when I try to record again, I get an error : "This operation requires the driver to be in the Running state". Although when stop recording it goes to initialize state (starting point) where it first started and worked properly. I've attached my VI to this thread.
    kind regards
    Attachments:
    Analysis.vi ‏59 KB

    Hi,
    I took a look at your VI and reproduced the problem in your VI but I tried to simplify the problem by trying to reproduce it in a smaller VI (attached).
    Please find the VI attached which starts aborts and restarts a acquisition with configuration stages in between. I could not reproduce the issue using the VI which I have attached.
    So I think there might be some very small issue in the VI which you posted.
    Thanks.
    Note: I used driver 14.0 which was recently released. Please ignore any driver specific VIs or connections.
    Attachments:
    Start Abort Restart.vi ‏20 KB

  • How to Stop and restart the midtier?

    Hello All,
    I have installed Oracle AS (Infraturcture & middle tier , BI & Forms) on same Linux box.i.e: Oracle As 10.1.2.0.2 (Rel 2, x86 for Linux), SLES 9
    Here is my question:
    How to Stop and restart the midtier?
    Regards,
    DN

    biforms.sh
    export ORACLE_HOME=/opt/oracle/biforms
    export OH=$ORACLE_HOME
    export PATH=$OH/bin:$OH/opmn/bin:/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/java/bin
    export ORACLE_SID=ORCL
    export LD_LIBRARY_PATH=$OH/lib:/usr/openwin/lib:/usr/dt/lib:/usr/lib:/tools/lib
    infra.sh
    export ORACLE_HOME=/opt/oracle/infra  <-- or correct one!
    export OH=$ORACLE_HOME
    export PATH=$OH/bin:$OH/opmn/bin:/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/java/bin
    export ORACLE_SID=ORCL
    export LD_LIBRARY_PATH=$OH/lib:/usr/openwin/lib:/usr/dt/lib:/usr/lib:/tools/libAs you see, only the first row differs from these two scrips. Because I'm lazy, I usualy set export OH. Under certain circumstances you might want to add DISPLAY to biforms.sh. Set it to localhost:0 or whatever is correct.
    Martin

  • How to Stop and restart the OC4J_BI_FORMS?

    I have Oracle AS 10.1.2.0.2 (Rel 2) installed. (Infratsructure & BI & Forms) on same computer.
    my question is :
    How to Stop and restart the OC4J_BI_FORMS?
    Regards,
    DN

    Just as any other OC4J:
    opmnctl stopproc -process-type=OC4J_BI_FORMS
    opmnctl startproc -process-type=OC4J_BI_FORMS
    or
    opmnctl restartproc -process-type=OC4J_BI_FORMS
    cu
    Andreas

  • After updating 10.9.2 update the computer stops and restarts abruptly and systematically whenever it is in standby.  Please how to fix this ?

    Hello,
    I'm french, sorry my bad english. Please Help me !
    After updating 10.9.2 update the computer stops and restarts abruptly and systematically whenever it is in standby (sleeping).
    This message apeaars : “Your computer restarted because of a problem”
    Please how to fix this ?
    I tried an SMC reset PRAM and reset, but not result !
    I have not installed new software or plugin. Only updated OS X 10.9.2.
    With 10.9.1 or earlier I never had a problem !
    Thank you for your help
    Francisco to Paris

    Hello FM-Paris,
    Thank you for the details of the issue you are experiencing with your Mac mini.  I would be concerned too if my Mac mini was restarting unexpectedly.  I recommend following the steps in the section titled "Troubleshooting a recurring kernel panic" in the article below to help isolate and troubleshoot this issue:
    OS X: When your computer spontaneously restarts or displays "Your computer restarted because of a problem."
    http://support.apple.com/kb/TS4636
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Imports seem to be hanging how to stop and restart

    Hi,
    I am workin on transports using transaction code STMS. I submitted the imports many hours ago and it seems that they are hanging or stopped. The Trucks are still in the column status. I do see some objects got imported but some did not.
    How can I fix this and restart the import because the Trucks are tere and I can't restart? Or how do I stop the imports or should I just let it continue? It has been hours now.
    Thanks

    hi Will,
    To change the status of the transport, you can goto STMS -> Import Overview -> select the system -> select your request and after that press Ctrl-F8 (Import Monitor). Under the 'scheduling monitor' you'll see your transport request is in running mode, delete this request.
    After you delete go back to previous screen the list of transport request, click on Refresh, you'll see your request will be in 'green' status again. ready for re-import again.
    Also check the note Note 71353 - Transports hang during background steps which may apply to your condition. Hope this help you.
    Regards,
    Mark
    PS. appreciate your point:)

  • How come when I stop and start an audio clip before its done...

    How come when I stop and start an audio clip when before its done, that when I play it it only plays part of the file?

    I'm not sure if I got you right, but do you mean that it's like pausing...
    I have never played an audio clip with java, but if this is the case, maybe you have to rewind the clip.
    /J Lindroos

Maybe you are looking for

  • Flash 10.2 not working in Windows 7 IE8 despite 'successful' installation

    Hi there, I downloaded flash player to attempt to view flash media on sites such as bbc website and youtube. Despite the installation claiming to be successful, I still cannot view video on any sites I have tried. (bbc website says I don't have the c

  • Speed-dials MIA on 7921/UCM6.1

    Hi, Recently migrated a customer to UCM6.1 from 4.3 and experienced an interesting issue. Speed-dials is no longer showing up on 7921-phones (f/w 1.2.1). The speed-dials and phone-button templates are correctly configured, but they refuse to show up

  • Upload picture to FB or KiK.

    Hello. Since i installed ios7 i cant upload pictures from my albums to Facebook nor KiK. Here is what happens,i want to use a picture that is stored in my albums, when i try to acces it from Facebook, it says that Facebook doesent have acces to it an

  • Error when data autorizations interfere with standard filters.

    Hi, We have set up data authorizations in SAP B/W where people can either see all countries or one country on the characteristic [WAWL_CTRY]. we used to have a standard filter to only allow a selection of [WAWL_CTRY] in the report. the report runs fi

  • Oracle Warehoude Builder 9i

    Hi, Does OWB 9i support the following:- 1)The extract tool must provide extract, translate and load error reports in an easily understood manner to both the end user and the systems accountant. 2)The extract tool must provide a mechanism by which ext