LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Darren's Weekly Nugget 10/02/2006

Joyeux Anniversaire Darren !

 

Chilly Charly    (aka CC)
0 Kudos
Message 11 of 26
(4,670 Views)

Adding to Darren's wish list...

I would like to see a new test added to the VIA that looked for multiple writers of Locals and Globals. More thatn one writer gives a warning.

In the distant future I'd like LV to help enforce the single writer idea by allowing only one writer of of a global by default. Attempts to change to write would give a similar warning and remind the developer where the other writing of the globla is happening.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 12 of 26
(4,382 Views)


Ben a écrit:

In the distant future I'd like LV to help enforce the single writer idea by allowing only one writer of of a global by default. Attempts to change to write would give a similar warning and remind the developer where the other writing of the globla is happening.



... and LV offers to automatically replace all the instance of the global with a FGV Smiley Very Happy


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 13 of 26
(4,379 Views)


@TiTou wrote:

... and LV offers to automatically replace all the instance of the global with a FGV Smiley Very Happy

But an FGV is not inherently any less prone to race conditions than a global. You have to add locking to it or place the functionality inside it to prevent race conditions. It does give better memory performance at the price of speed. I really wish that people would stop automatically thinking of FGVs as the automatic solution to all the world's problems.

And yes, I remember that I didn't finish with the globals thread in the BP. Shame on me...


___________________
Try to take over the world!
Message 14 of 26
(4,346 Views)


tst a écrit:

But an FGV is not inherently any less prone to race conditions than a global. You have to add locking to it or place the functionality inside it to prevent race conditions. It does give better memory performance at the price of speed. I really wish that people would stop automatically thinking of FGVs as the automatic solution to all the world's problems.

And yes, I remember that I didn't finish with the globals thread in the BP. Shame on me...


Right tst, nothing is perfect and we should use the most appropriate technique. Yes, many people, including myself, automatically think of FGV which is not always appropriate. Who's perfect ?

Anyway, having a built-in function in LabVIEW to "control" that the developper is not making a "bad" use of globals would be nice, no ?
Offering to replace by something else... well I am among the firsts who hate "things that know better than you what you want to do", so it was more a joke than a wish.

Don't feel ashamed about  the global thread in BP, you did very well to raise this point and started to do a good job... and none of us jumped in to give you a hand. Shame on us ! 😉



We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 15 of 26
(4,339 Views)


But an FGV is not inherently any less prone to race conditions than a global. You have to add locking to it or place the functionality inside it to prevent race conditions. It does give better memory performance at the price of speed. I really wish that people would stop automatically thinking of FGVs as the automatic solution to all the world's problems.


Exactly the conclusion I came up with when I was trying to fix a pre-existing, large application of ours with a multitude of race conditions all over the place.  That was definitely a buggy test station app when I started on it.  It has 6 parallel loops in the main block diagram if that gives you any idea for the race condition potential.  It would intermittently hang and do a handful of other weird things, so the operator of the station definitely wasn't happy.  Talk about getting thrown into a major coding situation cold turkey (as a freshly certified CLAD).  I finally got the majority of the race conditions taken care of by simply changing things around so there was only 1 writer for each global.

- Brad

0 Kudos
Message 16 of 26
(4,345 Views)

Darren asked

"

  • A block diagram comment should word-wrap if it's being typed inside a structure, and the comment bound approaches the edge of the structure.  Actually, it would be nice if a comment typed anywhere on the diagram would word-wrap if its bound approaches any diagram object.
  • "

    Well this is ont exactly what you wished for but its close!

    Aristos Queue posted in post #102 of this thred on the LV site

    http://forums.lavag.org/index.php?showtopic=1576&pid=17521&st=90&#entry17521

    The following

    "

    But... from LV7.0 forward...
    After you drop the string control, type for a while. When the string reaches the max width that you want, hit shift+Enter. Keep typing. The string will now wordwrap at the current width, and grow vertically. When you reach the maximum desired height, hit shift+Enter again. The vertical scrollbar will appear and the string will now scroll instead of growing any further.

    Sorry... the trick doesn't work on free labels. Perhaps someday...

    "

    I just verified this for a LV 7.1 string constant on the diagram.

    So can we check-off one of your wish-list items?

    Ben

    Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
    Message 17 of 26
    (4,185 Views)

    @Ben wrote:

    "...Sorry... the trick doesn't work on free labels. Perhaps someday..."

    ...

    So can we check-off one of your wish-list items?


    I would say no. To use a comment when the auto tool is on, all you need to do is double click the diagram and start typing. To use a string you need to find the string constant on the palette. Therefore, this would only really be useful when it is available for comments as well.

    ___________________
    Try to take over the world!
    0 Kudos
    Message 18 of 26
    (4,169 Views)

    Hi tst,

    You bring up an intersting point.

    I went to the VI Checklist

    http://zone.ni.com/reference/en-XX/help/371361A-01/lvdevconcepts/checklist/

    to try to find the note that said that if you are entring a lot of comments, that it is recomended that you use a string constant with the scroll bar showing. Well it appears that note has been deleted. So what used to be good is now bad. I would not care about that kind of hair splitting if I didn't have to pass a test every couple of years.

    Ben

    Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
    0 Kudos
    Message 19 of 26
    (4,162 Views)


    @Ben wrote:
    After you drop the string control, type for a while. When the string reaches the max width that you want, hit shift+Enter. Keep typing. The string will now wordwrap at the current width, and grow vertically. When you reach the maximum desired height, hit shift+Enter again. The vertical scrollbar will appear and the string will now scroll instead of growing any further.


    Ben, this is a nugget in its own right!  The number of times this could've saved me considerable frustration...

    Very handy to know.  Thanks for posting it!
    0 Kudos
    Message 20 of 26
    (4,155 Views)