LabVIEW Idea Exchange

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

Definition of the problem:

To find the scope of an method in code quickly there are two options:

  1. Either place it in another VI or in a child class method, if it breaks you know the scope. 
  2. Look into the project explorer and find it there.

It would be nice if we could avoid the above two methods of finding out the scope.

 

Current solutions:

Of course we can add text in the icon (limited space) or rename the method so it has the private/public/community name in the method (long file names and a loth of work when changing the access scope) and even add descriptions for the scope which requires the context help window to be open.

 

But there is a more elegant solution: In the project explorer there is an way to find out the scope of the Methods in a single glance by the glyphs used on the icons.

 

Project Explorer.png

 

So incorporating this in the Icons of the methods makes sense. Even better there are already a glyphs of the protected and private methods. 

 Proposed Icons.png

 

Proposed Idea:

Changing the access scope into private/protected/public or community automatically add an layer with the corresponding glyph of the access scope. This makes it clear what the scope of the methods are and thus avoiding breaking the code/using long names/writing it in the icon or place it in the description. Automating this also removes a loth of extra clicks to get the same result.

The Excel-Specific, Excel General sub-Palette of the Report Generation Toolkit contains a useful function, "Excel Get Last Row".  This allows a user to add new rows of data to an existing Worksheet by returning a cluster of MS Office Parameters that can be used with the other Excel Report functions (such as Excel Easy Table) to place the new (row-organized) data below existing rows, such as Column Headers, that might be already present in the Template.

 

 

I propose that NI add a similar "Excel Get Last Column" that does the same thing, but returns the last column on the WorkSheet.  This would be useful when entering data one column at a time, not uncommon when entering multiple channels (columns) of sampled data, where you want the new data to be just to the right of the existing (columnar) data.

 

Get Last Column.png

I could easily write such a function myself, but so could NI, and if NI did it, everyone who uses the Report Generation Toolkit would have access to such functionality.

 

Bob Schor

This NIST site defines a non-integer factorial:

http://www.itl.nist.gov/div898/handbook/pmc/section3/pmc32.htm

 

The result of the computation is used in statistical process control.

 

I think that LabVIEW should have its VI's compatible with NIST, and "engineered for process control", seeing how they control processes.  The control shouldn't exclusively about operation, but should also have bounds, and quick/effective alerting for out-of-control condition.  (OOC).

The signal processing VIs only tend to support DBL waveforms and waveform arrays.  Since waveforms can themselves support many data types, the signal processing VIs should also be able to adapt to non DBL based waveform data.  EXT at the very least.

Excel has been around forever, and that means it is optimized for a mix of demographics.  Something qualitatively similar can be said for most tools that have been around for a while, but what differentiates end user group includes the "canonical use case for the feature", and market/economics.  (I am convinced that if NI could make a sustainable/defensible few billion per year with a spreadsheet, then it would make a spreadsheet product.  It is business 101.)

 

One of the tools that Excel, Open/Libre office, MatLab, R, and Python have that LabVIEW doesn't really have (MathScript has it, but not integrated) is a variation on "Goal Seek" [1, 2, 3a/3b, 4, 5 ].  It is trivially easy to say "make the output of my function this, by changing this input" in all of those.  It can be done in LabVIEW, but it is not a "one-liner", and that comes from the UI being engineered around software creation, but not around data exploration.

 

I recommend a tool that can work on the front panel of a VI that allows me to attempt to set an output to a particular value by varying an input.  It can work with fzero, fsolve, or any number of optimization.

 

The demographic here is different than the conventional LabVIEW market in that it is the data-explorer.  This is for folks who want to understand something new, not seek to wrap an understanding they already have into a package.  Instead of capturing data in LabVIEW and processing it in another tool, why not start moving the line so more is done in LabVIEW?  The greater return of value for the same price means continuous growth of market share.  That isn't a bad thing.

Languages like 'R', 'Python', and MatLab (yes I use the old name) have these.  They are useful.

 

One of the key ideas in LabVIEW is that the user needs minimal interventions to code a useful result.  As more information is encoded in a data type there is more opportunity to make "hands free" code that "just works".  I think these two data types can do that.

 

Data Frame:

  • Primary data type in R
  • It is Array-like, but NOT an array
    • each column contains one measurement (row) on one variable
    • It acts like a list of vectors, but the vectors have the same number of rows, and indexing allows a return of all or subset from all columns
    • column types are heterogenous - they can be different
    • column types can be set.  A column of 0 vs. 1 can be set as factors/binomial values or as continuous.

There are functions that data analysis folks do every day that are informed by variable type, so the function operating on the inputs doesn't need type specified because it is interior to the table.  This means you can say "plot(mydata)" and if your data is set up well, the graph parameters are already specified and useful.

 

Some references:

 

Data table:

This is from Hadley Wickham, a very famous person in 'R'.  He does great work, and his name has high brand value in data-analysis.

 

It:

  • Uses the "data.table" package
  • is able to be screaming-fast (think roller-coaster) especially when used with the "split-apply-combine" approach to data analysis, and SQL-like operations.
  • is built for handling huge data (100GB tables) quickly and efficiently.

In many applications the same operation is not possible due to memory constraint or viable due to processor overhead can execute adequately (aka wonderfully) by using this data type on the same hardware.

 

References:

 

 

 

 

Quite by accident, I stumbled upon an inconsistency in LabVIEW's "Square" function.  For almost all operations, you get the same result if you wire a numeric or "structured" numeric (like an Array or Cluster) to either Square or to both inputs of Multiply.  Furthermore, you get the same (or a close approximation to the same) result if you compare the input to Square to the output from Square -> Square Root.  Here's an example for a 10x10 Array of 1's -- if you run this, both Booleans will return True.  Note that I'm testing for "Equality of Dbls" by subtracting them, taking their absolute value, and saying they're equal if their difference is <= 0.000000001.

Square Works for Array.png

 

However, if you transform the Square Array to a Square Matrix, Multiply still does what (mathematically) Multiply should do for a Matrix, namely do a Matrix multiplication (giving a 10x10 Matrix of 10), but Square, instead, simply squares each Matrix entry, giving a 10x10 Matrix of 1.  Curiously, the Square Root function does do a proper Matrix Square Root, i.e. it produces the Matrix that, when multiplied by itself, gives the argument to the Square Root (shown by "Square Root is Inverse of Multiply").

Square Fails for Matrices.png

So here we have a double-inconsistency.  We have a Square function that does not always produce the same quantity as "Multiply something by itself", and a Square function that is not the inverse of the Square Root function, meaning you don't get back the same thing if you Square (a Matrix) then take its Square Root, or vice versa.

 

There is no "warning" (that I've seen) that Square has this anomalous behavior.  It was pointed out to me (by an NI AE) that there is a listing of functions that "work" for Matrices, listing Square Root, but not Square.

 

At the risk of potentially causing code written with the "old" mathematically-wrong Square function to fail if migrated to a function that (mathematically) works properly for Matrices (i.e. is the inverse of Square Root and gives the same thing as "multiply by yourself"), I recommend that NI:

  • Fix the Square function for Matrices so that it multiplies the matrix by itself, and
  • Prominently note that the functionality of Square has been "corrected in this Version of LabVIEW", including on the Help for the Square function.

Bob Schor

 

P.S. -- I searched the Idea Exchange for "Matrix" and found no other mention of this "bug".  It occurs to me that while NI might be reluctant to admit this is a clear bug and to fix it, potentially causing "old code moved to a new Version" to break, I strongly suspect that anyone actually using matrices in LabVIEW would already "know" that Square is broken and therefore not use it for fear of having code that "doesn't do what it seems to say it is doing", a further argument that this should really be fixed!

Every time I want to use the Pick Like String Function, its becuase I want to process a string line by line. 

However its usage is limited by the fact that it does not have a boolean output that goes true on the last line of the string. 

 

This would make it easier to use in a while loop for instance, where the last line can terminate the loop. 

If going past the end of string, it returns an empy string - same as an empty line....

Making the input string a unique string not seen in the file e.g "<EOF>" also doesn't help if a line is empty. 

 

Pick Line.png

 

P.S. Documentation is not clear if the picked line includes the end of line character(s).... It doesn't.

 

So I try to use Pick Line, realise (again) its drawback and then have to think of an alternative... which is easy enough as there are many ways to do it... but my inital thought was not match the end of line character and split the string... 

 

Pick Line work around.png

 

 

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.

Hello All, I find myself often writing duplicate code just to be able to filter out the objects I want to work with from a collection that has many.

 

Examples of that can be:

- sending message objects in queue,

- working with multi object type arrays,

- parsing large objects composed of smaller ones,

- and many more...

 

The duplicated code is almost always the same. It's trying to cast to more specific or more generic, catching the error in case structure and invoking the method im interested in. Being able to perform casting as a part of the teminal would solve the problem with no extra code on the diagram. In the background, the compiler can treat this the same way as cast+case but we wouldn't have to worry about that.

 

The option could be enabled whenever you try to wire an object in the same hierarchy that does not have that specific method you need, but it's on a different level in the hierarchy.

 

ClassIdea.png

 

Please let me know what you think.

 

In the documentation of the Divide Quaternions function of the Quaternion subpalette of the Robotic Arm subpalette of the Robotics Module, the documentation fails to mention whether, given that we are dividing quaternion by y, whether the result is (quaterniony^(-1)) or (y^(-1) * quaternion). As these two are each others' negatives, this seems important. 

If you need to compare two vi hierarchies in memory, it would be nice if the compare tool would take into account the current Conditional Disable Symbols for the files.  (I know that it might not be possible for vi's loaded from file, but ones in memory would be compiled according to symbol state, wouldn't they?)

 

I currently have a project with multiple sub-projects making use of conditional disable structure values to allow for various deployment options, when I need to debug a specific sub-project I generally start with a compare against the projects 'base' sub-project to verify that the sub-project is up to date with any revisions.  It would be nice to be able to also at the same time verify that any conditional symbols are set correctly (f.e. 'base' has all conditional symbols set to 'FALSE', while sub-project 'A' has 2 of the three symbols set to "TRUE".)

Currently, doing a compare will not catch this, it will consider the conditional disable structures the same, even though the actual code compiled (and not greyed out) is different.

 

So my suggestion is Let the Compare tool take into account which sequence of a conditional disable structure is the 'active' sequence when doing a compare.

There are some analytic software that adds connections to Excel.  JMP comes to mind - it allows 2-way data transfer, and allows excel to run some of JMP's analysis routines.  Those packaged routines are vetted by phd's and can't be quickly damaged by a tired user. 

 

This details how JP morgan lost a few billion dollars because they were using Excel for hard math, and someone had an error in an equation.

 

Excel is likely more common than both Javascript or SQL for use in the planet. 

 

It might be very powerful to be able to import an excel spreadsheet, specify inputs, specify outputs, and get it translated to "g".  This could allow it to run thousands of times faster, and the visual language would allow a technical vetting that can be very hard for humans to do on hundreds and hundreds of pages of tables of numbers or formulas. 

 

This would be a motive for banks like JP Morgan (or their peers) and their multi-billion dollar business units to use LabVIEW.  Stunning speed, optimization, and scale.  Stunning accessibility to error correction.  Packages that, once wrapped, stay wrapped, but can plug in where they need to.

 

Other add-in or connectors for Excel:

It is unlike the TDM-importer in that it sends data to LabVIEW, the data is transformed or processed, and a numeric, text, or image result is returned to Excel.

In the "R" language, Hadley Wickham is a superstar.  (personal, git)

 

One of his packages is "lubridate".  It has a stack of very useful time/date handling utilities.  They are most useful for "speaking human" or in average-person-facing user interfaces.

 

You should look at the utility here.  Things like elapsed time in days, or holiday handling built-in.  That might be useful to have in a clean and native package.

With the release of labview 2016 the issue of cross-platform support for video becomes critical.

 

As stated in the "features and changes" page: "NI no longer provides the 32-bit version of LabVIEW for OS X."

 

Up to now it was possible to use Christophe Salzmann's QTLib to work with video. This was great software because the very same "universal" VIs ran on Windows and OSX systems. However, this tool relied on QuickTime. QuickTime is 32-bit and will not evolve to 64-bit (it has been replaced by newer libraries), and so does QTLib.

 

Thus all the code developed with labview including cross-platform video handling cannot be maintained and developed!

 

On the other hand, video is becoming an ubiquitous feature in computer technologies, from mobile apps, to IT, to big data and deep learning. It is a strategic time to push for video on labview across all platforms. It is time for video handling VIs to appear in the standard dev package, just as jpeg or png read/write VIs were added after photos massively entered the computer world.

 

I propose the addition in the "Programming/Graphics&Sound" palette of a subset of VIs for handling video (open video file for read or write, read file frame by frame, append one frame to file, grab frames from webcam). There is no doubt that such feature will be valuable in a future labview release!

 

Hello, I would like to be able to copy a configuration for a specific variable in fuzzy system designer. It's very tedious to specify the ranges and the values for those variables one by one. In some cases there are many variables that are configured in a very simillar way. There should be a copy button next to them.

 

Fuzy System Designer Idea

When you have a probe to se the data in an array, you se all elements in one row (in the Value column) and just one element in the Probe Display area. If you have a large array, it is difficult to get a good overview.

 

My suggestion is that in the part of the probe window called Probe Display, you should be able to pull the bottom right corner and see several elements simultaneously.

 

Probe 4.png

 

An extra feature would be to also show the array size anywhere in the probe window.

The Report Generation Toolkit includes Excel Easy Table that allows either Text (2D String Arrays) or Numeric (2D Dbl Arrays) to be written to Excel.  The function is written as a Polymorphic function to handle the two types of input.  However, when processing numeric input, an inner function called "Append Numeric Table to Report (wrap)" converts the numeric data to a String Array using the format string %.3f.  This is, in fact, a Control input for the function, but its caller does not wire the input, forcing the numeric data to be truncated to three significant digits.

 

I suggest that the default either be changed to %.15f (or something similar) to preserve the precision of the input data, or the Format String be "brought out" to the User (but there are no free Connector slots) to allow the User to control the precision.

An add-on to the highlight execution that makes the highlight execution go into the subVIs and keeps doing highlight execution in the subVI

It would be useful if there was functionality within the VI Analyzer, under the style section, that checked for overlapping on the block diagram. This would allow you to be able to check readability and check for some mistakes. For example, it is possible to copy and paste while loops on top of each other. VI Analyzer should be able to tell you that there are 2 while loops overlapping to help with style and debugging.