LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Version Check Code Optimize?

Solved!
Go to solution

Fairly new to LV. I think this is my first post as well.

 

I pulled this out of a larger VI to ask this question... This VI checks that the software Build installed on the test machine is equal to or greater (later) than what is required to run a test. I have the vX.X.X.X in the first line of our test files to be checked before continuing to anything else.

All that to say...this VI does exactly what I want it to do, but there's a lot going on to do something fairly simple. I'm curious if there's something much simpler to do the same thing. Like I said, it works fine and I'm not concerned about speed or anything, just wanting to learn. Thanks in advance!

 

-Jeff

 

created on Win7 64-bit, LV2017.0 (64-bit)

 

Version Check.PNG

0 Kudos
Message 1 of 18
(3,206 Views)

Compare the Version Details separately and build the compared elements as Array of Boolean and find the (And  Array Elements)

 Decide based on the output of (And  Array Elements)

 

By this you can ignore case structure

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 18
(3,178 Views)

What is the range of possible values for the number between the dots? If each fit into a U8 (0..255), you could just cast the entire number set into U32 and compare with the value obtained from the minimum version.

0 Kudos
Message 3 of 18
(3,173 Views)

Bundle the versions into cluster, compare clusters:

compareversion.png

0 Kudos
Message 4 of 18
(3,163 Views)

@PiDi wrote:

Bundle the versions into cluster, compare clusters:

 


This is incorrect. For example if the major version is higher, the other numbers can be lower and we still have a good match.

0 Kudos
Message 5 of 18
(3,153 Views)

@altenbach wrote:

@PiDi wrote:

Bundle the versions into cluster, compare clusters:

 


This is incorrect. For example if the major version is higher, the other numbers can be lower and we still have a good match.


I need more coffee... Much more coffee... 

Message 6 of 18
(3,145 Views)

Arrays make things a lot simpler and more scalable.

Build the versions into arrays, subtract, and then use a loop to check each value.  For the case "..-1" (all negative values) your version is too low, so stop the loop and output a FALSE value.  For the case "0" (versions are the same), output a TRUE but let the loop continue.  For the case "1.." (all positive values) your version is higher, so stop the loop and output a TRUE.


GCentral
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
0 Kudos
Message 7 of 18
(3,137 Views)

>I pulled this out of a larger VI to ask this question

 

Oh my... Good you identified this as a problem!

 

Since you want to learn: don't just replace the code with crossrulz's version. Put his code in a sub VI, and use the sub VI! This should be a VI with 4X4X4 connector pane, and an error in\error out (on bottom left, top right).

0 Kudos
Message 8 of 18
(3,122 Views)

@altenbach wrote:

What is the range of possible values for the number between the dots?...


it would likely never get there, but assume up to 999 for any value

0 Kudos
Message 9 of 18
(3,106 Views)

You can still use 



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
Message 10 of 18
(3,094 Views)