LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Rewriting a LabVIEW Program from Scratch

I mention it in my first message :

 

----------------

(look at "race conditions " in ben's signature !

----------------

N

Message 11 of 20
(2,629 Views)

Mega Kudos truely appreciated!

 

Just trying to help out since- like most of you Ive:

  1. Been there
  2. done that WRONG
  3. did it again- Better
Mark's advice about spec writing is invaluable and contributed to the "Required_Reading" tag on this thread (Incidentally- Ben's AE nugget earned the first "Required_Reading" tag

"Should be" isn't "Is" -Jay
Message 12 of 20
(2,619 Views)
When you remake the program with sub-vi's, remember the nagging thought of: "Is this general and reusable?"
A good sub-vi can be used in other projects, not just to clean the diagram. Think twice, go an extra mile, and you'll not only have a good program, you have already done some coding on your next project. 😉

/Y
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 13 of 20
(2,596 Views)

nitad54448 wrote:

I mention it in my first message :

 

----------------

(look at "race conditions " in ben's signature !

----------------

N


 

Apologies, I seemed to skip over that when I read it the first time.

 

Thanks again all for the advice and words of encouragement!

0 Kudos
Message 14 of 20
(2,579 Views)

I'm still reading Craig Larman's book on OOP but he talks about how re-writing a program is always easier the second time because you have the first version to use to define the operation and req's.

 

All of the programs that I have re-written were always better than the first version and always ran better.

 

If you have the luxury of re-writting it better, then jump on it.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 15 of 20
(2,576 Views)

Don't feel like you're going backwards when you rewrite old code using an appropriate architecture and good programming practices.  You are actually moving forwards.  It's one thing to read about architectures, modularity, best practices, etc.  It is another thing to use them.  That's how you really learn.

 

Some years ago, I had some ancient and decrepit code I had written that more-or-less worked.  Unsurprisingly, it had various issues.  I took the "Intermediate" LabVIEW courses, learned about the joy of appropriate architectures, and started writing code in a completely different way.  Naturally, that old code reared its ugly head.  Just looking at it embarrassed me.

 

The program manager wanted a minor change to some of the default values, then wanted an executable built.  I asked if I could rewrite it, which would eliminate its performance problems.  He said no.  I snuck off and rewrote it anyway, using a more appropriate architecture.  (If I still had a copy of that old code, I'd post it in Rube Goldberg, but I have since left the company, so I don't.  Probably a good thing, I'd open myself to all manner of mockery!  Smiley Happy)  Then, after rewriting it (which took only a few hours) I compiled it.

 

The guys who had been using it up until that point were amazed that the compiled version didn't suffer from the same problems that the uncompiled version had!

 

I never 'fessed up that I'd rewritten it, under specific instructions not to.  I would have gotten into trouble.

 

Then I proceeded to rewrite various other pieces of old code.  I learned a lot just by doing that.  I also wound up with several VIs that I used later in other projects.

 

So look at it as an opportunity to become a better programmer!  And anyway, it's really kind of fun.

Message 16 of 20
(2,568 Views)

 

 

Take jpeg picture from the hardisk and do the following: 

a)decompose the picture into the RGB arrays and display each color on a separate graph

b) Flip the picture horizontally and display

c) Flip the picture vertically and display

d) Put each three line on a line and display

e) Crop a 200pixels x 200pixels rectangle around the center of the image and display

0 Kudos
Message 17 of 20
(2,487 Views)

michel69 wrote:

 

 

Take jpeg picture from the hardisk and do the following: 

a)decompose the picture into the RGB arrays and display each color on a separate graph

b) Flip the picture horizontally and display

c) Flip the picture vertically and display

d) Put each three line on a line and display

e) Crop a 200pixels x 200pixels rectangle around the center of the image and display


What exactly do you mean by this post? Do you have a specific question?

Message Edited by Mark Yedinak on 03-29-2010 12:54 PM


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 18 of 20
(2,482 Views)

i have to build a code on labview that it's able to take 2 jpeg picture from the hardisk and to do the following:

 

 

 

a)decompose the picture into the RGB arrays and display each color on a separate graph

b) Flip the picture horizontally and display

c) Flip the picture vertically and display

d) Put each three line on a line and display

e) Crop a 200pixels x 200pixels rectangle around the center of the image and display

 

thanks anyway

0 Kudos
Message 19 of 20
(2,464 Views)

michel69 wrote:

i have to build a code on labview that it's able to take 2 jpeg picture from the hardisk and to do the following:

 

 

 

a)decompose the picture into the RGB arrays and display each color on a separate graph

b) Flip the picture horizontally and display

c) Flip the picture vertically and display

d) Put each three line on a line and display

e) Crop a 200pixels x 200pixels rectangle around the center of the image and display

 

thanks anyway


That much I gathered. However, what does it have to do with this thread in particular. Also, what have you done so far? If you are looking for someone to write the code for you to do this then that is not what theses forums are for. Most everyone here is a volunteer and participate to help answers questions and resolve coding issues. We are not here to provide complete solutions. The best way to get help is to ask specific questions. Also, post code (or screen shots) showing what you have done so far. Simply posting some very basic requirements will generally not get you much information.

 

(Note: If this is a homework problem, which it looks like it might be, then you will rarely get people here to do your work for you. Show us that you are trying to accomplish the task yourself and as mentioned, ask specific questions.)



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 20 of 20
(2,458 Views)