LabVIEW Idea Exchange

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 
Post an idea

Classes? OOP? ... Huh?

Even if you don't (yet) work with LV classes, you may have noticed that they are starting to become increasingly widespread in the LV world. In fact, the excellent new Actor Framework that ships with LV2012 relies heavily on classes. LV classes are great but they can impact on your performance as a developer as your application becomes larger. I'd encourage everyone to click the magic KUDOS button for this idea, since classes will likely affect us all sooner or later!

 

 

The problem:

Most class-based architectures contain some degree of linking. One form of linking is inheritance where parent-child relationships are implicitly defined, and another form of linking arises from nesting libraries where classes (e.g.) are placed inside other libraries.

 

Unfortunately as the linking increases in a project, the IDE starts to become very sluggish! Those who have worked on mid-sized class-based applications know the symptoms:

  • Opening the "class properties" window takes 10 seconds or more
  • Renaming a class brings the editor to a standstill

For many projects these symptoms are a minor annoyance, but as your project grows they can become a serious impediment to productivity. Why should it take over 30 seconds to modify a class's inheritance?!

 

Obviously careful design can reduce linking to some extent, but that just postpones the pain. The reality is that all class-based projects start to suffer from these symptoms once they reach a "resonable" size.

 

 

The idea:

Improve the responsiveness of the LV editor when working with classes.

  • Highly repetitive tasks such as editing a class library's icon deserve a snappy response from the IDE, regardless of how many classes I have loaded!
  • Modifying inheritance is a fundamental operation. It should be quick and easy! (See this related idea)
  • Placing classes in libraries promotes good project organisation. It should *not* bring the editor to a grinding halt!

hierarchy.png

 

Credits:

Others have written about this topic well before me. Here are a few relevant discussions:

Feel free to link more! Smiley Happy

The VI documentation window could use some improvement and several additions could be made to make editing the text a lot easier.

 

6-4-2010 2-31-40 PM.png

 

Improving adding control and indicator name.

 

Typically the text in the documentation window does refer to the control and indicator connected to the connetor pane.

It would be very convenient to have this information already in that window so we don't have look it up when needed. Additionally, the control and indicators are typically bolded in the resulting text using the <b></b> tag. It would be convenient if this would be done automatically for us.

In the propose idea (see image below) the VI icon with the controls and indicators is shown and the controls and indicators when clicked do insert their name into the VI description. 

 

Note: The control name may be made to look like an hyperlink to indicate that there are click able.

 

For example, in the image below, clicking the "Items to filter" will insert the "<b>Items to filter</b> tagged text in the VI description.

 

6-4-2010 2-16-46 PM.png

 

Improve general text editing

 

While fancy text editing is limited in the VI description, adding a toolbar to improve text formatting would be useful.

 

6-4-2010 2-31-40 PM.png

 

 

Cluster Size as a Wired Input:

 

  • Easier to see
  • More implicit
  • Nearly impossible to forget to set it (if it were a required input).

 Cluster Size.gif

It has come up here in a different discussion, but I think it should be a separate idea, so here it is!

 

If we disable part of the code using the diagram disable structure, the disabled code gets lighter in color. The new compiler is good at eliminating dead code (i.e. things that don't need to be computed because there is no output), so it could be useful if these code parts are also bleached in a similar way to indicate that fact.

 

Here's how it could look like.

 

I would even suggest this to be enabled by default. Of course there also needs to be an option to turn it off....

 

(I was about to write up this idea, but then, searching for "dead code", I found comment by SynchronizationOverhead. So the original credit goes there, of course ;))

Since most (if not all) controls and indicators can be moved around with "position" property node programatically, the X and Y coordinates on the front panel are useful information to have.

As of right now, users have to adjust the position values by trial and error to know what values suit the UI, or maybe make a program to capture the mouse position programatically.

 

So I've been getting feedbacks from customer about a function where one can view the coordinates of the mouse all of the time. (meaning no programming is necessary)

I was thinking about two methods (see attached)

 mouse coordinates FP.png

 

1. Show coordinates along with the mouse

2. Show coordinates at the bottom of the pane

 

Thanks,

 

 

 

Current it is very hard to reliably manipulate decorations using VI server.

 

LabVIEW need to be able to create explicit decoration references (like it is possible to do on other objects through right click Create>>Reference).

 

Decoration Explicit Reference.png

 

Note: Thanks to TonP for the idea.

(This is an idea related to Jack's idea here, which however deals with "reshape array".)

 

When using "built array" with parts that are mismatched in lenght, the largest input wins and the rest are padded with the default value for the given datatype (zero for numerics). This is often not desirable, for example when graphing multiple plots.

 

Padding with zero causes extra data (zeroes) to show on the graph that did not exist in the original wires. A more desirable option here would be to pad with NaN so only actual data is graphed.

 

My suggestion is to add an optional input to "built array" that allows defining the pad value is case the inputs are mismatched.

 

Here is an example how it could look like. (of course the icon would probably need to change a little)

 

 

 

This has been discussed in various places like here, but I couldn't find an idea for it...

 

 

There are quite a few LabVIEW primitives which will always run, even if presented with an error on the "error in" terminal. Common examples are "Close Reference" and "Close File". 

 

What would be really useful is to have some kind of visual indication of this behaviour. Ideally this would be a simple marking on the VI icon which could be easily replicated by LV users when we create such VIs ourselves. (It could possibly even be an option in the icon editor!)

 

runonerror2.png 

 

Currently the only indication that a VI will run on error is this discrete line in the VI help:

 

runonerror.png

 

I believe a visual indicator would be much more fitting for LabVIEW as a visual language, and would make this behaviour far more obvious to LabVIEW users.

This is a very small suggestion, and hopefully easy to implement.  When wires cross, very often one of the wires involved is an Error wire, and as it is usually wired last, it sits on top of all the other wires.  All I'm asking is that Error wires are always placed underneath all other wires when they are created.  To my mind, this improves the readability of the diagram.

 

ErrorWire.png

 

What would help further is if Error wires were "faded", as if they were 50% transparent.  You do need to be able to see them, but not such that they stand out.  But I'm much less certain that such a change could happen.  The khaki color is an improvement on the old pink though, that's for sure!

 

I have a rather large string indicator for displaying operator messages/alarms

and I would like to have the option for an automatic vertical center of the text,

so that all messages get displayed in the center of the screen (if too many lines, justify to top and display the scrollbar).

I also have a 2 line statusbar, but displaying a 1 line message that is not vertically centered, looks very strange.

 

The work-around I'm using now is to display the multiline string centered in a picturecontrol,

but I'm not a big fan of this fix because there are many boundary-conditions to keep in mind ...

 


 

Another annoyance is that to prevent selection of text in the indicator I often disable the indicator

(it looks unprofessional if an indicatortext can be selected in the GUI),

but if the displayed text is larger than the string indicator, the scrollbar is also disabled !?!? 

and therefore not controllable by the user

 

I would like to have the ability to make a Front Panel background transparent without making the whole window transparent (where the later is currently possible through property nodes).  This one item would expand the UI possibilities.  It would allow for the creation of Front Panels that seem to be borderless similar to many splash screens, about screens, and gadgets.  Below are some industry examples:

 

Adobe X.png

Adobe Splash Screen (No border, has shadow, not square)

 

Microsoft.png

  Microsoft Word 2010 Splash Screen (No border, rounded corners)

 

Meter.png

 Resource Meter Windows Gadget (No border, specialized graphic)

 

Windows Media Center.png

Windows Media Center Gadget (Empty-transparent space between two UI elements)

Hi,

 

i propose to add a "Key Focus" event for each control. We already have Mouse events (leaving, entering) - but when the user (or the programmer) prefers the keyboard (with proper tabbing setup) you have to poll each interesting control for it's "Key Focus" property to initiate a user event...

 

So please:

Add a "Got Focus" (and additionally a "Lost Focus") event to the event structure!

Have you ever placed a background image on your front panel to make it look good, but then found that most of the controls and indicators covered everything up?

Ever wish LabVIEW had more appearance customization to make better looking GUIs?

 

I would like to propose an opacity slider control in the appearance settings tab of front panel object properties. The added setting would not make the entire objects opacity change; ideally the opacity control would only affect the borders and grey space. With this added control users can make better looking user interfaces without having to make custom controls.

 

Take a look at the difference:

 

Not Ideal Front Panel with background image and NO Opacity Control

 

front_panel_no_transparency.png

 

Beautiful Front Panel with background image that you can still see by setting Opacity Control to 50%

 

front_panel_semi_transparent.png

 

 

 

Before and After Appearance Settings tab in the Properties Window for a waveform graph:

 

appearance settings before and after.png

 

 

 

Currently the only easy way to implement a similar type of setting is go fully transparent by using the tools palette paintbrush tool and setting the color to transparent:

 

tools pallete transaprency.png

 

 

Kudos and share this idea if you want it to happen!

This recent idea reminded me of something I have wanted for quite some time now:  the ability to determine if a property is read or write based on wiring, not some half-buried option in the right-click menu.

 

ReadWritePropertyNodeBD.png

 

The basic idea is simple:  all properties have two terminals, one for writing and one for reading (except read-only of course).  No right-clicking, just wire up the direction you want.

 

The bottom case is a bit interesting.  I see a few possibilities:

1.  Passthrough (cosmetically saves branching, crossing, etc.) Same behaviour regardless of errors.

2.  Read then write : returns previous value.  What happens if there is an error?  Passthrough, old value?

3. Write then read: almost always passthrough.  In case of error would it return old (ie. actual value) or passthrough?

4. Do not allow this.

 

I would expect it to perform the write and then the read (3) or passthrough (1).  What is more important to me is the actual value and not the intended value.  Mentally I just see data flowing into then out of the PN when both are wired. 

 

Bottom line:  I see no reason not to permit the wiring to determine read or write of a property.

 

If there is a cop-out lack of consensus and simultaneous connections are not allowed, I would at least ask for a keyboard modifier (say shift) such that I can shift-drag to expand the PN and get the same property repeated instead of going down the list.  Then I could at least do the write+read with a lot less mouse movement.

I would like the ability to enter simple equations in numeric controls and constants. Pressing return places the answer in the control or constant.

 

Smart Numerics.png

When working in LabVIEW in low light conditions, it would be nice to be able to have a quick way to switch to a dark mode, where the default block diagram colour would be a mid-dark-grey.

The web format wars are over, and the plug-ins have lost.  Microsoft has relented and will support HTML5 and SVG in IE9, and has admitted that Silverlight's role will change to that of a Windows phone development platform.  Silverlight support on iPhone/iPad/Andoid/Chrome OS will likely never be fully formed, and will wither on the vine. 

 

New javascript/ecmascript engines that are much faster, and make use of multicore environments have arrived and work well.  The addiition of WebSockets means your browser can now open a tcp/ip socket.  I have done this, as I am sure others have, as well.  Drop an old-fashioned tcp/ip listener into your diagram, return the WebSocket handshake, and presto: you can now stream data directly to/from your browser.  WebSockets provides an "onmessage" event handler function which you can define.  Combine this with the SVG DOM, and you can transform SVG elements until your heart is content.  Two-way streaming of data between your browser and plain-old tcp/ip?  Goodbye web services, we knew you well. Good riddance, plugins.

 

I have built my own SVG UI objects using Inkscape (free), and wrote a script (notepad/Inkscape script editor, also free) to handle WebSockets communication without a gateway.  I have a simple LV class built on the TCP/IP functions that will stream data to/from a browser which is pointing to an SVG "webpanel" that I also built using Inkscape.  So far I have a simple waveform graph, buttons, LED's, progress bars, etc.  I have tested my Inkscape webpanels in Firefox 4.0 Beta and Google Chrome 9 and it works like a champ, and is very fast.  The old-fashioned LV webserver will serve up SVG files with the addition of a mime type. 

 

Screenshot_5.png

 

 

An alternative to SVG is the HTML5 <canvas> tag, which allows the rendering of graphics drawn using java/ecma script.  There is a free-for-personal-use script library called RGraph Library that you can download with lots of example code.  Here is RGraph/LabVIEW in action in Chrome 9:

 

 

Screenshot_7.png

 

 

So what is my idea?  

 

0. Ditch Silverlight.

 

1. Convert all of the nice-looking UI panel objects in the Web UI Builder from Microsoft XAML to SVG and distribute them with the  LabVIEW professional development license.  I am programmer first, and I admit my web panel objects don't look too good.

 

2. Design a script library for handling WebSockets communcation (or add native support for WebSockets to the Shared Variable Engine) and manipulating/updating the SVG UI objects from streamed WebSockets data.  Make this library open source.

 

3. Create a standard open protocol for streaming LabVIEW data that sits on top of WebSockets and is free and open.

 

4. Publish documentation for the SVG UI elements so users and thrid parties can create new UI objects.  Make use of the creativity of the community at large!

 

5. Modernize the Web Publishing Tool so that it will optionally output an HTML5 and/or SVG document that accepts streaming I/O from WebSockets.  The user could choose from compatible SVG elements to use in place of front panel elements on the VI being published.

 

6. Create a Web UI SVG element exchange for registered NI users to upload/download elements for free.

 

7.  Work toward the long term goal of adding SVG Import/Export to the control editor (with better editing tools), or make the CTL format of custom controls SVG/XML.

 

The current implementation of Control References on the Block Diagram could be improved. This Idea was first conceived over a year ago in a discussion on Smaller Static Refs, in the comments here.

 

21816iB89689857FFA076E

Consider the following advantages:

 

  1. It's generally bad style to have Ctl Refs with hidden labels. New implementation always demonstrates the label to comply with inherent self-documentation of G (just like a Local)
  2. Smaller footprint combined with better visual distinction between Ctl Refs doubly improves information density
  3. In general, the Control Class does not need to be shown at all times on the BD. Rather, it could be shown in Context Help (currently, CH is not useful when hovering over Controls Refs, but this is another topic), or determined by browsing Properties/Methods.
  4. Eliminates the undesirable ability to rename/delete a Control Ref Label such that it no longer matches the Terminal Label.
  5. Creates a better distinction between a Control Ref and a Control Class Constant (NULL Ref). The color of the Static Refs denote a "live link" with a control, while the muted tones of a Class Constant indicate no such link (NULL)
  6. Complements the new LV2010 Local Variable upgrade (see image), yet remains distinct by having a different glyph, different background colors, and no directionality arrow
In summary, a Control Reference revamp could reduce the footprint, increase readability, and prevent obfuscation that decouples the Static Control Ref from the Control.