取消
显示结果 
搜索替代 
您的意思是: 

Version Check Code Optimize?

已解决!
转到解答

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 项奖励
1 条消息(共 18 条)
4,301 次查看

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 项奖励
2 条消息(共 18 条)
4,273 次查看

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 项奖励
3 条消息(共 18 条)
4,268 次查看

Bundle the versions into cluster, compare clusters:

compareversion.png

0 项奖励
4 条消息(共 18 条)
4,258 次查看

@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 项奖励
5 条消息(共 18 条)
4,248 次查看

@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... 

6 条消息(共 18 条)
4,240 次查看

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.



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 项奖励
7 条消息(共 18 条)
4,232 次查看

>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 项奖励
8 条消息(共 18 条)
4,217 次查看

@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 项奖励
9 条消息(共 18 条)
4,201 次查看

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
10 条消息(共 18 条)
4,189 次查看