10-18-2017 11:58 PM
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)
Solved! Go to Solution.
10-19-2017 01:42 AM
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
10-19-2017 02:04 AM
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.
10-19-2017 02:51 AM
10-19-2017 03:19 AM
@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.
10-19-2017 04:18 AM
@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...
10-19-2017 05:42 AM - edited 10-19-2017 05:49 AM
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.
10-19-2017 06:58 AM
>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).
10-19-2017 08:56 AM
@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
10-19-2017 09:21 AM
You can still use altenbach's solution by using a U64 instead of a U32. Make each version number a 16 bit value.