Help with a state machine

I am trying to setup a structure such that when a button is pressed
(boolean True/False) that N cycles( N comes from a numeric control) of a
while loop are executed and then the button is then set to false. I'm
new to labview so if this is a simple question I apologize. I'm using
V5.01
Thanks
Jim Stockton

Jim Stockton wrote in message
news:[email protected]...
> I am trying to setup a structure such that when a button is pressed
> (boolean True/False) that N cycles( N comes from a numeric control) of a
> while loop are executed and then the button is then set to false. I'm
> new to labview so if this is a simple question I apologize. I'm using
> V5.01
> Thanks
> Jim Stockton
Like this?
[Attachment timer.vi, see below]
Attachments:
timer.vi ‏22 KB

Similar Messages

  • Help me with a state machine design

    I have a little bit of a problem.  I have a system with several modes, each selected by the user and called with a case structure.  Each case in the case structure is its own state machine with a few states (like 4-6).  Now here's the catch.  I need one of the states within one of the modes to call and execute an entirely different mode (and all of its states) without actually changing the mode command, and to do so every iteration until I jump out of that state into another state within the first mode.
    Is there a simple way to do that that I'm just not thinking of?
    Lee Jay

    Lee, my first thought would be to use just a big state machine.  For example if each mode needs 4 states, mode 1 gets states 0-3, mode 2 get states 4-7, and so on.  This way, if you need to change modes in the middle of another mode, you just direct the state selector to the state that starts the mode.  (If that makes sense).  It's not real elegant, but it works fairly well as you still maintain the flexibilty of the state machine design, including the ability to add and rearrange cases. 
    Don't forget you can use any method to select the cases, including strings, so you have full flexibility with how you setup case select.
    Troy

  • How to use a event structure with a state machine

    First, I would like to inform you that I only work on LabView part time, and have much to learn.  Anything I do learn, I usually forget until I need it again, because I only work on it part time.
    Using your StopWhileLoopMOD[1].vi, I am trying to put a state machine inside the event structure.  
    Related link: http://forums.ni.com/t5/LabVIEW/How-to-stop-while-loop-in-Event-case/td-p/465564/page/2
    Here is my application:  on the front panel, the user can select any combination of 7 different tests.  I have created cases to perform each step of each test in the correct order, but if the user presses stop, the tests won't stop because some of the cases have a while loop inside the event structure (like you mentioned is a bad idea).  The user should be able to stop the test, reselect tests to perform, and re-start the tests. 
    When the start button is pressed for the event structure, I need all the cases to run in the proper order, unless stop is pressed.
    In the past I have indexed an array and used that to run the state machine, but it won't stop immediately.  
    I have sub VIs that are built in while loops because the outputs of the product needs time to stabilize.  The state machine stops and waits up to a certain number of iterations.  If it passes the test, the while loop stops and the next state starts.  If it takes too long, it exits and reports an error.  Maybe I need to just use the state machine and not an event structure?
    Is there a good example of an event structure?
    metzler CLAD
    Solved!
    Go to Solution.

    I'm not sure exactly what you are asking, but it sounds like you want to script a bunch of tests and if the user says stop, to immediately stop the current test and abandon the others?  I'm going to assume that you know how to clear the array so that it will abandon the others, so I'm guessing that you are having trouble abandoning the current test?  If this is indeed the case, then the problem is that you are not able to propagate the message from the main VI FP which is the GUI to the sub vi which is the test, where the test may or may not have a GUI (FP visible) of it's own.  Threading was the first thing to come to mind, but this may not be necessary using events.
    You can do this by passing a refnum of the stop button to the subVI, where you can then add that wait to the event case structure.
    I've attached 2 VIs, mainvi.vi which is just a loop displays the count*2 (number of seconds passed since running) that will call subvi.vi and then check to see if the stop button is pressed.  mainvi.vi is by no means a state engine, it is just a simple loop for demonstration purposes.  subvi.vi just waits 2 seconds and leaves, it is a better structured state engine with an init state to start a poll case to wait for events and an exit state to clean up.  You can modify this any way you wish to get it to do what you want.  You will note that even if subvi.vi is being executed, it will terminate immediately when the stop button is pressed.
    Hope this helps.
    A
    Attachments:
    mainvi.vi ‏17 KB
    subvi.vi ‏33 KB

  • Producer Consumer with a state machine within the consumer

        Hi All,
    I have been trying to develop a data acquisition system with the producer consumer architecture.  To the left of the two main loops I initialize the serial port and any constants and variables im using.  I also have an obtain queue VI needed for enqueue and dequeue. Then in the producer loop i have a state machine.  The first state is where I wait for a button press on the front panel to write a GO signal on the serial line which will tell the device connected to the serial port to begin sampling data.  After this button press I go into the next state which is called my read state.
    In the read state I use a property node to read all of the available bytes at the serial port and then enqueue this collected data into a queue.  The state machine then is directed to continously go to the read state again and collect more data.
    Now this is where my dilemma is......  The consumer loop has the dequeue VI inside it and after this VI i have a state machine (while loop and case structure) which contains the following states
    1.  Build Array - build an array from the dequeue element and if there is any left over data from the parsing states it will build an array with the left over data and the dequeued data
    2.  Determine packet type - this state looks for the packet type byte(not necessarily the first byte in the message) and also check the next byte (packet length) to ensure that I am at the begininng of this chunk of data.  This state may be a little slow because there can be three different packet types and based on this byte and the packet length it may have to search the array several time to find the valid starting point.  This state also determine the next state to go to based on the packet type.
    3 packet type 1 parsing - parse data and store the remaining data it leftOver array.  Go to exit state.
    4 packet type 2 parsing - "" ""
    5 packet type 3 parsing - "" ""
    6 exit - leave this state machine and fall back to the consumer while loop.
    After it exit I think it should fall back to the consumer while loop and dequeue more data and enter the state machine again to build a new array with the dequeued data and leftover data.  It seems to work when I trace the execution using the Highlight execution feature, however when I run this all at full speed, it seems to go into the consumers 1st and 2nd states back and forth and not completely go through the state machine.
    I tried adding in a delay in the producer loop to give the consumer loop time, but I didnt notice any difference.  Is it possible that my dequeue element is retreiving more data while im still in the state machine, causing the execution to leave the state machine before it finished all states?
    Is there a better approach to take to solve this problem. Basically I need to read data at a 1,000,000 baudrate and parse it as quickly as possible so that I can break it up into 3 different packet types, write the data to a file, and graph the actual data (header info removed) in realtime.  I need to also ensure that I am not losing any of the collected data.  Data loss cannnot occur.

    A couple of things more to go along with Ben's pointers:
    You convert your data from a string, to a U8 array, to a Hex string array in the producer loop, then convert back to a integer to determine what to do with it.  In the process, you create two or three copies of your data, slowing yourself down quite a bit.  The code would be quite a bit more efficient if you left the data as a U8 array.  You can change the format of the controls and indicators to show hex values instead of integer by right clicking on them and selecting Format and Precision...
    Your search code is fairly inefficient.  I made a whack at making it a bit better.  See attachment below.
    If you continue to run into race conditions, you can debug them using a calls to the Windows debug write sprinkled liberally about your code.  Check out the post here for more information.
    Don't let your lack of format LabVIEW training stop you.  The biggest thing to get is the data flow paradigm (aka data is wires, not registers).  Once you get past that and learn how to pass data around using shift registers, queues, events, etc, you are most of the way to mastering LabVIEW.  The rest is just learning the plethora of functionality LabVIEW gives you (yes, I have reimplemented LabVIEW native code more than once in the process of learning).
    Let us know if you need more help.
    This account is no longer active. Contact ShadesOfGray for current posts and information.
    Attachments:
    serialUtil_V3_DFG.zip ‏137 KB

  • Double Click Property Node not functioning with Queued State Machine

    I am writing an application which relies on input from the operator to start different steps in a process of steps.  I am using a queued state machine, however I cannot get the Double-Click property of my listbox to function with in this Queued state machine.  I have tried Creating a refrence to the Listbox and creating a property node from that refrence.  I have tried a property node of the control.  The double click functon works only if the queueing is not occuring.  It has something to do with the queue but I am at a loss as to what is causing it.  Any help would be GREATLY appreciated.  I have attached a simplified version of the state machine with the double click function.  Thanks for any help on this.  It is written in LV7.1
    Attachments:
    Test Q.llb ‏55 KB

    Hi
    Its  Simple....
    Your Properrty node is not getting read..... dont understand how..
    see the attachment...
    now laugh at your small mistake... (even i have the habbit of making such small mistakes ;-) )
    Message Edited by Tushar Jambhekar on 01-11-2006 11:38 AM
    Tushar Jambhekar
    [email protected]
    Jambhekar Automation Solutions
    LabVIEW Consultancy, LabVIEW Training
    Rent a LabVIEW Developer, My Blog
    Attachments:
    Test Q.llb ‏55 KB
    Picture.JPG ‏44 KB

  • Help with if statement in cursor and for loop to get output

    I have the following cursor and and want to use if else statement to get the output. The cursor is working fine. What i need help with is how to use and if else statement to only get the folderrsn that have not been updated in the last 30 days. If you look at the talbe below my select statement is showing folderrs 291631 was updated only 4 days ago and folderrsn 322160 was also updated 4 days ago.
    I do not want these two to appear in my result set. So i need to use if else so that my result only shows all folderrsn that havenot been updated in the last 30 days.
    Here is my cursor:
    /*Cursor for Email procedure. It is working Shows userid and the string
    You need to update these folders*/
    DECLARE
    a_user varchar2(200) := null;
    v_assigneduser varchar2(20);
    v_folderrsn varchar2(200);
    v_emailaddress varchar2(60);
    v_subject varchar2(200);
    Cursor c IS
    SELECT assigneduser, vu.emailaddress, f.folderrsn, trunc(f.indate) AS "IN DATE",
    MAX (trunc(fpa.attemptdate)) AS "LAST UPDATE",
    trunc(sysdate) - MAX (trunc(fpa.attemptdate)) AS "DAYS PAST"
    --MAX (TRUNC (fpa.attemptdate)) - TRUNC (f.indate) AS "NUMBER OF DAYS"
    FROM folder f, folderprocess fp, validuser vu, folderprocessattempt fpa
    WHERE f.foldertype = 'HJ'
    AND f.statuscode NOT IN (20, 40)
    AND f.folderrsn = fp.folderrsn
    AND fp.processrsn = fpa.processrsn
    AND vu.userid = fp.assigneduser
    AND vu.statuscode = 1
    GROUP BY assigneduser, vu.emailaddress, f.folderrsn, f.indate
    ORDER BY fp.assigneduser;
    BEGIN
    FOR c1 IN c LOOP
    IF (c1.assigneduser = v_assigneduser) THEN
    dbms_output.put_line(' ' || c1.folderrsn);
    else
    dbms_output.put(c1.assigneduser ||': ' || 'Overdue Folders:You need to update these folders: Folderrsn: '||c1.folderrsn);
    END IF;
    a_user := c1.assigneduser;
    v_assigneduser := c1.assigneduser;
    v_folderrsn := c1.folderrsn;
    v_emailaddress := c1.emailaddress;
    v_subject := 'Subject: Project for';
    END LOOP;
    END;
    The reason I have included the folowing table is that I want you to see the output from the select statement. that way you can help me do the if statement in the above cursor so that the result will look like this:
    emailaddress
    Subject: 'Project for ' || V_email || 'not updated in the last 30 days'
    v_folderrsn
    v_folderrsn
    etc
    [email protected]......
    Subject: 'Project for: ' Jim...'not updated in the last 30 days'
    284087
    292709
    [email protected].....
    Subject: 'Project for: ' Kim...'not updated in the last 30 days'
    185083
    190121
    190132
    190133
    190159
    190237
    284109
    286647
    294631
    322922
    [email protected]....
    Subject: 'Project for: Joe...'not updated in the last 30 days'
    183332
    183336
    [email protected]......
    Subject: 'Project for: Sam...'not updated in the last 30 days'
    183876
    183877
    183879
    183880
    183881
    183882
    183883
    183884
    183886
    183887
    183888
    This table is to shwo you the select statement output. I want to eliminnate the two days that that are less than 30 days since the last update in the last column.
    Assigneduser....Email.........Folderrsn...........indate.............maxattemptdate...days past since last update
    JIM.........      jim@ aol.com.... 284087.............     9/28/2006.......10/5/2006...........690
    JIM.........      jim@ aol.com.... 292709.............     3/20/2007.......3/28/2007............516
    KIM.........      kim@ aol.com.... 185083.............     8/31/2004.......2/9/2006.............     928
    KIM...........kim@ aol.com.... 190121.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190132.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190133.............     2/9/2006.........2/9/2006.............928
    KIM...........kim@ aol.com.... 190159.............     2/13/2006.......2/14/2006............923
    KIM...........kim@ aol.com.... 190237.............     2/23/2006.......2/23/2006............914
    KIM...........kim@ aol.com.... 284109.............     9/28/2006.......9/28/2006............697
    KIM...........kim@ aol.com.... 286647.............     11/7/2006.......12/5/2006............629
    KIM...........kim@ aol.com.... 294631.............     4/2/2007.........3/4/2008.............174
    KIM...........kim@ aol.com.... 322922.............     7/29/2008.......7/29/2008............27
    JOE...........joe@ aol.com.... 183332.............     1/28/2004.......4/23/2004............1585
    JOE...........joe@ aol.com.... 183336.............     1/28/2004.......3/9/2004.............1630
    SAM...........sam@ aol.com....183876.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183877.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183879.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183880.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183881.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183882.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183883.............3/5/2004.........3/8/2004.............1631
    SAM...........sam@ aol.com....183884.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183886.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183887.............3/5/2004.........3/8/2004............     1631
    SAM...........sam@ aol.com....183888.............3/5/2004.........3/8/2004............     1631
    PAT...........pat@ aol.com.....291630.............2/23/2007.......7/8/2008............     48
    PAT...........pat@ aol.com.....313990.............2/27/2008.......7/28/2008............28
    NED...........ned@ aol.com.....190681.............4/4/2006........8/10/2006............746
    NED...........ned@ aol.com......95467.............6/14/2006.......11/6/2006............658
    NED...........ned@ aol.com......286688.............11/8/2006.......10/3/2007............327
    NED...........ned@ aol.com.....291631.............2/23/2007.......8/21/2008............4
    NED...........ned@ aol.com.....292111.............3/7/2007.........2/26/2008............181
    NED...........ned@ aol.com.....292410.............3/15/2007.......7/22/2008............34
    NED...........ned@ aol.com.....299410.............6/27/2007.......2/27/2008............180
    NED...........ned@ aol.com.....303790.............9/19/2007.......9/19/2007............341
    NED...........ned@ aol.com.....304268.............9/24/2007.......3/3/2008............     175
    NED...........ned@ aol.com.....308228.............12/6/2007.......12/6/2007............263
    NED...........ned@ aol.com.....316689.............3/19/2008.......3/19/2008............159
    NED...........ned@ aol.com.....316789.............3/20/2008.......3/20/2008............158
    NED...........ned@ aol.com.....317528.............3/25/2008.......3/25/2008............153
    NED...........ned@ aol.com.....321476.............6/4/2008.........6/17/2008............69
    NED...........ned@ aol.com.....322160.............7/3/2008.........8/21/2008............4
    MOE...........moe@ aol.com.....184169.............4/5/2004.......12/5/2006............629
    [email protected]/27/2004.......3/8/2004............1631
    How do I incorporate a if else statement in the above cursor so the two days less than 30 days since last update are not returned. I do not want to send email if the project have been updated within the last 30 days.
    Edited by: user4653174 on Aug 25, 2008 2:40 PM

    analytical functions: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions2a.htm#81409
    CASE
    http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/02_funds.htm#36899
    http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/04_struc.htm#5997
    Incorporating either of these into your query should assist you in returning the desired results.

  • Help with If statement please

    Hi,
    First Special thanks to Kglad for the help with the AS1 to AS3 conversion.
    I've been able to link up my buttons to play a different frames of the movie. this was my novice way of finally getting the programming to work.
    In frame 95 I have
    var myLoader:Loader = new Loader();
    addChild(myLoader); var url:URLRequest = new URLRequest("page1.swf");
    myLoader.load(url);
    in frame 165:
    var myLoader1:Loader = new Loader();
    addChild(myLoader1); var url1:URLRequest = new URLRequest("page1.swf");
    myLoader1.load(url1);
    My buttons link to 116 which plays a frame and loads ^
    in frame 226: removeChild(myLoader).
    But if the user has looped back into home from another part in the movie clip then it would need to remove myLoader1 instead of myLoader.
    I'm guessing there is some really dynamic way to solve the programatic nightmare i'm developing, but I'm really novice.
    So what i need is an if statement for frame 226
    That would do something:
    if(myLoader <> null
         removeChild(myLoader)
    else(
    removechild(myLoader1)
    Anyone have a method for this?

    yes, you can use the same urlrequest but just change its url property:
    // initialize, for example in frame 1.  this is done once and never again:
    var loader:Loader=new Loader();
    var urlR:URLRequest=new URLRequest();
    //  then in frame 2, for example:
    urlR.url="page1.swf";
    loader.load(urlR);
    //  in frame 20, for example:
    urlR.url="page2.swf";
    loader.load(urlR);
    // in frame 30, for example:
    urlR.url="page3.swf";
    loader.load(urlR);
    //etc.  if you're loading any swfs that play streams (sound or video), you'll want to add some code to this.

  • Help with Switch statements using Enums?

    Hello, i need help with writing switch statements involving enums. Researched a lot but still cant find desired answer so going to ask here. Ok i'll cut story short.
    Im writing a calculator program. The main problem is writing code for controlling the engine of calculator which sequences of sum actions.
    I have enum class on itself. Atm i think thats ok. I have another class - the engine which does the work.
    I planned to have a switch statement which takes in parameter of a string n. This string n is received from the user interface when users press a button say; "1 + 2 = " which each time n should be "1", "+", "2" and "=" respectively.
    My algorithm would be as follows checking if its a operator(+) a case carry out adding etc.. each case producing its own task. ( I know i can do it with many simple if..else but that is bad programming technique hence im not going down that route) So here the problem arises - i cant get the switch to successfully complete its task... How about look at my code to understand it better.
    I have posted below all the relevant code i got so far, not including the swing codes because they are not needed here...
    ValidOperators v;
    public Calculator_Engine(ValidOperators v){
              stack = new Stack(20);
              //The creation of the stack...
              this.v = v;          
    public void main_Engine(String n){
           ValidOperators v = ValidOperators.numbers;
                    *vo = vo.valueOf(n);*
         switch(v){
         case Add: add();  break;
         case Sub: sub(); break;
         case Mul: Mul(); break;
         case Div: Div(); break;
         case Eq:sum = stack.sPop(); System.out.println("Sum= " + sum);
         default: double number = Integer.parseInt(n);
                       numberPressed(number);
                       break;
                      //default meaning its number so pass it to a method to do a job
    public enum ValidOperators {
         Add("+"), Sub("-"), Mul("X"), Div("/"),
         Eq("="), Numbers("?"); }
         Notes*
    It gives out error: "No enum const class ValidOperators.+" when i press button +.
    It has nothing to do with listeners as it highlighted the error is coming from the line:switch(v){
    I think i know where the problem is.. the line "vo = vo.valueOf(n);"
    This line gets the string and store the enum as that value instead of Add, Sub etc... So how would i solve the problem?
    But.. I dont know how to fix it. ANy help would be good
    Need more info please ask!
    Thanks in advance.

    demo:
    import java.util.*;
    public class EnumExample {
        enum E {
            STAR("*"), HASH("#");
            private String symbol;
            private static Map<String, E> map = new HashMap<String, E>();
            static {
                put(STAR);
                put(HASH);
            public String getSymbol() {
                return symbol;
            private E(String symbol) {
                this.symbol = symbol;
            private static void put(E e) {
                map.put(e.getSymbol(), e);
            public static E parse(String symbol) {
                return map.get(symbol);
        public static void main(String[] args) {
            System.out.println(E.valueOf("STAR")); //succeeds
            System.out.println(E.parse("*")); //succeeds
            System.out.println(E.parse("STAR")); //fails: null
            System.out.println(E.valueOf("*")); //fails: IllegalArgumentException
    }

  • Serial commands with a state machine

    Hi,
    I am reading with VISA from a serial device. I write to the serial the start character and the device is sending some data.
    Now after I read the data I want to stop the sending by writing to serial a stop character. The reading is in a separate loop.
    I want to make a stop button that writes to serial and a start button that writes to serial and reads the data. Is there any way to do this without a state machine ?
    Btw, is there any examples for a Serial reading and writing state machine ?
    Solved!
    Go to Solution.

    Remove your first while loop.  You are initializing the serial port over and over again until you press OK.  You only need to initialize once.  Put all of the code before the loop.  The loop should just delay for a few mS until the OK is pressed.  You should always put a dely in a loop so as not to chew up 100% CPU time.  Even a 0mS delay will allow the CPU time to do other things.
    In the second loop, since you have an event structure, you don't need a delay.  But you do need to wire in a value to the Timeout hourglass icon on the top left corner.  I typically use 100.  Again this is to prevent 100% CPU usage.
    Do you understand data flow execution?  This means that a loop or block of code or a function will not execute until all of its inputs are present.  Your third loop will not start until you press the quit button because you have two wires going from the second loop to the third.  These wires will only pass their data to the third loop when the second loop is over (pressing the quit button).  When you press quit, the second loop terminates and data goes to the third loop.  Now all of the third loop's inputs are present and it can execute.  This is not what you want.  Delete the wires between second and third loop.  Then the third loop will execute from the beginning.  The serial read control will tell it when to read and when not to read.  You will need to pass the VISA Resource Name to the third loop by using a Local Variable.  From your statement, it sounds like you already did this.  Pass a no error condition into the third loop also.  You can make one or use a local variable of error in.
    In the third loop, you have the VISA Close inside the loop.  This is not good.  The VISA session will close before you read.  Move this to after the third loop.  Then it will close only after the third loop stops.
    After you delete the wires between loops 2 and 3, you will have to merge errors from the second and third loops to make sure you catch all errors.
    In each one of your loops, replace the VISA Session terminals and Error terminals with shift registers.  This is good practice and is recommended by NI.  With terminals, if there is an error on one loop iteration, it will get lost because the next iteration takes in the original no error condition from the left side.  With a shift register, the error gets propogated to the next loop iteration.  If your loop executes zero times (For Loops can do this), the output of the VISA terminal will be a null value and the VISA close will cause an error.  With a shift register, even if the loop does not iterate at all, the VISA Session value on the input will be propogated to the output.
    I think that is enough for now.  Please make these changes and re-post your vi.  You are making good progress.
    - tbob
    Inventor of the WORM Global

  • Help with if statement for a beginner.

    Hello, I’m new to the dev lark and wondered if someone could point me in the right direction.
    I have the following (working!) app that lets users press a few buttons instead of typing console commands (please do not be too critical of it, it’s my first work prog).
    //DBS File send and Receive app 1.0
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.BorderLayout;
    import java.awt.FlowLayout;
    import java.awt.Font;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JCheckBox;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTextArea;
    import java.applet.Applet;
    public class Buttons extends JFrame
         public Buttons()
              super("DBS 2");          
              JTextArea myText = new JTextArea   ("Welcome to the DBS application." +
                                                           "\n" +
                                                           "\n\n1. If you have received an email informing you that the DBS is ready to dowload please press the \"Receive DBS\" button." +
                                                           "\n" +
                                                           "\n1. Once this has been Received successfully please press the \"Prep File\" button." +
                                                           "\n\n2. Once the files have been moved to their appropriate locations, please do the \"Load\" into PAS." +
                                                           "\n\n3. Once the \"Load\" is complete, do the \"Extract\"." +
                                                           "\n\n4. When the \"Extract\" has taken place please press the \"File Shuffle\" button." +
                                                           "\n\n5. When the files have been shuffled, please press the \"Send DBS\" Button." +
                                                           "\n\nJob done." +
                                                           "\n", 20,50);
              JPanel holdAll = new JPanel();
              JPanel topPanel = new JPanel();
              JPanel bottomPanel = new JPanel();
              JPanel middle1 = new JPanel();
              JPanel middle2 = new JPanel();
              JPanel middle3 = new JPanel();
              topPanel.setLayout(new FlowLayout());
              middle1.setLayout(new FlowLayout());
              middle2.setLayout(new FlowLayout());
              middle3.setLayout(new FlowLayout());
              bottomPanel.setLayout(new FlowLayout());
              myText.setBackground(new java.awt.Color(0, 0, 0));     
              myText.setForeground(new java.awt.Color(255,255,255));
              myText.setFont(new java.awt.Font("Times",0, 16));
              myText.setLineWrap(true);
              myText.setWrapStyleWord(true);
              holdAll.setLayout(new BorderLayout());
              topPanel.setBackground(new java.awt.Color(153, 101, 52));
              bottomPanel.setForeground(new java.awt.Color(153, 0, 52));
              holdAll.add(topPanel, BorderLayout.CENTER);
              topPanel.add(myText, BorderLayout.NORTH);
              setSize(700, 600);
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              getContentPane().add(holdAll, BorderLayout.CENTER);
              Container c = getContentPane();
              c.setLayout(new FlowLayout());
              final JButton receiveDBS = new JButton("Receive DBS"); //marked as final as it is called in an Inner Class later
              final JButton filePrep = new JButton("Prep File");
              final JButton fileShuffle = new JButton("File Shuffle");
              final JButton sendDBS = new JButton("Send DBS");
              JButton exitButton = new JButton("Exit");
    //          JLabel statusbar = new JLabel("Text here");
              receiveDBS.setFont(new java.awt.Font("Arial", 0, 25));
              filePrep.setFont(new java.awt.Font("Arial", 0, 25));
              fileShuffle.setFont(new java.awt.Font("Arial", 0, 25));
              sendDBS.setFont(new java.awt.Font("Arial", 0, 25));
              exitButton.setBorderPainted ( false );
              exitButton.setMargin( new Insets ( 10, 10, 10, 10 ));
              exitButton.setToolTipText( "EXIT Button" );
              exitButton.setFont(new java.awt.Font("Arial", 0, 20));
              exitButton.setEnabled(true);  //Set to (false) to disable
              exitButton.setForeground(new java.awt.Color(0, 0, 0));
              exitButton.setHorizontalTextPosition(SwingConstants.CENTER); //Don't know what this does
              exitButton.setBounds(10, 30, 90, 50); //Don't know what this does
              exitButton.setBackground(new java.awt.Color(153, 101, 52));     
              topPanel.add(receiveDBS);
              middle1.add(filePrep);
              middle2.add(exitButton);
              middle3.add(fileShuffle);
              bottomPanel.add(sendDBS);
              receiveDBS.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae)
                        if (ae.getSource() == receiveDBS);
                        try
                             Runtime.getRuntime().exec("cmd.exe /c start c:\\DBS\\ReceiveDBSfile.bat");
                        catch(Exception e)
                             System.out.println(e.toString());
                             e.printStackTrace();
              filePrep.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae)
                        if (ae.getSource() == filePrep);
                        try
                             Runtime.getRuntime().exec("cmd.exe /c start c:\\DBS\\filePrep.bat");
                        catch(Exception e)
                             System.out.println(e.toString());
                             e.printStackTrace();
              exitButton.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae)
                        System.exit(0);
              fileShuffle.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae)
                        if (ae.getSource() == fileShuffle);
                        try
                             Runtime.getRuntime().exec("cmd.exe /c start c:\\DBS\\fileShuffle.bat");
                        catch(Exception e)
                             System.out.println(e.toString());
                             e.printStackTrace();
              sendDBS.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae)
                        if (ae.getSource() == sendDBS);
                        try
                             Runtime.getRuntime().exec("cmd.exe /c start c:\\DBS\\sendDBSFile.bat");
                        catch(Exception e)
                             System.out.println(e.toString());
                             e.printStackTrace();
              c.add(receiveDBS);
              c.add(filePrep);
              c.add(fileShuffle);
              c.add(sendDBS);
              c.add(exitButton);
    //          c.add(statusbar);
         public static void main(String args[])
              Buttons xyz = new Buttons();
              xyz.setVisible(true);
         }What I would like help with is the following…
    I would like output to either a JLabel or JTextArea to appear if a file appears on the network. Something along these lines…
    If file named nststrace*.* is in \\[network path] then output “Download successful, please proceed.”
    btw I have done my best to search this forum for something similar and had no luck, but I am looking forward to Encephalopathic’s answer as he/she has consistently made me laugh with posted responses (in a good way).
    Thanks in advance, Paul.

    Hospital_Apps_Monkey wrote:
    we're starting to get aquainted, but I think "best friend" could take a while as it is still as hard going as I recall, but I will persevere.Heh, it's not so bad! For example, if I had no idea how to test whether a file exists, I would just scan the big list of classes on the left for names that sound like they might include File operations. Hey look, File! Then I'd look at all of File's methods for something that tests whether it exists or not. Hey, exists! Then if I still couldn't figure out how to use it, I'd do a google search on that particular method.

  • Help with dynamic statement returning values into collection

    Hi All
    I am trying to use dynamic statement to return values into a collection using the returning clause. However, I get an ORA-00933 error. Here is a simple setup:
    create table t(
        pk number,
        id_batch varchar2(30),
        date_created date,
        constraint t_pk primary key ( pk )
    create or replace type num_ntt is table of number;
    create or replace type vc2_ntt is table of varchar2(30);
    create or replace
    package pkg
    as
      type rec is record(
          pk        num_ntt,    
          id_batch  vc2_ntt
      procedure p(
          p_count in number,
          p_rt    out nocopy rec
    end pkg;
    create or replace
    package body pkg
    as
      procedure p(
          p_count in number,
          p_rt    out nocopy rec
      is
      begin
          execute immediate '
          insert into t
          select level, ''x'' || level, sysdate
          from   dual
          connect by level <= :p_count
          returning pk, id_batch into :pk, :id_batch'
          using p_count returning bulk collect into p_rt.pk, p_rt.id_batch;
      end p;
    end pkg;
    declare
      r  pkg.rec;
    begin
      pkg.p( 5, r );
    end;
    /

    sanjeevchauhan wrote:
    but I am working with dynamic statement and returning multiple fields into a collection.And using an INSERT...SELECT statement combined with a RETURNING INTO clause still does not work. Whether it's dynamic SQL or not: it doesn't work. The link describes a workaround.
    By the way, I don't see why you are using dynamic SQL here. Static SQL will do just fine. And so you can literally copy Adrian's setup.
    Regards,
    Rob.

  • Need help with Object States or Buttons?

    I currently work in InDesign to compile layouts and present design decks to clients. Our template includes an approval section (Not Approved, Revised, Approved) that we currently have as white/black bubbles that we change manually on each page. I've been trying to find a way to speed up this process. I know that in InDesign you can create buttons than you can then click on-off on your PDF - we used to do this but it is too time consuming (we have PDF's anywhere from 25-120 pages). I have been playing around with Object States, so we can quickly update the bubbles in InDesign itself as we work.
    Does anyone know of a way to change the state of multiple objects on multiple pages at the same time? (For example, if I want to change all pages to "Approved" at the same time - or if I only wanted to do some, but not all, of the pages.)
    Can anyone recommend any other InDesign tools that may be able to create a similar function for an "approval" stamp, but that still is done in InDesign (not in the PDF after exporting)?

    I was hoping that wouldn't be the only way. My have multiple master pages already, and not all pages will be "approved" at the same time. So we've run into issues with putting these on the masters as it gets easier to miss them.

  • Help with IF statement in numbers

    Hi Community
    Please could someone assist with creating a formula.
    I have created an exercise log (see image). Now when I input a formula in E, =D2/C2 it gives me my Minutes/km, but in a row containing 'Resistance' it obviously gives me the enoying red beacon.
    How can I create an IF/THEN statement, basically IF column C = "0", then 'leave field black', otherwise 'calculate my Minutes/km'.
    A solution will be greatly appreciated.
    Cheers,
    Mike

    I suggest the following changes:
    1) omit the "km" from in each entry of the "Distance" column and simply place it in the column header
    2) use the following formula for the "Min / km" column:
    E2=IF(C2>0,DURATION(,,,DUR2MINUTES(D2)/C2,), "")
    the problem is you cannot divide by 0 (EVER).  so you were correct to consider using an if to omit entries where the was no distance.
    I hop this helps.
    Wayne

  • Urgent help with If statement please!

    HI Everyone
    Was wondering if anyone can tell me why flash seems to be
    ignoring my If Statements, every time I try to use one it ignores
    the condition and just actions the command. Its driving me crazy.
    I'm sure I must be doing something wrong I just can't work it out.
    I've put;
    on (release) {
    if ((_root.eyeshadow = "Pink") && (_root.lipy =
    "Pink")) {
    _root.correct._alpha =100;
    It seems to just action the _root.correct._alpha = 100;
    even when a different colour is selected.
    I was wondering can flash read a variable from another
    script, because if not it will not know what eyeshadow and lipy
    are. I dont get any error messages though.
    Please help somebody!
    Thank you,
    Stacy.x.

    Thank you that appears to have made the if statement work,
    but now i have another problem.
    It doesn't seem to acknowledge wether these selections have
    been selected.
    I have put in the code for the pink eyeshadow;
    on (release) {
    _root.eyeshadow2._alpha =0;
    _root.eyeshadow1._alpha = 100;
    eyeshadow == "Pink";
    the same code is in all the other selections, with the name
    variations.
    any ideas?
    .x.

  • Need help with IF Statement!!!

    I am trying to write an IF statement using FormCalc in LiveCycle. I have cell "tpe" which captures total points. I would like to assign levels based on the number of points achieved. For example, level I = 1001-1985; level II = 851-1000; level III = 551-850; level IV = <551. I want cell "level" to show either I, II, III or IV, based on the points in cell "tpe". How can I do this? I have zero familiarity with FormCalc or scrips in general. Can someone please help me with this? Would appreciate any help!! Thanks!

    This is what it says:
    topmostSubform.Page3.tpe::calculate - (FormCalc, client)
    sum (rrtotal, programtotal, financetotal, leadershiptotal, executivetotal, meetingstotal, filestotal, brotherhoodtotal, conferencetotal, communicationstotal, minutestotal, standardstotal, basileustotal, abtotal, gramtotal, antigramtotal, tamtotal, pgramtotal, partotal, epistotal, torchtotal, hodtotal, phitotal)
    if ($ > 1000 and $ <= 1985)then
    level = "I"
    elseif ($ > 850 and $ <= 1000)then
    level = "II"
    elseif ($ > 550 and $ <= 850)then
    level = "III"
    elseif ($ <= 550)then
    level = "IV"
    else level = ""
    endif

Maybe you are looking for

  • How to retrieve data from a MSSQL?

    Dear All, How can I retrieve data from a MSSQL server in my custom iView which is developed by Eclipse? Thanks Sam

  • How can I turn this output into a variable

    I have a script to query all the servers in AD Import-Module active* $rtn = $null Get-ADComputer -Filter {operatingsystem -like "*server*"} | ForEach-Object { $rtn = Test-Connection -CN $_.dnshostname -Count 1 -BufferSize 16 -Quiet IF($rtn -match 'Tr

  • How to import pdf files in Premiere Elements 8

    Hello, I'd like to know if there's a way to import pdf files in premiere elements 8, becouse if I try to import it in "project" it gives me an error saying "this type of file is not supported". Thank you Sebastian

  • Parameter in FM

    HI All, TYPES : BEGIN OF it_struc,             exch_rate(10) TYPE c.            END OF it_struc. data : it_final TYPE STANDARD TABLE OF it_struc,          wa_final TYPE it_struc. DATA : wa_1 TYPE bapi1093_0,            str(200) TYPE c. LOOP AT it_fin

  • What does this ABAP code do?

    Hi, I came across this ABAP code and I'd like to know what the asterisk (*) before the variable names does.   *mkpf = mkpf.   *mseg-lgort = mseg-lgort.   *ladr = ladr.   save_mkpf = *mkpf-usnam.   save_mblnr = *mkpf-mblnr.   save_budat = *mkpf-budat.