Jump to content

LV2-style globals: Ever wondered whether to use While Loops or For


Recommended Posts

  • Replies 65
  • Created
  • Last Reply

Top Posters In This Topic

QUOTE(Jim Kring @ Mar 28 2007, 10:56 PM)

April Fools! I just made the While Loop larger than the Block Diagram window and colored the While Loop's frame white :laugh:

Link to comment

QUOTE(Jim Kring @ Apr 2 2007, 10:36 AM)

April Fools! I just made the While Loop larger than the Block Diagram window and colored the While Loop's frame white :laugh:
Not bad Jim, not bad, even though several of us suspected as much. I think it was as good or better than NI's this year. Their "rerelease" of LabVIEW 2 just wasn't up to the standards of their old years. I think the best LabVIEW related AFJ in recent years has to be Michael's announcement that NI had purchased LAVA. That one nailed a lot of us. If NI had really wanted to AFJ all of us they missed a golden opportunity this year. Since some of the patents just expired earlier this year they could have said something to the effect that LabVIEW 2 or 3 or best yet LabVIEW 5 was being rereleased with open source code, ie, all the newly patented stuff still protected and hidden, but the basic G language now free.

Hmm, then again, maybe that would have been crossing the line as to what was acceptable disappointment for an AFJ, and they were just too kind to pull something like that on us. Before my second cup'a joe, it might have been fatal for me...

post-932-1159825841.gif

Link to comment

QUOTE(Mike Ashe @ Apr 3 2007, 06:47 AM)

Since some of the patents just expired earlier this year they could have said something to the effect that LabVIEW 2 or 3 or best yet LabVIEW 5 was being rereleased with open source code, ie, all the newly patented stuff still protected and hidden, but the basic G language now free.

AFJ's are supposted to be funny and I don't think that anyone inside NI would be laughing at that one -- it's a serious topic.

Link to comment

QUOTE(Dirk J. @ Mar 30 2007, 02:02 AM)

or this underestimated tool...

I use LV2 globals a lot -- both with for loops and while loops -- depending on the rest of the VI involved. I haven't thought about actually testing both structures, my assumption was that they were equivalent c/c++ code "underneath" so it's interesting to see the benchmarking.

But it is because I use them a lot that I have concerns about the feedback node approach -- it seems like a lot of extra wiring to do, esp if you have a number of such variables within a single VI. On the other hand, one could pass around a cluster (of the separate variables) but then there's the overhead of the unbundle/bundle operations as those values are read and modified during run-time.

Link to comment

Just to get the discussion going, here is another style of "LV2 global" (I dont think it can be call this anymore in this situation, but ...).

I am sure that Stephen is going to like this one :P

http://forums.lavag.org/index.php?act=attach&type=post&id=5396

http://forums.lavag.org/index.php?act=attach&type=post&id=5394

PJM

http://forums.lavag.org/index.php?act=attach&type=post&id=5395

Link to comment

QUOTE(PJM_labview @ Apr 3 2007, 10:52 PM)

Just to get the discussion going, here is another style of "LV2 global"...

What's the benefit of this method over real LV2 style globals or over using queus directly? If I'd like to encapsulate the functionality of a queue, I'd rather encapsulate it into a LVClass.

Tomi

Link to comment

QUOTE(Tomi Maila @ Apr 3 2007, 01:21 PM)

What's the benefit of this method over real LV2 style globals or over using queus directly? If I'd like to encapsulate the functionality of a queue, I'd rather encapsulate it into a LVClass.

Tomi

None that I know of. I just put it there for fun. Since it would never occured to me to use a for loop, I start to look for other ways that I could have missed. You can call it the obfuscated LV2 Global.

PJM

Link to comment

QUOTE(Ben @ Apr 4 2007, 07:16 PM)

I have read posts by one of the NI guys that the queue version of the action engine will out perform the SR version.

Sounds weird if this really is so. Shift register is just a memory address and queue is a asynchronous function. Or that's how I've understood it.

Tomi

Link to comment

QUOTE(PJM_labview @ Apr 4 2007, 11:09 AM)

None that I know of. I just put it there for fun. Since it would never occured to me to use a for loop, I start to look for other ways that I could have missed. You can call it the obfuscated LV2 Global.

PJM

I'm glad it was you, PJ who put this little abomination together ... for fun :laugh: . I was going to say: "very clever". :thumbdown:

Link to comment

QUOTE(Ben @ Apr 5 2007, 04:16 PM)

I found the thread where DF Gray mentioned the single element queue was faster and why

I can bet that single element queues are not faster when used in data storage for action engines. I donate to lava $5 if they are faster.

Tomi

Link to comment

QUOTE(Tomi Maila @ Apr 5 2007, 04:48 PM)

I donate to lava $5 if they are faster.

Tomi, I think you are safe :)

If I remember correctly, bsvingen did some testing of this in another thread (that I can not currently find).

The result, as I recall them, was that the LV2 global was faster than using queues.

/J

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.