Really simple question, stop function and scroll bar won't work

I was working on different parts of this VI separately, when I put them together the scroll bar and stop button stopped working. 
In the individual VI both are in the while loop. In the final one I was one scroll bar and one stop button to apply to all 5 while loops.
I tried taking the scroll bar in and out of the first loop to attach it to the rest but it still won't work.
I'm sure that there is a really stupid simple answer but I've been playing with it for a while.
I attached the VI that I am working on as well at fake data (to test the color boxes).
Thanks!
Solved!
Go to Solution.
Attachments:
trial8.vi ‏95 KB
trial8.vi ‏95 KB
0_1024.txt ‏25 KB

You have a typical beginner problem due to incorrect understanding of dataflow. Run the code using execution highlighting and watch the diagram to see.
Your stop button is outside any loop and thus will only be read by the code exactly once at the start of the program.
Your scroll bar is read in the first loop. All other loops cannot start until the first loop has completed and since (1) is true, it will never happen if the boolean is false when the code starts.
Why do you have so much duplicate code? 95% of the loop code is the same and can be re-used. I am sure the entire thing could be written using 5% of the total code. Put everything in one loop, the iterate over the 2D array to get all the values. Don't forget to place a small wait inside the while loop.
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • InDesign cs6 bottom and side scroll bars won't work

    I had to reinstall InDesign (cs6), and now my bottom and side scroll bars are not working. I had this problem once before, and found the answer online, fixing it easily, but I can't remember what it was, and now I'm stuck with scroll bars that don't work. The one inside the layers palette works just fine. Help!

    No promises, but see Replace Your Preferences

  • Really Simple Date conversion function... but doesn't work

    For my application I need a function that converts a date to a date that is a monday.
    I wrote this simple function, and I've been trying for many many times... but it just doesn't work. It returns a null value. The problem lies with the IF-statement.
    I'm using iSQL 9
    CREATE OR REPLACE FUNCTION to_monday ( datum IN DATE )
      RETURN DATE
      AS
    BEGIN
      FOR n IN 0..6 LOOP
        IF ( TO_CHAR(datum + n, 'day') = 'friday' ) THEN
          RETURN (datum + n - 4);
        END IF;
      END LOOP;
    END;
    SELECT to_monday(CURRENT_DATE) FROM dual;Edited by: popovitsj on 11-mrt-2012 5:07
    Edited by: popovitsj on 11-mrt-2012 5:09
    Edited by: popovitsj on 11-mrt-2012 5:09
    Edited by: popovitsj on 11-mrt-2012 5:12

    popovitsj wrote:
    For my application I need a function that converts a date to a date that is a monday.
    I wrote this simple function, and I've been trying for many many times... but it just doesn't work. It returns a null value. The problem lies with the IF-statement.
    I'm using iSQL 9
    CREATE OR REPLACE FUNCTION to_monday ( datum IN DATE )
    RETURN DATE
    AS
    BEGIN
    FOR n IN 0..6 LOOP
    IF ( TO_CHAR(datum + n, 'day') = 'friday' ) THEN
    RETURN (datum + n - 4);
    END IF;
    END LOOP;
    END;
    SELECT to_monday(CURRENT_DATE) FROM dual;Edited by: popovitsj on 11-mrt-2012 5:07
    Edited by: popovitsj on 11-mrt-2012 5:09
    Edited by: popovitsj on 11-mrt-2012 5:09
    Edited by: popovitsj on 11-mrt-2012 5:12You have to use format modifier. to_char(...,'day') will return "friday" with padded space. You have to use to_char(..,'fmday').
    SQL> CREATE OR REPLACE FUNCTION to_monday ( datum IN DATE )
      2    RETURN DATE
      3    AS
      4  BEGIN
      5    FOR n IN 0..6 LOOP
      6      IF ( TO_CHAR(datum + n, 'fmday') = 'friday' ) THEN
      7        RETURN (datum + n - 4);
      8      END IF;
      9    END LOOP;
    10  END;
    11  /
    Function created.
    SQL> SELECT to_monday(sysdate) from dual;
    TO_MONDAY
    12-MAR-12

  • Firefox actualized the new version, but it looks only a black screen and no watch buttons and scroll bars, nothing

    The new version of Firefox dosen't work is only a black screen without buttons and scroll bars. I try re install and uninstall and erase files, but dosen't work.

    Sorry, please disable hardware acceleration as a temporary workaround. This is an incompatibility between Firefox 33 and some older graphics card/chipset drivers. More info: https://support.mozilla.org/questions/1025438

  • Started downloading CD's to iPod classic. Plenty of spacr left, but Ipod stopped syncing with my music/play list. Sync notification appears for only a few seconds then stops. Sync scroll bar on music/play list never scrolls. Any suggestions?

    Started downloading CD library to iPod. Plenty of space remaining, but it quit syncing with my music/play list. Sync notification appears for only a few seconds then stops. Sync scroll bar on music/play list never starts scrolling. Any suggestions?

    Which version of iTunes and which iPod Classic model are you using?
    Have you tried to Reset the iPod and download again?

  • HT2832 Help!  My fire wire  400 ports have stopped functioning, and my 800 is now having problems

    Help!  My fire wire  400 ports have stopped functioning, and my 800 is now having problems....I'm getting a protools message telling me there is a problem with my firewire.

    First, you have posted in the wrong area, this is for PPCs and you have an intel.
    Try repairing permissions and resetting the PRAM.
    Let us know how you made out.

  • JTable can't display column names and scroll bar in JDialog !!

    Dear All ,
    My flow of program is JFrame call JDialog.
    dialogCopy = new dialogCopyBay(frame, "Bay Name Define", true, Integer.parseInt(txtSourceBay.getText()) ,proVsl ,300 ,300);
    dialogCopy.setBounds(0, 0, 300, 300);
    dialogCopy.setVisible(true);        Then,I set the datasource of JTable is from a TableModel.
    It's wild that JTable can diplay the data without column names and scroll bar.
    I have no idea what's going wrong.Cause I follow the Sun Tutorial to code.
    Here with the code of my JDialog.
    Thanks & Best Regards
    package com.whl.panel;
    import com.whl.vslEditor.vslDefine;
    import java.awt.Container;
    import java.awt.Dimension;
    import java.awt.Frame;
    import javax.swing.JDialog;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.AbstractTableModel;
    public class dialogCopyBay extends JDialog {
        vslDefine glbVslDefine;
        int lvCnt = -1;
        JTable tableCopyBay;
        int bgnX = 0;
        int bgnY = 30;
        int tableWidth = 100;
        int tableHeight = 100;
        public dialogCopyBay(Frame frame, String title, boolean modal, int sourceBay,
                vslDefine pVslDefine, int ttlWidth, int ttlHeight) {
            super(frame, title, true);
            Container contentPane = getContentPane();
            System.out.println("dialogCopyBay Constructor");
            glbVslDefine = null;
            glbVslDefine = pVslDefine;
            copyBayModel copyBay = new copyBayModel((glbVslDefine.getVslBayStructure().length - 1),sourceBay);
            tableCopyBay = new JTable(copyBay);
            tableCopyBay.setPreferredScrollableViewportSize(new Dimension(tableWidth, tableHeight));
            JScrollPane scrollPane = new JScrollPane(tableCopyBay);
            scrollPane.setViewportView(tableCopyBay) ;
            tableCopyBay.setFillsViewportHeight(true);
            tableCopyBay.setBounds(bgnX, bgnY, tableWidth, tableHeight);
            tableCopyBay.setBounds(10, 10, 100, 200) ;
            contentPane.setLayout(null);
            contentPane.add(scrollPane);
            contentPane.add(tableCopyBay);
        class copyBayModel extends AbstractTableModel {
            String[] columnNames;
            Object[][] dataTarget;
            public copyBayModel(int rowNum ,int pSourceBay) {
                columnNames = new String[]{"Choose", "Bay Name"};
                dataTarget = new Object[rowNum][2];
                for (int i = 0; i <= glbVslDefine.getVslBayStructure().length - 1; i++) {
                    if (pSourceBay != glbVslDefine.getVslBayStructure().getBayName() &&
    glbVslDefine.getVslBayStructure()[i].getIsSuperStructure() == 'N') {
    lvCnt = lvCnt + 1;
    dataTarget[lvCnt][0] = false;
    dataTarget[lvCnt][1] = glbVslDefine.getVslBayStructure()[i].getBayName();
    System.out.println("lvCnt=" + lvCnt + ",BayName=" + glbVslDefine.getVslBayStructure()[i].getBayName());
    public int getRowCount() {
    return dataTarget.length;
    public int getColumnCount() {
    return columnNames.length;
    public String getColumnName(int col) {
    return columnNames[col];
    public Object getValueAt(int rowIndex, int columnIndex) {
    return dataTarget[rowIndex][columnIndex];
    public Class getColumnClass(int c) {
    return getValueAt(0, c).getClass();
    public boolean isCellEditable(int row, int col) {
    if (col == 1) {
    // Bay Name Not Allow To modify
    return false;
    } else {
    return true;
    public void setValueAt(Object value, int row, int col) {
    dataTarget[row][col] = value;
    fireTableCellUpdated(row, col);

    Dear DB ,
    I am not sure what you mean.
    Currently,I don't undestand which code is error.
    And I also saw some example is add JTable and JScrollPane in JDialog.
    Like Below examle in Sun tutorial
    public class ListDialog extends JDialog implements MouseListener, MouseMotionListener{
        private static ListDialog dialog;
        private static String value = "";
        private JList list;
        public static void initialize(Component comp,
                String[] possibleValues,
                String title,
                String labelText) {
            Frame frame = JOptionPane.getFrameForComponent(comp);
            dialog = new ListDialog(frame, possibleValues,
                    title, labelText);
         * Show the initialized dialog. The first argument should
         * be null if you want the dialog to come up in the center
         * of the screen. Otherwise, the argument should be the
         * component on top of which the dialog should appear.
        public static String showDialog(Component comp, String initialValue) {
            if (dialog != null) {
                dialog.setValue(initialValue);
                dialog.setLocationRelativeTo(comp);
                dialog.setVisible(true);
            } else {
                System.err.println("ListDialog requires you to call initialize " + "before calling showDialog.");
            return value;
        private void setValue(String newValue) {
            value = newValue;
            list.setSelectedValue(value, true);
        private ListDialog(Frame frame, Object[] data, String title,
                String labelText) {
            super(frame, title, true);
    //buttons
            JButton cancelButton = new JButton("Cancel");
            final JButton setButton = new JButton("Set");
            cancelButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    ListDialog.dialog.setVisible(false);
            setButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    ListDialog.value = (String) (list.getSelectedValue());
                    ListDialog.dialog.setVisible(false);
            getRootPane().setDefaultButton(setButton);
    //main part of the dialog
            list = new JList(data);
            list.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
            list.addMouseListener(new MouseAdapter() {
                public void mouseClicked(MouseEvent e) {
                    if (e.getClickCount() == 2) {
                        setButton.doClick();
            JScrollPane listScroller = new JScrollPane(list);
            listScroller.setPreferredSize(new Dimension(250, 80));
    //XXX: Must do the following, too, or else the scroller thinks
    //XXX: it's taller than it is:
            listScroller.setMinimumSize(new Dimension(250, 80));
            listScroller.setAlignmentX(LEFT_ALIGNMENT);
    //Create a container so that we can add a title around
    //the scroll pane. Can't add a title directly to the
    //scroll pane because its background would be white.
    //Lay out the label and scroll pane from top to button.
            JPanel listPane = new JPanel();
            listPane.setLayout(new BoxLayout(listPane, BoxLayout.Y_AXIS));
            JLabel label = new JLabel(labelText);
            label.setLabelFor(list);
            listPane.add(label);
            listPane.add(Box.createRigidArea(new Dimension(0, 5)));
            listPane.add(listScroller);
            listPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    //Lay out the buttons from left to right.
            JPanel buttonPane = new JPanel();
            buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.X_AXIS));
            buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));
            buttonPane.add(Box.createHorizontalGlue());
            buttonPane.add(cancelButton);
            buttonPane.add(Box.createRigidArea(new Dimension(10, 0)));
            buttonPane.add(setButton);
    //Put everything together, using the content pane's BorderLayout.
            Container contentPane = getContentPane();
            contentPane.add(listPane, BorderLayout.CENTER);
            contentPane.add(buttonPane, BorderLayout.SOUTH);
            pack();
        public void mouseClicked(MouseEvent e) {
            System.out.println("Mouse Click");
        public void mousePressed(MouseEvent e) {
            throw new UnsupportedOperationException("Not supported yet.");
        public void mouseReleased(MouseEvent e) {
            throw new UnsupportedOperationException("Not supported yet.");
        public void mouseEntered(MouseEvent e) {
            throw new UnsupportedOperationException("Not supported yet.");
        public void mouseExited(MouseEvent e) {
            throw new UnsupportedOperationException("Not supported yet.");
        public void mouseDragged(MouseEvent e) {
            throw new UnsupportedOperationException("Not supported yet.");
        public void mouseMoved(MouseEvent e) {
            throw new UnsupportedOperationException("Not supported yet.");
         * This is here so that you can view ListDialog even if you
         * haven't written the code to include it in a program.
    }

  • Change Height of Web Resource to Get Rid Of Blank and Scroll Bar

    Hi, I am a junior CRM developer. I'm using CRM online.
    I wrote a HTML web resources. In Web Resource Properties, I set the Number of Rows as 20.
    But the problem is: If the form window are maximized, there will be blank under web resource; if the form windows become smaller, there will be a scroll bar on the side.
    I want get rid of blank and scroll bar, automatically change height according to the size of the window.
    I tried checkbox "Automatically expand to use available space", but it didn't work.
    I don't think add CSS to my HTML will work, because CSS in HTML will change the html height, not the container in CRM.
    Thank you in advance.

    You most likely have a malware infection. Run and update the following scanners. (Not all programs detect the same infection.)
    1. [http://www.safer-networking.org/]
    2. [http://www.malwarebytes.org/]
    3. [http://www.spywareterminator.com/]
    4. [http://www.microsoft.com/security/malwareremove/default.aspx]
    If those programs do not do the trick, try to post in the following forum:
    1. [http://www.bleepingcomputer.com[
    Other spyware removal forums can be found in a search.
    Does the issue occur in [[Safe Mode]]?

  • My MacBook Pro is password protected but all of a sudden the keyboard stopped functioning and I can't log in at all. What should I do? Thanks in advance.

    My MacBook Pro is password protected but all of a sudden the keyboard stopped functioning and I can't log in at all. What should I do? Thanks in advance.

    Get a USB key board

  • When I start Photoshop the program stop functioning and shuts down, I just upgraded the memory so the computers capacity should be fine.

    When I start Photoshop the program stop functioning and shuts down, I just upgraded the memory so the computers capacity should be fine.

    Moving the discussion to Photoshop General Discussion.
    Thanks,
    Atul Saini

  • My procedures stopped functioning and I cannot reset it

    My procedures stopped functioning and I cannot reset it, any tips to start from the beginning without losing content?

    Which version of photoshop and operating system are you using?
    Can you be more specific about what is not working?

  • HT1414 When I search for stuff on the internet it says safari could not open the page because the server stopped responding and non of my games work either. What do I do to fix this?

    When I search for stuff on the internet it says safari could not open the page because the server stopped responding and non of my games work either. What do I do to fix this?

    Settings → scroll down to Safari → in Safari settings, I selected both Clear History and Clear Cookies and Data.
    IF that does not work -
    Restart or reset your iPhone, iPad, or iPod touch - Apple Support
    Finally - if problem still present -
    Go to Settings>General>Reset
         Reset the network settings - you will need to add the password of your home WiFi in your phone once more
    The device should turn itself off & back on then go into Settings>Wifi and join your network

  • I just downloaded the ios 6 on my iTouch 4th gen, and my email won't work, my wifi won't connect, my iPod is more sluggish, and honestly I'm really frustrated. Is there anything I can do?

    I just downloaded the ios 6 on my iTouch 4th gen, and my email won't work, my wifi won't connect, my iPod is more sluggish, and honestly I'm really frustrated. Is there anything I can do?

    Try:
    - Reset the iPod. Nothing will be lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup
    - Restore to factory settings/new iPod.
    - Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar
    Downgrading the iOS is not supported by Apple.

  • My MacBook and my Monitor won't work together anymore

    Ok i have a macbook i got less than a year ago and for the last 2 months i have been running my old samsung monitor off of a mac mini port to VGA and now it won't work anymore when ever i connect it the monitors light just flashes on and off repeatedly but the screen turns black i have tried adjusting the sizing but it wont work...
    I know its connected cause the screen blinks blue and the windows that are set to open on it still do and i have to drag them over to see them

    Try:
    - Reset the iOS device. Nothing will be lost      
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings                            
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                               
    iOS: Back up and restore your iOS device with iCloud or iTunes
    - Restore to factory settings/new iOS device.                       
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
      Apple Retail Store - Genius Bar
    Unless you purchased the optional AppleCare+ extended warranty,
    Apple will exchange your iPod for a refurbished one for $99 for 16 GB 5G and $149 for the other 4Gs. They do not fix yours.
      Apple - iPod Repair price             

  • Lightroom 3 and PSE10 layers won't work?

    I recently purchased Lightroom 3 and installed on my computer running Windows 7.  I already had Photoshop Elements 10 installed and that and Nikon Capture NX2 were what I used for editing.  PSE8 is also still installed on my computer.  When I choose to send a photo from LR3 to PSE10 for editing, all the layers choices are grayed out.  I have searched, I promise, but have not found the answer for these two combinations.  Can someone help me please?  Thank you.  All the versions are updated.

    Thanks. That did it.  Now, if I could figure out about a thousand other things, I'd be all set! 
    Date: Tue, 27 Mar 2012 07:44:24 -0600
    From: [email protected]
    To: [email protected]
    Subject: Lightroom 3 and PSE10 layers won't work?
    Re: Lightroom 3 and PSE10 layers won't work? created by Lee Jay in Photoshop Lightroom - View the full discussion
    Elements doesn't support much functionaliy in 16-bit mode.  Switch to 8-bit.
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4294404#4294404
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4294404#4294404. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Photoshop Lightroom by email or at Adobe Forums
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

Maybe you are looking for