LabVIEW Idea Exchange

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

Hi,

 

I develop LabVIEW long time and I find it unfortunate that we still can not change a value of a variable (or wire) for testing code or to continue to debug our application.

 

The solution would probably be able to change the value directly on the probe, in case of breakpoint with probe of course.



Most of the languages ​​do this, so why not LabVIEW ?

 

 

 

JC

Life can be a real beach when working on a load of high-performance VIs which have a bug somewhere.  First spend half an hour un-setting "Subroutine" on a tree of VIs, then find the bug, spend another half an hour re-enabling sub-routine execution and then spend a further half an hour finding the last subVI you forgot because you've noticed a problem when benchmarking...... Smiley Mad

 

How about setting a VI to conditional subrouting meaning that it retains its subroutine status until you place a probe or breakpoint in it  (It would be nice if calling VIs adapted also of course).  As soon as the breakpoint / probe are removed, return as normal to subroutine execution.  Man would this save a lot of time.

 

Shane.

I find that my code window quickly becomes filled up with comments and notes.  Could we, maybe, have a small comment icon, which we can put in the code and which displays the comment when you hover your mouse pointer over it? 

 

  My present workaround is to put larger comments in the documentation window and number them, so that I just have to put a reference number in the code.  Maybe these two documentation devices could be dynamically linked together somehow.

Similar to the discussions on command and data cluster primitives, it seems many programmers would like the ability to have a primitive to move a message and some additional data easily. The current methods involve casting specific data types to a generic types (i.e. Variants) which are then passed to a sub-process. Once in the sub-process, the process reverses and the data is cast back to the specific type. Many times this casting to and from generic data types not only takes time and resources but also requires managing many type def'ed controls for each specific data type used.

 

Here is a traditional method for passing data between processes:

Alternately, if the message (such as an enum) included the specific data type definition then no casting is required. This idea involves embedding inheritance of private class data into a defined LabVIEW primitive where each command is its own class of private data. It's like having your cake and eating it too! Or, it's like having your message and the data too! (cheesy, I know). Below is an idea for the configuration of the "Defined Enum":

Like a tab control, each tab is an Enum Item and the controls within the tab is the specific data associated with the item. The Defined Enum loads a drop-down selection list of the private data associated with the current item.

In the block diagram, like property nodes, the accessors would be used to get or set the values of the enum items. 

The sales pitch: When developing large applications where multiple services are running in parallel it is often difficult to develop completely modular processes because the casting to and from specific data types require a control dependency between the caller and the callee. Eliminating generic data casting would help develop a more robust hierarchy. I apologize if this idea is a repeat. Let me know what you think.

-Ryan

I've posted an idea, but didn't add any pic to explain:
http://forums.ni.com/t5/ideas/v2/ideapage/blog-id/labviewideas/article-id/16975/tab/rich

 

 

I've attached an image with this idea. Sorry for the duplicate posts.

These are simple examples but can get more complicated. For example, usage 2 can have more input (e.g. 4) it will have 16 possibilities which have different simplified code.

 

USAGE 1: User wires some input on the block diagram, when the simplify button is used, it simplifies the complicated code to a simple one ( noting that it is not the unique solution as shown in USAGE 3)

USAGE 2: If for the application, the user changes the value of the input and he gets different output; this table can get the simplified; or the "best fit" for the number of data present.

 

In http://forums.ni.com/t5/ideas/v2/ideapage/blog-id/labviewideas/article-id/16975/tab/rich, I wanted to compare that  Partial fraction expansion vi is not widely used except for certain applications yet it is important and beneficial.

Same goes for this idea.

 

Best


 

By default, the a newly created vi will have the 4-2-2-4 connector pane, But when you create a new subvi from a main vi, LabVIEW generates Connector pane based on number of input and outputs. I propose the newly created subvi will also have the 4-2-2-4 connector pane and hence mainitaining uniformity through out.See the attachments. This saves the pain of chaging the connector pane, disconnecting and reconnecting the input and the outpus

 

Also if there any error terminals present in the subvi then the same should get connected to the bottom left and right panes and Path/refnum to the top left and right pane

 untitled.GIF

 

the decorations in the front panel have properties, these properties you can to modify in execution time, but the order off these decorations is created automaticaly, and the newer decoration object, it's the first, and other existing decorations your order number is changed automaticaly.
Proposed solutions 
- the automatic order number should be generated, in the same order to are created the decorations, in the same way of controls
- create a new function to modifying the order number, the same way to modify the tab order of the controls.

 

Hi,

 

it would be a great idea to choose an option to put a LV icon on the taskbar when LV is minimized (when running a program), also try to eliminate the 2 windows when open an running a "vi", with one is too enought ...

 

Thanks !!!

Whenever we create an executable file for example, abcd.exe from abcd.vi that can be run on a computer having the runtime engine of the corresponding labview version, it has certain default data control set at the time of creating the .exe file. I propose that there be an option to set the values default after creating the executable file.

I propose a property node to tell if a control was wired when This VI was called as a subVI.

 

Wired.png

 

Sometimes it is practical to be able to distinguish if the value in a control was wired to it (data arrived via dataflow), or if the control was unwired and the value hence the control's default value. Even comparison with the known default value of the control isn't enough, as the program logic may depend on the value source.

 

Consider an FG that stores two data elements:

 

FG.png

 

You'll have to have two Set functions for this, one for Data 1 ("Set data 1"), and one for Data 2 ("Set data 2"). If you have only one Set function, you add the constraint that both data sets have to be present (wired) every time you set any of the two data sets, or else the unwired set will get overwritten in the FG with the default value of the unwired control. If the FG could decide programmatically if the value was wired to the control, or if it was merely the default value of the unwired control, it could decide whether to overwrite its stored copy or not. The data values could be the same in the two cases, but the actions very different. This is just a simple example, but I have many much more complex cases, that would get much simpler if I could tell where the control value came from. In the above example you could even dispose of the Function input alltogether, if I could tell if any data inputs were wired.

 

A polymorphic VI will remedy some of these issues, but not all, and in other cases a polymorphic VI is a drastic solution to a simple problem. It's also not an issue in a Top-level VI, as such run only once (only subVIs get called again and again, while depending on prior runs).

This post is intended to present a solution to a problem that I was struggling with using LV2 global variables in my applications.

I don't claim that this is a unique or elegant solution or even the first of its kind, but I'd be curious to hear comments and suggestions about it.

Since it might be a long post, I will split it into 3 parts.

Part 1 (below) will discuss the intended functionalities.

Part 2 will present my current implementation.

Finally, I will try to summarize all this into Part 3, opening the discussion.

 

So you may want to wait until that part is published before posting your comments (if any).

 

Part 1: What do I mean by Generalized Functional Global (or GFG)?

 

The LV2 global variable (or functional global, FG in short) is a well known structure (see for instance the beginning of this thread). It is a subVI which can store data locally in between calls. Usually it comes with a "Write" (or "Set") action and a "Read" (or "Get") action and a few inputs (and the same number of outputs). The inputs are the variables you want to update and the outputs, their corresponding values.

The advantage of this design over the standard LV global is that there is only one copy of your variables in memory. If you are only using scalars or string, etc., using LV globals might not necessarily be a big problem, but if you start storing arrays of large data structure, it could result in a significant performance penalty.

Note that there are other ways to pass data from VIs to VIs (queues and notifiers). Here, I am concerned with long term storage available from many parts of an architecture (e.g. subVIs or dynamically launched Vis).

To begin with, there are two major limitations with any design based on FG (at least that I am not happy with):

 

1) First, as emphasized above, due to the limited connectivity of a VI's connector pane, a FG cannot store a large number of variables. You can use clusters, but that is not always very practical.

 

2) Second, if you try to cramp as many variables in a single FG, you will probably run into the issue that you don't necessarily want to reset all variables at once, but maybe just one or two. That calls for a more sophisticated set of actions (Write Variable 1, Write Variable 2, etc, and possibly Write All, Clear All, etc).

In practice, if you use a lot of those FG, you will encounter a third problem:

 

3) In which FG did I store this @$%&! variable?

 

Some of my applications contain many of these FGs and I figured that this had become impractical to handle when I started duplicating them, having forgotten that I was handling variable "X" in an existing FG.

 

The obvious solution (apart from NOT using FGs) is to have a single FG that is designed such as to handle an unlimited number of variables of ANY type that can be modified at ANY TIME from ANYWHERE.

 

I first looked at the WORM (Write Once Read Many) design of tbob (you’ve got to go to the end of the thread to download the final version of the WORM VI). It is a very clever and compact solution to store different types of variables within a single variant.

Two of the limitations I saw in this design are that you need to know:

 

1) the NAME of the variable you want to access.

 

2) the TYPE of the variable that you are WRITING or READING.

 

Let me clarify those two points.

 

It seems obvious that you HAVE TO know the name of the variable you are interested in. Well, that’s maybe true when you are designing your application. But after a month or more doing other things, it is not obvious anymore whether you’ve stored the number of components as “# Components” or “Component #” in that other part of the program that…where did I save it, BTW? You get my point…

 

The second point is apparently taken care of by tbob’s solution of outputting the variable (as a variant) as well as its type. The problem is that this “type” provides a very limited description. For instance, what do you do with a “cluster” type?

 

Finally, since I want to be able to modify any variable at any time, the “Write Once” feature is not cutting it for me. This is could be easily modified, but considering the previous comments, I decided to change the architecture some more.

 

I will describe my solution in the next part.

 

Often times, I have a set of code in a for loop that takes a while to complete, so I put in a progress bar on the UI.  The problem is the progress bar defaults to 0-100 range, and my for loop normally does not have 100 iterations. 

So.... I can either rescale the progress bar to the number of elements, or I can use the "N" and "i" to calculate the percent complete and use that.

 

Since I like to keep my progress bars as 0-100 (since that works nicely to also show a percent complete) and % complete is useful elsewhere, I generally always end up calculating % complete of my for loops.

 

Well, why can't NI calculate this for me automatically???  Something like expanding the "i" iteration counter in the loop also have a "%" box right next to it.

 

Example shown below should probably wire as a double instead of an int, but you get the idea!

 

ForLoopProgress.jpg

In many of my programs, it is frequent that I have to issue a command, then wait for a period of time before reading a response. Usually, if there is a timing delay in code, it is usual to end up with something like this:

 

timing2.png

 

To do this more neatly, I created a timing subVI with errors wired in and out, and a number wired to it, to instruct the program to stay in that subVI for that period of time. It takes up much less space.

 

timing3.png

 

By doing this, I can easily control timing and execution. However, it's be nice to rework the 'milliseconds to wait' diagram so we could wire errors through it, as this would make the block diagrams so much neater...

 

I don't know if this idea belongs in the "LabVIEW" Ideas Exchange necessarily, but this idea is something that would really make a big difference to my LabVIEW development, so I offer it anyway: "Parallelise the FPGA Compiler to take advantage of modern multi-core computing power".

 

The FPGA compiler takes approximately four hours to compile my large FPGA VIs, which makes for long and tiresome debugging processes. It's clear that the compiler uses only one core of my CPU when compiling. If the compiler could be written to take advantage of the many cores of today's multi-core computers, it could potentially reduce my compilation times to an eighth! (Where I work we have an eight-core number crunching server ideal for just this task, and I'm sure we'll get even greater core counts in the near future - thinking GPU here).

 

I know the compiler is probably the intellectual property and responsibility of Xilinx Corp, and not National Instruments, but I expect NI can give them a big push if we all asked nicely for it!

 

Thoric

Enable a Sub VI to launch as a daemon without having to open a reference to it using its path.  The VI Properties page would look like this:

 

21429iB830C4B88A795136

Wait until done would be checked by default, and auto dispose reference would be left false be default.  So instead of parsing the path to the VI on disk and using a method to run it:

21433i0CFC0F873277247C

I just set the correct properties in the VI Properties page and drop the subVI on the block diagram of the calling VI.

In their current form, Auto-Indexing tunnels only operate on a single dimension of an array.  For example.  If you input a 2D array, through an auto indexing tunnel into a for loop, and display the resulting 1D array in an indicator inside the for loop as below, you will always get the last row.

 

I'd like to see a feature where you can right-click on the tunnel or something, and set it to auto-index by column, instead of by row, and get the last column instead.20773i86B483107F51CD3820775i651136B201680B64

 

It could be as simple as an option in the context menu for the auto-indexing tunnel to say "Index by rows" or "Index by columns"  It gets more complex with 3D 4D and moreD arrays, but you could do something like a submenu flyout that says "Index By Dimension" > "1", "2", "3" etc

 

It would be beneficial if nodes had the ability to retain data from their previous execution. Along with "Use Default If Unwired" it would save memory allocation and coding time if there was a "Use Current Value If Unwired" selection which would retain the node's value and pass the last executed value. 

 

 Use Current Value If Unwired.PNG

This figure illustrates one application where "Use Current Value If Unwired" would save memory and increase performance instead of using multiple property nodes or local variables for retaining the output data. It would also eliminate extra wiring in every case this node is not used.

I think there should be a way to reinitialize a stacked shift register to the originally initialized value so you can clear out the contents of every iteration all at once.  For example, the code below, implemented with 4 individual shift registers:

 

 multiple shift registers.PNG

 

Could be implemented with 1 stacked shift register with a reinitialize terminal:

 

stacked shift register with reinitialize.PNG 

Hi

 

Certainly, every body tries to evaluate a vi in terms of performance. This includes the time which a particular code takes to run. We have to use the tick cout vi in order to determine the time of execution.

How about adding an additional button in the  toolbar itself which measures the time taken by a particular code to execute? Smiley Happy

This can certainly be a good feature in LabVIEW!!!