LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

verification of my software code for best practice

A couple of examples of what i meant and how you can improve.

Code review 1.pngCode review 2.pngCode review 3.png

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 11 of 34
(1,812 Views)

Also, Error in and out should be in lower left and right corner of VI's

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 12 of 34
(1,811 Views)

@Yamaeda wrote:

Code review 3.png


You need to be careful about closing front panels.  If you close all of your panels, your application will stop.  From this picture, I would say you likely just want to use a Property Node to set the front panel state to "Hidden", run your subVI, and then set the panel state to "Standard".



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 13 of 34
(1,795 Views)

@paul_cardinale wrote:

@Bob_Schor wrote:

...

When I started learning LabVIEW, I already had several dozen years of programming experience, EW development.

...

Bob Schor


Hmm.  If you started programming when you were 10, that would make you between 60 and 80 when you started learning LabVIEW.  You've been on this forum for more than a decade, which would put you around  75 - 95 years old now.  Maybe you meant to write something else.


This is of course open to the interpretation of "several", but I'm going to guess based on your 75-95 statement that you've perhaps mixed up a dozen (12) and a score (20)?

Several dozen might be ~48 years? Perhaps more achievable than the 80 that the same multiplier would give for 20 per unit.


GCentral
0 Kudos
Message 14 of 34
(1,787 Views)

@crossrulz wrote:

You need to be careful about closing front panels.  If you close all of your panels, your application will stop.  From this picture, I would say you likely just want to use a Property Node to set the front panel state to "Hidden", run your subVI, and then set the panel state to "Standard".

 

 Yes, good point. I mainly to keep the original solution but get rid of the hard coded 'open vi ref' in the callee.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 15 of 34
(1,775 Views)

Thanks Bob for taking your time in guiding and providing the resources.It will surely help me

0 Kudos
Message 16 of 34
(1,741 Views)

what if the information i am getting through the protocol is at bit level. Like 1 byte data i am receiving is having status of 8 solenoid valves (ON/OFF). I have to extract it at bit level to blink the LED in my main window Front Panel. Is their any better way to break it down to bit level?

0 Kudos
Message 17 of 34
(1,741 Views)

@Dushy_11 wrote:

what if the information i am getting through the protocol is at bit level. Like 1 byte data i am receiving is having status of 8 solenoid valves (ON/OFF). I have to extract it at bit level to blink the LED in my main window Front Panel. Is their any better way to break it down to bit level?


You are receiving data on a "byte level", not "bit level". So for display (and for display only!), you can convert it to a boolean array where you can show all 8 bits as LEDs array indicator. Use a multiline caption to label them. No need to index out individual bits. If the LEDs are not arranged in a row or column, convert to a cluster with arbitrarily arranged LEDs.

0 Kudos
Message 18 of 34
(1,738 Views)

@altenbach wrote:

@Dushy_11 wrote:

what if the information i am getting through the protocol is at bit level. Like 1 byte data i am receiving is having status of 8 solenoid valves (ON/OFF). I have to extract it at bit level to blink the LED in my main window Front Panel. Is their any better way to break it down to bit level?


You are receiving data on a "byte level", not "bit level". So for display (and for display only!), you can convert it to a boolean array where you can show all 8 bits as LEDs array indicator. Use a multiline caption to label them. No need to index out individual bits. If the LEDs are not arranged in a row or column, convert to a cluster with arbitrarily arranged LEDs.


I find it convenient to convert the array of Booleans to a cluster so you can label them individually.  It makes any wires self-documenting.

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.
0 Kudos
Message 19 of 34
(1,724 Views)

@billko wrote:

@altenbach wrote:

If the LEDs are not arranged in a row or column, convert to a cluster with arbitrarily arranged LEDs.

I find it convenient to convert the array of Booleans to a cluster so you can label them individually.  It makes any wires self-documenting.


Yes, but converting to a cluster is a bit more work, especially if you want the labels to be "in the wire" to later (un-)bundle by name, etc. If you just wire to an indicator with the correct labels, it's of course easier.

 

Here's how I typically use the "caption" for a plain vertical boolean array (play with LED size and font size to match things up).

 

altenbach_0-1584989742464.png

 

0 Kudos
Message 20 of 34
(1,718 Views)