Jump to content


Photo
- - - - -

The care and feeding of Sequence Structures


  • Please log in to reply
61 replies to this topic

#41 Chris Davis

Chris Davis

    Extremely Active

  • Premium Member
  • 416 posts

Posted 23 August 2008 - 05:29 PM

QUOTE (Darren @ Aug 22 2008, 10:23 AM)

P.S. - In his defense, though, given the huge amount of initialization required in the 3-button dialog VI, I'm curious how others would design it that it would look so different. Is the issue purely one of modularization? Would y'all be happy if he simply used more subVIs? Because regardless of how it looks, there's no way around the fact that all that code does need to run before you get to the event structure...


I was also thinking that perhaps a LAVA redesign is in order. After all, we all have a known working example to go from. Perhaps a LAVA Coding challenge?

#42 LAVA 1.0 Content

LAVA 1.0 Content

    <customize this text>

  • Members
  • PipPipPipPipPipPip
  • 2,827 posts
  • Version:LabVIEW 8.6
  • Since:2009

Posted 23 August 2008 - 05:52 PM

QUOTE (Michael_Aivaliotis @ Aug 22 2008, 04:08 AM)

To Aristos and the other NI folks arguing that the 3 button dialog VI is fine. All I have to say is, you just don't get it. This type of coding is not acceptable in my books regardless of how much pixie dust you sprinkle over it.
...


I had never looked at the code in the b-button before today and I have to side with Michael. If all of the prep work had been done using sub-VI's you would at least be able to re-use the sub-VIs in another applcation. And these could have been very handy sub-VI's at that.

Ben

#43 PJM_labview

PJM_labview

    The 500 club

  • JKI
  • 758 posts
  • Version:LabVIEW 2009
  • Since:1998

Posted 23 August 2008 - 06:39 PM

QUOTE (Chris Davis @ Aug 22 2008, 09:08 AM)

I was also thinking that perhaps a LAVA redesign is in order. After all, we all have a known working example to go from. Perhaps a LAVA Coding challenge?

I will have to side with Michael as well on this issue. The main problem about using the sequence structure is maintainability (in my opinion).

In regard to redesign, I went through the excercise a few years ago to create a "n-button dialog" vi (similar to NI 3-buttons but with more functionalities). For more info about it see this blog entry.

I used a state machine like architecture (more specifically a single loop string based queue message handler). Granted it is probably slower than Stephen implementation but I think that the flexibility and simplicity of this architecture outweigh the performance issues.

Posted Image


PJM

#44 LAVA 1.0 Content

LAVA 1.0 Content

    <customize this text>

  • Members
  • PipPipPipPipPipPip
  • 2,827 posts
  • Version:LabVIEW 8.6
  • Since:2009

Posted 23 August 2008 - 06:55 PM

And before anyone post something to the effect "talk is cheap, show us the code" :rolleyes:

I just delivered an app that had about 100-200 controls and indicators (all DSC fancy graphics) that need to update live.

I used a State Machine (State Diagram Editor, remeber that?) to code up a striaght line init before entering the main loop with the event structure.

Posted Image


The benifits I got from this was when I developed the other ten screens (that were variations on this theme) I was able to re-use all of the sub-VI's.

Using this approach I was able to transfer support of this application to my customer with very little training (actually none).

Ben

PS This is what the GUI looked like.

Posted Image



#45 Neville D

Neville D

    The 500 club

  • Members
  • PipPipPipPipPip
  • 743 posts
  • Version:LabVIEW 2011
  • Since:1996

Posted 23 August 2008 - 07:14 PM

QUOTE (normandinf @ Aug 22 2008, 06:28 AM)

The alternative sentences would be what? House arrest? Curfew? :P
Whatever the verdict, as long as he can continue working on LVOOP...


Re-education would be the best option :wacko:

;)

N.

#46 crelf

crelf

    I'm a LAVA, not a fighter.

  • V I Engineering, Inc.
  • 5,748 posts
  • Version:LabVIEW 2012
  • Since:1993

Posted 23 August 2008 - 07:19 PM

QUOTE (neB @ Aug 22 2008, 01:34 PM)

I just delivered an app that had about 100-200 controls and indicators (all DSC fancy graphics) that need to update live... PS This is what the GUI looked like.

Preeeeetty!

Slightly Off-Topic: has anyone else used Lookout? I did a project with it years ago, and (when used appropriately) it was a great fit...

post-181-1170858537.png


#47 eaolson

eaolson

    Extremely Active

  • Members
  • PipPipPipPip
  • 255 posts

Posted 23 August 2008 - 10:34 PM

QUOTE (Darren @ Aug 22 2008, 10:23 AM)

P.S. - In his defense, though, given the huge amount of initialization required in the 3-button dialog VI, I'm curious how others would design it that it would look so different. Is the issue purely one of modularization? Would y'all be happy if he simply used more subVIs? Because regardless of how it looks, there's no way around the fact that all that code does need to run before you get to the event structure...

I think that all that big mess o' code is a good example of one of LabVIEW's greatest weaknesses: it's hard to build a GUI. Yes, there are lots of great, feature-rich widgets, but it's really hard to put them together in a meaningful way. Compare with Java's Swing, for example, then realize that Java is 40% younger than LabVIEW. A simple, four-element window just shouldn't have to build its own layout manager from scratch.

#48 Aristos Queue

Aristos Queue

    LV R&D: I write C++/# so you don't have to.

  • Premium Member
  • 2,640 posts
  • Location:Austin, TX
  • Version:LabVIEW 2011
  • Since:2000

Posted 23 August 2008 - 10:57 PM

QUOTE (eaolson @ Aug 22 2008, 04:13 PM)

Compare with Java's Swing, for example, then realize that Java is 40% younger than LabVIEW.

Being younger is a major advantage in this regard... no one had the idea of layout managers when LV first started creating user interfaces.

But your point that it is too hard to do GUI layout in LV is well known and a topic of frequent thought around R&D.

#49 JDave

JDave

    Extremely Active

  • Members
  • PipPipPipPip
  • 412 posts
  • Version:LabVIEW 7.1
  • Since:2005

Posted 24 August 2008 - 02:42 AM

Regarding 3-Button Dialog:

I must say that the issue of performance is somewhat out of place when it is specifically stated that the 3-Button Dialog is a UI. Performance is really important for the work code that crunches in the background. But I have always heard that when it comes to user interfaces, maintainability and speed of programming is always more important than speed of execution. Is the user really going to notice the extra 20 milliseconds?

David

#50 Mark Balla

Mark Balla

    Extremely Active

  • Premium Member
  • 490 posts
  • Location:Gurnee Illinois
  • Version:LabVIEW 2011
  • Since:1997

Posted 25 August 2008 - 05:10 AM

QUOTE (Chris Davis @ Aug 22 2008, 11:08 AM)

I was also thinking that perhaps a LAVA redesign is in order. After all, we all have a known working example to go from. Perhaps a LAVA Coding challenge?


You Read my mind.

A New Coding Chalenge has been Created. See Here

#51 Yair

Yair

    Extwemely Active

  • Members
  • PipPipPipPipPipPip
  • 2,652 posts
  • Version:LabVIEW 2009
  • Since:2003

Posted 29 August 2008 - 05:51 PM

Hmm... Maybe this would make a good signature. :shifty:

Posted Image



#52 crelf

crelf

    I'm a LAVA, not a fighter.

  • V I Engineering, Inc.
  • 5,748 posts
  • Version:LabVIEW 2012
  • Since:1993

Posted 29 August 2008 - 06:46 PM

QUOTE (Yair @ Aug 28 2008, 12:30 PM)

Hmm... Maybe this would make a good signature. :shifty:

I love that it's folded :D

post-181-1170858537.png


#53 Phillip Brooks

Phillip Brooks

    The 500 club

  • Members
  • PipPipPipPipPip
  • 758 posts
  • Location:Boston, MA
  • Version:LabVIEW 8.6
  • Since:1999

Posted 29 August 2008 - 08:36 PM

QUOTE (Yair @ Aug 28 2008, 12:30 PM)

Posted Image


Funny, when I tried to replace with a flat sequence, LabVIEW 8.6 crashed!?! :P

Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T


#54 Yair

Yair

    Extwemely Active

  • Members
  • PipPipPipPipPipPip
  • 2,652 posts
  • Version:LabVIEW 2009
  • Since:2003

Posted 29 August 2008 - 08:49 PM

QUOTE (Phillip Brooks @ Aug 28 2008, 10:15 PM)

Funny, when I tried to replace with a flat sequence, LabVIEW 8.6 crashed!?! :P

Well, you were warned. I believe the diagram width (and position? can't be bothered to check) are a 16 bit integer, so the flat sequence would be too wide. So you see, stacked sequences are better. QED.

P.S. To paraphrase Stephen Mercer "LabVIEW crashes when my wire is over 32,000 pixels long and I try to clean it up. Fix it".

#55 gmart

gmart

    Very Active

  • NI
  • 151 posts
  • Version:LabVIEW 8.6
  • Since:2000

Posted 29 August 2008 - 08:58 PM

QUOTE (Phillip Brooks @ Aug 28 2008, 01:15 PM)

Funny, when I tried to replace with a flat sequence, LabVIEW 8.6 crashed!?! :P


This issue has been reported to R&D (CAR 124168).

#56 Yair

Yair

    Extwemely Active

  • Members
  • PipPipPipPipPipPip
  • 2,652 posts
  • Version:LabVIEW 2009
  • Since:2003

Posted 29 August 2008 - 09:14 PM

YES!!!

George, can I please get the award for the most stupid CAR ever? It doesn't have to be a cup or a medal. A nice plaque will do fine. :laugh:

#57 Mark Balla

Mark Balla

    Extremely Active

  • Premium Member
  • 490 posts
  • Location:Gurnee Illinois
  • Version:LabVIEW 2011
  • Since:1997

Posted 29 August 2008 - 09:20 PM

QUOTE (Yair @ Aug 28 2008, 02:53 PM)

YES!!!

George, can I please get the award for the most stupid CAR ever? It doesn't have to be a cup or a medal. A nice plaque will do fine. :laugh:


Thanks Yair, That totally made my day! :laugh:
I'll be laughing about this all day.

#58 gmart

gmart

    Very Active

  • NI
  • 151 posts
  • Version:LabVIEW 8.6
  • Since:2000

Posted 29 August 2008 - 09:58 PM

QUOTE (Yair @ Aug 28 2008, 01:53 PM)

YES!!!

George, can I please get the award for the most stupid CAR ever? It doesn't have to be a cup or a medal. A nice plaque will do fine. :laugh:


Regardless of the intelligence level of the CAR ;) , crashes are never a good thing. :nono:

Now just because it's CAR'd doesn't mean it might not end up being filed under the "who in the their right mind would make a 10000 frame stacked sequence structure AND THEN replace it with a flat sequence" bucket. That, truly is an honor reserved for a very few.

#59 Aristos Queue

Aristos Queue

    LV R&D: I write C++/# so you don't have to.

  • Premium Member
  • 2,640 posts
  • Location:Austin, TX
  • Version:LabVIEW 2011
  • Since:2000

Posted 29 August 2008 - 10:39 PM

QUOTE (Yair @ Aug 28 2008, 02:53 PM)

George, can I please get the award for the most stupid CAR ever? It doesn't have to be a cup or a medal. A nice plaque will do fine. :laugh:

No, you can't get the award. Why? Because you weren't actually using that 10000 frame sequence. The wire that was over 16K pixels long was part of an actual application.

#60 JiMM

JiMM

    Very Active

  • Members
  • PipPipPip
  • 93 posts

Posted 29 August 2008 - 11:58 PM

QUOTE (Yair @ Aug 28 2008, 03:53 PM)

YES!!!

George, can I please get the award for the most stupid CAR ever? It doesn't have to be a cup or a medal. A nice plaque will do fine. :laugh:

Awesome Yair. Flatening it in LV8.0 drove it insane (objectively)! Posted Image

Here's your trophy. A virtual trophy for what was virtually a VI.