LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way/place to initialize everyting in my VI?

Solved!
Go to solution
Solution
Accepted by rkmadse
For myself, I tend to lean towards the JIT (Just In Time) approach. Whenever I can, I try to make modularized functions self-initializing. The "action-engine" design pattern that Ben Rayner formalized a few years back is a good model.

For state machines, I like to have a clearly defined initialization state -- even if right now it will only run once. Having it as a separate state simplifies the changes if the machine ever needs to reinitialize itself.

Knowing when and where to initialize things can sometimes be tricky -- and highly dependent upon system requirements.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 11 of 12
(1,111 Views)

@aputman wrote:

This will handle default values that have been saved to a control/indicator. 

Capture.PNG


I was always a fan of initializing controls to explicit values rather than reinit to default.  What happens if the defaults are accidentally changed?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 12 of 12
(1,080 Views)