11-10-2011 05:08 PM - edited 11-10-2011 05:14 PM
Thank you for your response.
I have implemented your suggestions and am working on implementing the column choosing.
Thank you.
11-10-2011 07:25 PM
I am not sure what is a better option:
1. Making this a subvi, one for rows and one for columns
2. Implementing columns into this current vi.
I am not sure where I would put the columns chooser code. Do I add another while loop that starts after the row has been chosen?
I am not sure what would be most efficient.
11-11-2011 08:27 AM
There has to be a better way than this...
Any ideas?
There is only suposed to be one button.
11-11-2011 01:48 PM
There's definitely a better way. Remember you simply want to toggle between rows and columns. Thus, you really only need the original two loops. In the upper loop you just need to know whether you're dealing with rows or columns. A simple Boolean flag carried around in a shift register (or a Feedback Node if you prefer) can be used so you know whether you're dealing with rows or column. The bottom loop just needs to generate the "event" that you pressed the hardware button.
Why are you casing out the stuff in the upper loop if you see a 2? The loop will stop anyway. If you are seeing a delay in response to stopping the loop it's because you have a 1.5 second delay in moving the true. What you really want to do is to have a short delay and to compare the current time against a "last check time". If 1.5 seconds has elapsed, then update your indicator. This will make the top loop respond much more quickly. You can use the Elapsed Time Express VI for this.
11-11-2011 02:31 PM
How about this?
11-11-2011 04:38 PM
Much better and easier, right? A couple of minor nitpicks:
11-11-2011 04:54 PM - edited 11-11-2011 04:55 PM
Thank you.
How would I make this a Subvi for a larger program?
11-14-2011 01:04 PM
@ADrexelDragon wrote:
Thank you.
How would I make this a Subvi for a larger program?
You need to set up the connector pane by wiring the controls and indicators to it. In the caller VI you connect to the terminals just like any the LabVIEW functions.
11-14-2011 01:07 PM
Thank you.
I understand how to do that. I just don't see how the LEDs would light up in the main program. They are continuiously being updated within the subvi.
11-15-2011 08:29 AM
If you want the LEDs in the main VI then you need to pass in a control reference to the subVI so that it operates on those controls, rather than the controls on its front panel. There's examples on using control references that ship with LabVIEW.