LabVIEW Idea Exchange

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

The goal of this idea is to make it easy for the LabVIEW ecosystem to create reusable libraries for LabVIEW that would be type independent. Let's think for a second dictionaries, also called as key-value stores. Dictionaries are data structures that allow storing and retrieving values with a specific key. To create a generic reusable strongly typed dictionary is currently impossible with the LabVIEW type system. One can create a dictionary that is type specific but then it's not reusable. Or one can create a reusable dictionary but then it's not strongly typed. Type Parameters and Parametrized Generic Types as explained in this idea would allow creating strongly typed dictionaries that are widely reusable across applications. Specifically type parameters and parametrized generic types would allow LabVIEW ecosystem to develop highly reusable strongly typed components to solve various common programming problems. This would allow National Instruments to put more focus on the core of the language as the LabVIEW ecosystem could solve much wider range of problems that preivously have required National Instruments to contribute.

 

Add a new control type Type Parameter to LabVIEW that augments the current Control, Type Def and Strict Type Def control types. The Type Parameter type would act like a regular Type Def control with one special and important distinction. You could wire anything to an input terminal expecting a specific Type Parameter type and the downstream type would adapt at compile time to the type wired to the type parameter input.

Type Parameter Definition

 

In a single VI type parameter could be used in multiple places but all instances of the type parameter would adapt to the same type.

 

Type Parameters

 

When a VI that uses Type Parameters in the front panel is used on a block diagram, the template VI is replaced by the compiler by a type specific instance that has adapted the type parameters to the type wired to the Type Parameter input. Notice below how in our VI the control and the indicator were of type Type Parameter with a default type of DBL and the instance got adapted to type U32 that was wired to the input.

Calling a VI with Type Parameter Inputs

The same type parameter could be used on multiple inputs of a VI.

Multiple Inputs of The Same Type Parameter

And all of the type parameters would adapt to the same type when the VI is being used.

Calling a VI with Multiple Type Parameter Inputs of the Same Type

Note that in the above example we chose the element of the array to be a specific type specified by a type parameter. However the arrays themselves could as well have been specified by a type parameter.

 

So far we have focused on VI boundary where type parameters adapt the whole VI to specific type or types if multiple different type parameters are being used in the connector pane of the VI. Type parameters can also be used in composite types (e.g. arrays, clusters, classes) and the downstream composite types would adapt to what is wired to the type parameter input.

 

Type Parameters with a Cluster

Note that x and y as instances of the same type parameter have to be of the same or compatible type.

Type Error With Type Parameters

 

Type parameters can also be used in class private data to create parameterized custom types. This is where type parameters become extremely powerful. Let's assume that we have a class 3D Vector.lvclass that has three instances of a "Data Element.ctl" Type Parameters. The default type of the Data Element is set to be DBL. The cluster private data has three instances of the Data Element, one for each of X, Y and Z.

Type Parameters in Class Private DAta

 

Now we could create a Create 3D Vector method VI for this class that allows us to construct type parametrized instance of the class type.

Creating a Type Parametrized Object

Now calling this Create 3D Vector.vi with string as the inputs for type parametrized inputs X, Y and Z will create an instance of class 3D Vector with compile time type 3D Vector[String].

Calling a VI that Creates a Type Parametrized Object

 

And this is where we now start seeing the superpowers of type parameters and parametrized types as well as generic type parameterized VIs that go along with them. Now we have a capability of creating custom VIs and custom types that both can adapt to different parameter types at usage time.

 

Let's get back to the question of dictionaries. We could easily construct a dictionary that allows the key type to be parametrized with one parameter and the value type to be parametrized with another parameter. For example we could use the dictionary with I32s as keys and Strings as values. Or we could use it with Strings as keys and File Paths as values. Constructor for such custom type would be trivial to create.

Type Parametrized Create Method for a Dictionary

 

Once we have constructed the dictionary we would naturally like to use it. We could now use method VIs of the Dictionary class to add and fetch elements from the dictionary. As an example Get Element By Key would look something like this in it's simplest form.

 

Get Element From Dictionary

 

 

Note that Dictionary In is type parametrized with two different type parameters Key Type and Value Type. In the class library there is a Type Parameter control Key Type.ctl and Value Type.ctl. Now type parameter Key Type.ctl is used both inside the private data of the class and on the fron panel as the Key input, the type of these two must be the same. The same is true for the Value Type element of private data and the Value indicator that both derive from Value Type.ctl type parameter. The has function is any function that can convert any LabVIEW types to some strings that we can use as keys for the variant attribute node. We are using variant attributes as the store implementation is this basic example.

 

Calling the Dictionary with integer as the type parameter and string as the value would look something like this.

 

Calling a Type Parametrized Dictionary

 

As you can see the 0 and empty string will define propagate as type parameter types for Key Type and Value Type in the dictionary wire. Now Add Element.vi would have to adapt to these elections for Key Type and Value Type the moment the Dictionary wire is connected. The Key input immediately change to type INT32 and the Value input to type String. Similar would be true if the wires would be connected in reverse order. Connecting University of Texas string to the Value input of Add Element and connecting number 1 of type INT32 to the Key input of the Add Element would immediately adapt the Dictionary in and Dictionary out inputs to be of type Dictionary[Key Type = INT32, Value Type = String]. A type error would occur if Dictionary in would be of different type.

 

Type Parametrized Generic Types are an extremely powerful concept to incldue in a language and this idea describes a feasible way to implement them in a visual dataflow model of LabVIEW. This is and has been for maybe ten years my absolute #1 feature I have wanted to see in LabVIEW. I think the time is right for me to officially make this request. Ideally Type Parameters can be bounded but that's a topic for a whole other idea post.

For no obvious reasons, the "array subset" and "string subset" nodes are currently not resizeable.

 

Many times, I need to get several subsets or substrings at once and resizeable nodes would be a welcome improvement. Thanks!

Message Edited by altenbach on 06-05-2009 03:53 PM
Message Edited by Support on 06-08-2009 09:07 AM

I recently did some work that required a lot of simple equations. The formula node works fine, but the diagram would have been easier to read if I could have entered equations like this:

 

 Equation Node.PNG

 

Equation Node : Mathcad ::  Mathscript Node : MATLAB

Long, long ago in a LabVIEW version far, far away there was a simple Scrollbar Control that was fully customizable.

 

Somewhere around LV8.0 (?) it mysteriously vanished, and now when you select a scrollbar from the Modern>Numeric palette, you are given a bog-standard system scrollbar instead.

 

scrollbar.png

 

Now don't get me wrong... I LOVE using system controls and use them whenever possible, but there have been a few times where I have really missed my customizable scrollbar.

 

  • Have you ever tried to use a system scrollbar on a touchscreen?
  • Have you ever had a client that wanted their UI painted stylishly black (or red, or whatever), without wanting you to mess with their windows themes?

I recently developed a lovely black XControl scrollbar with properties that mimic the system scrollbar but it was a lot of work, and it still lacks some of the flair of the built in version (like scroll-wheel response, click and drag resizing). Plus, it requires a bunch of extra VIs to be in memory that didn't need to be there before...

 

scrolbar.black.png

 

Wouldn't you love to see the good old customizable scrollbar reinstated?

When searching for a single pattern we define the pattern as *.vi (for example). If we want to filter out say three patterns like (*.c, .h,*.txt). It doesnt work that way. In file dialog if we define these patterns seperated by semicolon it returns the desired result but in list folder we have to use a for loop for multiple pattern searches. Will it not be useful if we define (*c;*.h;*.txt) in the pattern and get only these files?

In File-Explorer you can show File Properties.

Some files show only common information on the "Details" tab.

But Media files show much more Details.

I want to see there "LabVIEW Version" and "VI-Version" of VIs.

File Properties.png

I love the In Place Structure.  But when I use it to access the bottom level data of a fairly nested data structure, nesting five In Place Structures seems like too much work.

5 levels.png

 

 

 

 

 

 

 

 

 

 

 It would be great if one In Place Structure could be used to do the work that these five are doing.  I'm sure there's much better ways of doing this, but it could look something like this.

1 level.png

 

 

 

 

 

 

 

 

 

 

 

I may be way out on a limb here; would this be useful to anyone else?

After deleting items I don't want in the project, or loading plugins in a  plugin architecture, I want to remove them from the LabVIEW memory. This is not possible now, as they go into Dependencies->Items in Memory.

Items in memory.PNG

The only way to do this now is to close and open the project, which over a large Plug-in architecture project is a real pain. 

Ideally, I would like to right click the folder and choose "remove from memory". However, any option that allows this would be good.

 

Thank you!

Danielle

 

The Drag and Drop event Drop has an element named "Available Data Names". This is a needleslly very long element name and wastes a lot of BD space (the whole vertical area can't be used for a case structure, for example).

 

Something like simply "Data" would be enough..

Untitled.png

 

Recently, I discovered an annoying "feature" of LabVIEW: if you limit the data entry of a floating point numeric to a maximum value with coercion enabled, entering NaN to that numeric will be coerced to the maximum that you set in the data entry dialog.

 

I already reported that as an unexpected behaviour, but after some more thinking, I dare to go even further and propse:

 

allow the blocking of NaN in floating point numeric data entry

 

idea_discard_nan_data_entry.png

 

The logic needed should not be much more than a finger exercise, as string controls already allay to discard CR/LF with the "limit to single line" property.

 

Best regards,

Sebastian

When you mass compiled, all VIs in the directory tree get recompiled. When you hold CTRL and SHIFT and click the run button on a VI, it forces a recompile of all VIs in the call chain. 

 

However, when you CTRL-SHIFT-Run, all you SEE is a busy mouse; it would be really nice if you could get a popup windows (the same as when you mass compile) showing what's going on, and giving options to cancel... it would also be nice to be able to specify a log file and how many VIs to cache, same as with mass compile...

 

It could be the same popup with a different title...

 

 

Most languages I have worked in have had a library for common data containers (Tree, Linked List, Stack/Queue, Hash Table, Map, Etc.). I understand that these data structures can be made by using an array and storing array indexes.

 

Lets face it, it stinks to have to write your own data container evry time you can't force a queue to do something it was clearly not meant to do be able to do, like be a stack.

 

The advent of classes in labeled was great & I have spent plenty of time creating data structures classes, but the problem is that without templates, or the ability to have more than one kind of dynamic dispatch terminal in a VI, you end up having to write a wrapper to box & unbox your data.

 

The other problem that I have found is that generally all data must be put into a array for storage. This makes inserting and deleting items from trees and link lists tricky.

 

I think a set of native data containers along with the operators/methods to manipulate them should be added to labview. It would be nice if upon creation there was a polymorphic terminal that would allow you to wire up any basic primitive type (numeric, double, boolean, string, cluster, references, etc.) as well as classes (not just the LV object, but a template like approach) and variants.

One piece of code that I am tired of looking at is calculating start and length from start and stop indices for Array Subset.  I find that more often than not, I have start and stop indices as opposed to start and length.  I would like an option on the existing node to use start/stop, or even a new node if necessary. 

 

NewSubset.png

 

(If a new node is created, expandability would be nice)

How is NI-MAX still so bad after all these years? It goes completely unresponsive and crashes at the slightest provocation. This feels like it should be NI's bread-and-butter.

 

Every LabVIEW team ends up recreating so much of the functionality that NI-MAX is supposed to offer out of the box. Maybe with the discontinuation of NXG, some resources should be allocated to making this product usable.

 

TurboPhil_1-1629324790878.png

 

 

KB articles like this and this probably shouldn't need to exist.

In "Case Structure", when we use "Linked Input Tunnel" and select one end of the tunnel, is it possible to highlight the opposite end? as is the case with "Shift Register".

 

case.pngWe have crossed the wires on purpose, because it isn`t always possible to make a straight line. 

 

This one's pretty simple...  Multicolumn listboxes have a "Moveable Column Seperators" property that's available from the menu at edit time:

_carl_0-1598023462090.png

But this property isn't exposed through property nodes.  I'm currently in a situation where I really wish it was!

 

I'm not the only one who's encountered this:

https://forums.ni.com/t5/LabVIEW/Moveable-Column-Seperators-Property/td-p/2217334

With the increasing size of the LabVIEW ecosystem, there is a growing number of third party tools written in LabVIEW that are versioned independently from LabVIEW's version number.  For example, I could create an API that has versions 1.0, 2.0, and 3.0, and all three versions could be compatible with LabVIEW 2009 or later.  Tools like VI Package Manager make it easy for content creators to publish multiple versions of an API, and for users to upgrade and downgrade between those versions.  However, this ease of use disappears if significant changes have been made to the VIs in an API, such as:

  • Changing VI connector panes
  • Renaming or moving VIs on disk
  • Adding VIs to a library

If any of the above changes are made to VIs in an API between versions, it can become impossible to migrate code between the two versions without a lot of manual searching, replacing, and relinking.

 

LabVIEW should provide a mechanism to define mappings between old and new versions of third party toolkit VIs.  Consider the case where I make the following changes to a VI from my toolkit:

 

 

Version 1.0

Version 2.0

VI Path

 

<userlib>\mytoolkit\CompRes.vi

<vilib>\mytoolkit\Compute Result.vi

Owning Library

 

none

Mytoolkit.lvlib

Connector Pane

 pane1.png  pane2.png

 

I should be able to create a mapping file included with version 2.0 of the toolkit that describes the changes made between versions 1.0 and 2.0 of the VI.  This way someone could write an application that calls version 1.0 of the VI, then upgrade their toolkit to version 2.0, and the application source code would be able to find, load, and relink version 2.0 of the VI without any hassle.

The Class Hierarchy window is a great tool to see the relationships between classes. It would be even better if you could use it to change those relationships.

 

I imagine something identical to the way we program with G: connecting wires and moving around icons. A user should be able to drag a class icon around in this window and wire relationships as they see fit.

 

21133i7D399BB1CC32A52F

 

1. Notice an additional button in the Hierarchy window. This is what's used to draw the relationships.

2. By moving an item out of the row (or column if using the "Horizontal Layout") that it's in, the relationship wire disconnects.

3. Using the wiring tool, a user can reconnect the relationship at a different level. Now the red one I've moved is a grandchild of Green.

4. If the user tries to make an invalid relationship (multiple parents, children higher than parent, etc.), then the wire shows broken. The Class Hierarchy window cannot be closed until it's fixed.

 

 

Discuss! I'd love some feedback on this idea. Good? Bad? Better method available?

 

Please add to the right-click Cluster popup menu a Remove Cluster item analogous to a tab control's Remove Tab Control removes the parent container and leaves the contents as-is.

Currently, if you delete an enum option from a type def, LV just guesses what you want in the calling VIs. This can lead to unexpected results. Example:

Calling VI:

harmless function.PNG

Delete an element:

remove element from enum.PNG

Callee changes but doesn't warn the coder:

bad day.PNG

I'd prefer that if it didn't find a string match for each enum reference, that the VI gives you a broken arrow and asks you to replace the offending element.