pawhan11 Posted September 12, 2016 Report Share Posted September 12, 2016 3 hours ago, drjdpowell said: Variants don’t “flatten”. Putting something in a variant doesn’t involve altering or copying the data. They have overhead but I don’t think the size of the data matters. Never use Globals for big data. Globals always copy when you read them. So does any “Get”. Avoid a copy by extracting only the required data inside the structure you are using. So, inside the IPE with a DVR, inside the Action Engine, or inside the message sending code. Playing with this just to kill time but it seems that size matters tests.vi Quote Link to comment
hooovahh Posted September 12, 2016 Report Share Posted September 12, 2016 On 9/11/2016 at 3:23 AM, ShaunR said: If you can wrap it in a polymorphic VI. You'll not only simplify the connector, you'll also get the adapt to type for the different usages.You don't have to split out each method into a new vi of the polymorph but you may have to split the typedef into a couple that make sense for the connectors. Yeah I like this idea and made a (half complete) tool for generating these polymorphic VIs from FGV, posted over here. Quote Link to comment
drjdpowell Posted September 12, 2016 Report Share Posted September 12, 2016 You have to outsmart the compiler when performance testing. In your code your constant array is copied at the to-variant step because it is needed at the next iteration. Make a new array for each iteration, like this: tests (Modified to avoid Constant Folding).vi Quote Link to comment
Neil Pate Posted September 12, 2016 Author Report Share Posted September 12, 2016 33 minutes ago, hooovahh said: Yeah I like this idea and made a (half complete) tool for generating these polymorphic VIs from FGV, posted over here. If you have something going wrong with your code, and you know it is one of the particular methods of the AE then (that have wrapped been wrapped so as to not expose the enum and all controls), you can easily just search for that particular VI in your code. I was under the impression you could not do this with a polymorphic VI? Quote Link to comment
pawhan11 Posted September 12, 2016 Report Share Posted September 12, 2016 28 minutes ago, drjdpowell said: You have to outsmart the compiler when performance testing. In your code your constant array is copied at the to-variant step because it is needed at the next iteration. Make a new array for each iteration, like this: tests (Modified to avoid Constant Folding).vi Hmm, it makes more sense now Thanks. Quote Link to comment
hooovahh Posted September 12, 2016 Report Share Posted September 12, 2016 2 hours ago, Neil Pate said: I was under the impression you could not do this with a polymorphic VI? You can still perform a Find All Instances of a particular VI, which is probably more useful because you will only find the VI for a particular method call of a FGV, instead of finding every instance. I believe what you are asking is if you can search for the polymorphic VI, to which I believe the answer is no, you can only search for members of the polymorphic VI, which in this case would be a particular method. Quote Link to comment
Neil Pate Posted September 12, 2016 Author Report Share Posted September 12, 2016 23 minutes ago, hooovahh said: You can still perform a Find All Instances of a particular VI, which is probably more useful because you will only find the VI for a particular method call of a FGV, instead of finding every instance. I believe what you are asking is if you can search for the polymorphic VI, to which I believe the answer is no, you can only search for members of the polymorphic VI, which in this case would be a particular method. No, I am asking for the first scenario. Good to know it can be done. I have never really found the necessity to create polymorphic VIs, individual wrapped API VIs was sufficient for me in the past. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.