LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

mouse down help

Im trying to create a program so that when the next button is pressed, the gui then reads the next line on my excel sheet for the standard. Im having trouble with the mouse my down functioin for this.

0 Kudos
Message 1 of 19
(3,271 Views)

What trouble are you having?  Give us some details at to what it is doing and how it is different from what you want.

 

Looking at your code.  I see your Next button is set for Switch Until Released.  That is almost certainly the wrong action.  You probably want Latch When Released.

 

And since it is a Boolean button, you should set the Event to be Next:Value Changed  rather than Next:Mouse Down.

0 Kudos
Message 2 of 19
(3,261 Views)

What happening is that when i click next, it does not change the standard as written in excel, instead it keeps whichever standard it starts with. What I would like for it to do is each time next is clicked, the standard, as written in excel, is read and used by labview.

0 Kudos
Message 3 of 19
(3,239 Views)

Where does your VI evenget data from Excel?  Nothing in your VI shows this.

 

Perhaps it is buried in one of the subVI's you didn't include?

0 Kudos
Message 4 of 19
(3,227 Views)

Please show us where excel and file IO happens. I cannot find it.

 

Your VI is full of race conditions and very convoluted code.

  • To get one row of a 2D array, reshaping it to a 1D array with the lenght of one row seems pointless. All you need is "index array" with one index disconnected.
  • You have a case structure with the same property nodes in all case frames, thus they belong after the case, only on instance needed each.
  • There are plenty of potential race conditions. For example the boolean "standard" is read (via value property) and written in parallel elsewhere to the terminal.
  • How do you know what happens first?
  • Getting a scalar from an array does not need a detour via dynamic data ("Numeric", after the small FOR loop). try 
  • index array"
  • In the "next: mouse down" event, all you need in the second frame is the "menu" local variable. wire it to the output if the +1 from the previous frame.
  • ...
0 Kudos
Message 5 of 19
(3,209 Views)

My apologies for the confusion, I haven't put my comments in the code yet. The excel data is read from the first subvi on the outside of the while loop

0 Kudos
Message 6 of 19
(3,179 Views)

Since you didn't include the subVI's, we can't look into them.

0 Kudos
Message 7 of 19
(3,175 Views)
0 Kudos
Message 8 of 19
(3,169 Views)

The only part of the code that operates on the array coming from that subVI, isn't influenced by the menu number at all.  It is only affected by whether the "Standard" boolean is True or False, and will either give Row 1 or Row 2 of the array coming in.

0 Kudos
Message 9 of 19
(3,161 Views)

What do I need to do to make it read line by line?

0 Kudos
Message 10 of 19
(3,146 Views)